-
Notifications
You must be signed in to change notification settings - Fork 878
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
Authentication for index-url not being used #1458
Comments
Just saw #1371, probably the same issue. I get the same 405, and my feed is also azure artifacts. Feel free to close in favor of that one. Adding an additional datapoint since I just saw #1388 From what I can tell, that isn't the issue here, as the URLs queried from pip and from uv seem to be the same, except for the extra sha at the end which shouldn't make a difference. uv
pip
|
@VMRuiz what does your I get your But when I supply the personal access token like in my OP, the error is the 405. In your case, it seems to be failing at an earlier step ( |
My PIP_EXTRA_INDEX_URL is like: |
Also seeing this with JFrog PyPI indexes |
Thanks! Will take a look. |
I think I'm having the same issues when trying to fetch packages from a private PyPI server. I get I have nothing at $ uv pip compile --verbose --index-url="https://${PYPI_USER}:${PYPI_PASS}@pypi.voltaware.com/simple" pyproject.toml --output-file=requirements.txt
[...]
uv_client::html::parse url=Url { scheme: "https", cannot_be_a_base: false, username: "correct-username", password: Some("correct-password"), host: Some(Domain("pypi.voltaware.com")), port: None, path: "/simple/[redacted]/", query: None, fragment: None }
[...]
error: Failed to download: [redacted]
Caused by: The wheel [redacted]-py3-none-any.whl is not a valid zip file
Caused by: an upstream reader returned an error: io error occurred: HTTP status client error (401 Unauthorized) for url (https://pypi.voltaware.com/packages/[redacted]-py3-none-any.whl#sha256=[redacted])
Caused by: io error occurred: HTTP status client error (401 Unauthorized) for url (https://pypi.voltaware.com/packages/[redacted]-py3-none-any.whl#sha256=[redacted])
Caused by: HTTP status client error (401 Unauthorized) for url (https://pypi.voltaware.com/packages/[redacted]-py3-none-any.whl#sha256=[redacted]) |
Same here. I have user and token in a Gitlab url passed with
where |
I believe the issue for Azure Artifacts is that
The failed HEAD request looks like:
I imagine that the https://github.com/astral-sh/uv/blob/main/crates/uv-client/src/registry_client.rs#L441 might be related, with the error handling in uv/crates/uv-client/src/error.rs Line 160 in 4b92a51
It seems there may be a couple of other issues reported in this thread however. I'd suggest splitting the conversation here perhaps, between Azure Artifacts specific issues and the perhaps more general |
Thanks for the information! cc @charliermarsh who was just working with this code. |
…llowed Azure Artifacts does not allow HEAD requests when attempting to download packages. This expands error handling in `is_http_range_requests_unsupported` to identify HTTP 405 (Method Not Allowed) error codes, and return `true` (i.e. Range requests will not be supported). This partially addresses astral-sh#1458 – after this change, Azure Artifacts downloads still fail, but due to 401 Not Authorized instead of 405 Method Not Allowed.
Yeah, I've seen the two different error codes:
|
Ahh thank you, ok, I can take this one. |
@charliermarsh after working around the 405 issue on Azure Artifacts, I'm getting a 401 error: |
…llowed (#1713) ## Summary Azure Artifacts does not allow HEAD requests when attempting to download packages. This expands error handling in `is_http_range_requests_unsupported` to identify HTTP 405 (Method Not Allowed) error codes, and return `true` (i.e. Range requests will not be supported). This partially addresses #1458 – after this change, Azure Artifacts downloads still fail, but due to 401 Not Authorized instead of 405 Method Not Allowed. ## Test Plan I ran something akin to ``` RUST_LOG=trace cargo run -- pip install --index-url=https://REDACTED:[email protected]/REDACTED/_packaging/REDACTED/pypi/simple/ --upgrade --verbose private-package ``` without this code, and got a 405 failure: ``` error: Failed to download: private-package==1.2.3 Caused by: HTTP status client error (405 Method Not Allowed) for url (https://pkgs.dev.azure.com/REDACTED/_packaging/REDACTED/pypi/download/private-package/1.2.3/private_package-1.2.3-py3-none-any.whl#sha256=REDACTED) ``` with this code, I get a 401 failure: ``` error: Failed to download: private-package==1.2.3 Caused by: HTTP status client error (401 Unauthorized) for url (https://pkgs.dev.azure.com/REDACTED/_packaging/REDACTED/pypi/download/private-package/1.2.3/private_package-1.2.3-py3-none-any.whl#sha256=REDACTED) ``` ## Caveats I'm not seeing a non HEAD request being reported as being fired, so I'm not sure I'm doing this correctly!
I'm gonna merge this into #1371. |
I am running
It is being correctly parsed:
But then when it goes to query the index, it seems to not be using the user and password:
Which results in the error
The text was updated successfully, but these errors were encountered: