Skip to content
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

Sonartype Nexus - Unauthorized when using PyPi Proxy #3122

Closed
alelavml3 opened this issue Apr 18, 2024 · 4 comments
Closed

Sonartype Nexus - Unauthorized when using PyPi Proxy #3122

alelavml3 opened this issue Apr 18, 2024 · 4 comments
Assignees
Labels
bug Something isn't working registry Related to package indexes and registries

Comments

@alelavml3
Copy link

Hi, with v0.1.33 release we are facing an authentication problems. We use a private Sonatype Nexus repository server which uses a private PyPi Repo to store our company private Python packages.
The command for compiling and install are the following:

export PYPI_INDEX_URL=https://$(NEXUS_USER):$(NEXUS_PWD)@$(NEXUS_SERVER_URL)
uv pip compile pyproject.toml -o requirements.txt --index-url $(PYPI_INDEX_URL)
uv pip sync requirements.txt --index-url $(PYPI_INDEX_URL)

The error we get is during uv pip sync:

error: Failed to download distributions
  Caused by: Failed to fetch wheel: google-cloud-pubsub==2.21.0
  Caused by: HTTP status client error (401 Unauthorized) for url (<NEXUS_SERVER_URL>/packages/google-cloud-pubsub/2.21.0/google_cloud_pubsub-2.21.0-py2.py3-none-any.whl#sha256=fabd19e08faa1f70081b0e5ea003a3c031a1d2c1b798cf1be5ded2dbf1d1dbef)

here the package is google-cloud-pubsub but it happens with any random package.

How can we fix this issue with this new version? For now, we are using v0.1.32 and everything works.

Thank you in advance for your answers!

@alelavml3 alelavml3 changed the title Sonar Sonartype Nexus - Unauthorized when using PyPi Proxy Apr 18, 2024
@zanieb
Copy link
Member

zanieb commented Apr 18, 2024

Hi! Sorry about that, this looks like a bug.

Can you provide logs with RUST_LOG=trace uv pip install -v ...?

@zanieb zanieb added bug Something isn't working registry Related to package indexes and registries labels Apr 18, 2024
@zanieb zanieb self-assigned this Apr 18, 2024
@alelavml3
Copy link
Author

pyproject.toml

[project]
name = "my-project"
version = "0.1.0"
description = "my description"
authors = [ {name = "My Name", email = "myemail@example.com"}, ]
requires-python = ">= 3.8"
dependencies = [
    "matplotlib==3.7.4",
    "ruff"
]

[project.optional-dependencies]
build = ["twine", "build"]

[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

The output of command RUST_LOG=trace uv pip sync requirements.txt --index-url https://nexus.internal/repository/pypi-group/simple --cache-dir .uv_cache --verbose is uploaded here because it is too long:
https://paste.ec/paste/8pAMIGZV#+p-t45+mOpgwb4QaRm9R08tenqqcbrDNzXXUR0NLw9M

zanieb added a commit that referenced this issue Apr 19, 2024
Roughly reverts
f7820ce
to reduce possible race conditions for pre-authenticated index URLs

Part of:

- #3123
- #3122
@alelavml3
Copy link
Author

I tried the v0.1.34 and it works. Thank you for the quick response!

@zanieb
Copy link
Member

zanieb commented Apr 19, 2024

Great to hear! Thanks for checking back in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working registry Related to package indexes and registries
Projects
None yet
Development

No branches or pull requests

2 participants