Closed
Labels
P0This is an emergency and more important than other current work. (Assignee required)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.
Description
Description of the problem / feature request:
When you have a ~/.netrc file with these contents:
machine github.com
login something
password something
Downloads of GitHub tarballs fail with this error:
skylib.0.8.0.tar.gz: GET returned 400 Bad Request
ERROR: no such package '@bazel_skylib//': java.io.IOException: Error downloading [https://github.com/bazelbuild/bazel-skylib/releases/download/0.8.0/bazel-skylib.0.8.0.tar.gz] to
If you copy the curl request of what bazel is doing, you can see why:
% curl -H 'User-Agent: Bazel/release 0.29.0' -H 'Authorization: Basic somebase64' -H 'Host: github.com' -H 'Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2' 'http://github.com/bazelbuild/bazel-skylib/releases/download/0.8.0/bazel-skylib.0.8.0.tar.gz' -L
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidArgument</Code><Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message><ArgumentName>Authorization</ArgumentName><ArgumentValue>token anything</ArgumentValue><RequestId>8A1908B7B4F61B0B</RequestId><HostId>G3CxaBga4CoVWwqf1fu4WMrr2LjLJ28s2H8+Kn90PFFFygw8KKQ6+JINoeUTipnpbtbcxmKhr9A=</HostId></Error>
Removing the Authorization header from the request fixes this issue. Switching the Basic auth to bearer or token and providing that directly doesn't solve this issue.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
bazel build //... --repository_cache=
What operating system are you running Bazel on?
macOS
What's the output of bazel info release?
release 0.29.0
Have you found anything relevant by searching the web?
Reacted by Tommy Zinnatullin, Hadrien Chauvin, Mark Engerißer and Dmitriy Chekmarev
Metadata
Metadata
Assignees
Labels
P0This is an emergency and more important than other current work. (Assignee required)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.
Activity
keith commentedon Sep 4, 2019
cc @genrym
jin commentedon Sep 5, 2019
cc @aehlig
dslomov commentedon Sep 5, 2019
cc @laurentlb this looks like a release blocker for 0.29 /cc #9293
katre commentedon Sep 5, 2019
Do we know what Bazel commit caused this to stop? Does it work with 0.28.1?
genrym commentedon Sep 5, 2019
@keith the PR referenced there is not the final implementation, and it was scrapped. The final implementation is pretty different.
Just to clarify, the same configuration works well with bazel
0.28.1?dslomov commentedon Sep 5, 2019
The original functionality went in in c26e339, so should already be present in 0.28. Does this work with 0.28 for you @keith?
laurentlb commentedon Sep 5, 2019
I think c26e339 was released only in 0.29 (it has only the 0.29 tag on GitHub; the baseline of 0.28 was from July 1st, so a few days before).
katre commentedon Sep 5, 2019
Is the solution to roll back c26e339, then?
dslomov commentedon Sep 5, 2019
The rollback might not be that easy... Can we investigate an actual fix?
katre commentedon Sep 5, 2019
I am afraid I don't understand the error. What is wrong with the "Authorization" header that Bazel is generating in the curl command?
dslomov commentedon Sep 5, 2019
I can reproduce the problem with 0.29.0 (with Bazel not with curl). I assume some versions of curl remove duplicate
Authorization:headers and some don't.15 remaining items
Remove support for authentication and .netrc
Remove support for authentication and .netrc
Bazel: Bump bazel version to 1.0.0rc2
Remove support for authentication and .netrc
HttpConnector.connect: request a function instead of fixed set of hea…
Readd support for authentication and .netrc
Readd support for authentication and .netrc
Remove support for authentication and .netrc
Remove support for authentication and .netrc
orgads commentedon Dec 24, 2019
This still happens to me with bazel 1.2.0.
orgads commentedon Dec 24, 2019
I had a cached version of http.bzl. I cleared the cache and it was solved.
orgads commentedon Aug 19, 2020
I just tried to build on a new machine, and ran into this issue again with 3.4.1. Possibly related #10998.