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

Authenticate Request Error For Nexus Registry #103

Open
deleomike opened this issue Aug 17, 2023 · 1 comment
Open

Authenticate Request Error For Nexus Registry #103

deleomike opened this issue Aug 17, 2023 · 1 comment

Comments

@deleomike
Copy link

Hello! Thanks for all the hard work you've put into this project, it's really cool!

Setup

  • Mac
  • python 3.8
  • oras-py: 0.1.23

Error

So I was following the tutorial to upload a file, and I got an error when I did this with a Nexus Repository. This repository is private, btw.

import oras.client

host = "http://my-docker.my-ip.com"
client = oras.client.OrasClient(hostname=host)
client.login(username="my-username", password="my-password", hostname=host, insecure=True)
client.push(files=["requirements.txt"], target=f"{host}/artifact:v1")

My issue is I was able to login, but on the push command it would error out to the wrong host.

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='sonatype%20nexus%20repository%20manager', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fa32854a230>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

When I added some print statements to provider.py, I found that the www-authenticate header param was being set to that Sonatype realm. However in the Via field, I found my hostname.

 {
...
 'WWW-Authenticate': 'BASIC realm="Sonatype Nexus Repository Manager"',
 'Via': '1.1 my-docker.my-ip.com', 
...
}

So, it seems there's a proxy. I was going to write a workaround for my project that inherits the registry and checks for the Via, but I figured this was a fix that would be useful to the community and wanted to report it.

@vsoch
Copy link
Contributor

vsoch commented Aug 17, 2023

If you'd care to open a PR I'd be happy to review it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants