Open 2rs2ts opened 5 days ago
brew install --debug
shows that it's making requests with this argument, which seems obviously wrong (unless this is how homebrew redacts auth headers, in which case, I really think it could be clearer)--header Authorization:\ Bearer\ QQ==
It might be "obviously wrong", but it is certainly correct and intentional: https://github.com/Homebrew/brew/blob/2fb6bf05fbf0984fe7a6ab1476537d657a9fab01/Library/Homebrew/brew.sh#L994
I'm not sure what's going wrong for you, but I doubt it's related to the token. Using the header as used by brew
works for me:
❯ curl \
--silent \
--show-error \
--header 'Accept-Language: en' \
--fail \
--header 'Authorization: Bearer QQ==' \
--output bottle.tar.gz \
--location \
https://ghcr.io/v2/homebrew/core/gettext/blobs/sha256:7cf6084ae306256b1df18c8d75ba63abeccd5c605cfc8406dab8c09d98815bc1
❯ file bottle.tar.gz
bottle.tar.gz: gzip compressed data, was "gettext-bottle.tar", last modified: Wed Feb 21 16:54:44 2024, from Unix, original size modulo 2^32 24320000
I've tried setting HOMEBREW_GITHUB_PACKAGES_AUTH
too, actually, and it doesn't change anything about this behavior. Should I override HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN
instead? It seems weird to set it to my Github PAT, but according to the code you linked, that's what would set the header I need.
I am seeing the same issue as @2rs2ts for arm64 sonoma
. The error text is either a 403 or a protocol error.
I am running into this issue while attempting to install git via homebrew. git has 3 dependencies out of which brew is able to install 2 but fails to install gettext
.
@carlocab I am seeing curl: (56) The requested URL returned error: 403
curl \ --silent \ --show-error \ --header 'Accept-Language: en' \ --fail \ --header 'Authorization: Bearer QQ==' \ --output bottle.tar.gz \ --location \ https://ghcr.io/v2/homebrew/core/gettext/blobs/sha256:7cf6084ae306256b1df18c8d75ba63abeccd5c605cfc8406dab8c09d98815bc1
Might be a regional issue or something only affecting a certain server.
Can you check the output of that curl
command with -v
?
If this is a regional issue then this seems to have been going on for a while now. Same issue here for another package hosted on ghcr.io
Additionally, the problem isn't that the server isn't reachable or that a bad auth token is being sent. It is returning a 403; we don't have permission to interact with the endpoint.
Well it isn't happening to me copy-pasting that curl command you tried (UK connecting to ghcr.io endpoint 20.26.156.211, redirecting to pkg-containers.githubusercontent.com endpoint 185.199.111.154), so without any clues to figuring out why it's only affecting a couple of you out of the thousands of installs of gettext
daily then there's really nothing further we can do here.
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I was trying to install
imagemagick
andghostscript
.What happened (include all command output)?
When I got to the
gettext
dependency, I would get either protocol errors or 403 errors.brew install --debug
output shows that the request being made is invalid. There's so much output that I'm not going to paste it all here, but I will share the most relevant parts, as well as a gist that contains logs for attempts to install the target formulae as well as just the troublesome dependency,gettext
.Example 403:
Example protocol error:
What did you expect to happen?
I expected it to just work, same as installing pretty much everything else on my machine has worked. I've seen tell of this being something that can be caused by Github outages or by a VPN/firewall/proxy. Even though this is a machine owned by my employer, I don't think it's anything like that, because:
brew install --debug
shows that it's making requests with this argument, which seems obviously wrong (unless this is how homebrew redacts auth headers, in which case, I really think it could be clearer)--header Authorization:\ Bearer\ QQ==
If I manually construct a
curl
command similar to whatbrew install --debug
shows, I get a 200 just fine:Gives me output with a response showing a 200:
This actually holds true for not only this account I'm opening the issue with, but also my enterprise-managed account. Both tokens work fine when I manually construct a request, but neither work with homebrew.
brew install --debug
shows do not work when I'm on another machine (and the requests that I manually constructed do work.)HOMEBREW_NO_INSTALL_FROM_API
(which I really wish would make it so that the formulae would install from clones as well...)There are additional factors that make me suspect something is wrong with
brew
:brew gist-logs
does not work, it just saysError: No logs.
no matter what.The only thing that I'd say is going in favor of it being an issue with my machine and not with
brew
is the fact that an older Intel Mac I personally own can installgettext
fine using the samebrew
version, but it already had it installed because I already haveimagemagick
on there, so for all I know, that has something to do with it. The sha for the download it used was different than the one from my logs in this issue.Step-by-step reproduction instructions (by running
brew
commands)