-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Delete fails and HTTP 401 on every other request #104
Comments
Guess it looks just like #75 but I'm using local storage. |
I do experience the same issue |
Hum... Maybe that's because you are using proxy pass ( Try with |
I am actually using the
The one thing that might be worth mentioning is that I use a jwilder/nginx-proxy container in front of this container as well as in front if the registry container itself to handle SSL. I have the following HTTP headers set for the registry container:
|
@Joxit I tried replacing This is from the registry containers
|
Hum... Okay, can I see the the header of your failing request (the one who cause the CORS error) ? In the network tab. The 401 status code is totally normal, the UI do 2 requests when the registry is protected. When the UI get a 401 error, it will do another requests with your credentials and it's OK. |
Ok. That explains the requests without credentials. As I understand it, deleting a tag through the UI should do 3 requests.
But what I'm seeing is that.
XHR from the browsers for reference. |
Having the same issue as @matutter although I can access my tags history. I get the same 401 errors when i try to delete anything. Looking at my chrome network console i can see a couple of things:
Nothing happens after that. the DELETE request is never send. |
Hi, I did some research, and I found that is a docker registry miss-configuration of OPTIONS requests. But if I'm understanding well the W3C spec about preflight requests, on OPTION requests, the server must respond a 200 status code with all correct headers event if it needs credentials. |
Can you tell me if this example is working ? When you use the UI as proxy, you should not have CORS errors... The other solution will be to override OPTIONS responses on the proxy where your docker registry is hosted. You will need to return 200 status code with all correct headers (those of your docker registry) |
@Joxit You got it right, the problem is the answer to the OPTIONS call, from Docker registry. The UI code has nothing to do. Server should return a 2xx error code instead of 401. Because of that 401, nothing further will work. I just had to change the Cors setup today, for the same reason, by moving the handling from the docker registry's responsibilities (because it does it wrong!), to the upper level, that is to the nginx ingress controller (I'm running docker registry inside a kubernetes cluster). |
For the others: also, if Cors headers issue is solved, remember that you also have to enable, inside the Docker registry, the DELETE operation. See https://docs.docker.com/registry/configuration/#delete |
@Joxit -maybe it would be good to document the part about cors header and docker registry being buggy ? |
@cr1st1p Yes, definitely ! |
https://enable-cors.org/server_nginx.html did the part with the OPTIONS header. :) |
@mabaum correct. Docker-registry problem is that it does not do a 'return 204' on the OPTIONS call, so it ends in validating the user and returning a 401 |
Thank you for your link 😉 |
I don't know much about nginx. I'm using successfully this image https://github.com/nginx-proxy/nginx-proxy to reverse proxy my docker registry. |
Now, I've managed to send to the browser the right OPTIONS answer of 204. |
Try to update the line
with
|
I'm running into an issue where
DELETE
is failing dispite what appears to be a correct registry config. It also looks like every request is tried without basic-auth resulting in an HTTP 401 from the registry but browsing works otherwise.docker-compose.yml for registry on server
I'm using Ansible to deploy this so these are jinja2 templates.
docker-compose for docker-registry-ui on laptop
config.yml
I can login and push/pull from this registry just fine. Again, the docker-registry-ui mostly works, I can browse my images and when I disable all auth on the registry deleting tags does work.
The text was updated successfully, but these errors were encountered: