-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http_archive reporting 404 Not Found instead of 302 Redirect #14866
Comments
This problem seems to be related to my |
We just ran into this issue as well and can also confirm that removing the |
I was able to root cause this and put up a fix here #14922. Bazel does actually follow 302s but it was breaking the encoding for the redirect-url in very subtle ways that may not produce a 200 when requested. |
`mergeUrls` does not need to rebuild the URL from scratch if user information exists on the original URL. This behavior can actually break the 302 redirect due to subtle changes in the URL/encoding and should be avoided when possible. This fixes bazelbuild#14866 by correcting the implementation of `mergeUrls` to match the documentation that was added instead of rebuilding the URL from scratch which breaks the encoding of signed URLs. Closes bazelbuild#14922. PiperOrigin-RevId: 431935885 (cherry picked from commit 8cefb8b)
`mergeUrls` does not need to rebuild the URL from scratch if user information exists on the original URL. This behavior can actually break the 302 redirect due to subtle changes in the URL/encoding and should be avoided when possible. This fixes #14866 by correcting the implementation of `mergeUrls` to match the documentation that was added instead of rebuilding the URL from scratch which breaks the encoding of signed URLs. Closes #14922. PiperOrigin-RevId: 431935885 (cherry picked from commit 8cefb8b) Co-authored-by: Benjamin Lee <ben@ben.cm>
Thanks bro, this save my life. |
Description of the problem:
Bazel
http_archive()
does not follow a HTTPS redirect.It complains about a 404 File not found while
wget
sees a 302 Found and then follows to the redirected URL.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Try to build Gerrit when not all resources are in the cache.
What operating system are you running Bazel on?
Debian Linux (testing), but seeing the same problem on MacOS.
What's the output of
bazel info release
?What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?Have you found anything relevant by searching the web?
Similar bug, but http->https redirect:
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: