How to debug docker login errors with curl? [Video]

Paul Pan
2021-01-28 10:44

If you have set up Artifactory Docker registry but is unable to login and authenticate your repository, this video demonstrates how to debug the issue with curl. The example is also setup using a Kubernetes installation.

 

Video Transcription

Hello, this is Paul from JFrog support. On today’s short video I’m going to demonstrate to you how to debug Docker login errors with curl command.

So we have set up a Docker registry on Artifactory, on our equipment environment. While I’m trying login here, we get an error saying “404 cannot be found”. But I know this cannot be true because I know for a fact that my Artifactory is reachable. So, what’s wrong with the settings? We can try actually debug it with a curl command so we issue a curl command to the [inaudible 00:00:57] and let’s see what’s in the return.

So, I see the return is from Artifactory, which I know the request, which Artifactory. But I’m also expecting in the return, it actually has a header with the URL, something that looks like this. Okay. So I’m expecting to see this, but I’m not seeing that, which means something must be wrong or was the request. If I go into the container and check the log… And tell Artifactory the request log, and they’ll issue the B2 command again. I can see it comes in as a B2 directly to the Artifactory. It worked if this was set up as a direct access method, let me demonstrate to you. So if it could be access method, I’m using direct access, this would just work for log in, it would just work. But unfortunately I was trying to make it work with the repository pass. So something must be wrong with my responses settings. Let’s take a look.

Okay, so I’m seeing [inaudible 00:02:46] here, which is essential for subdomain method, which looks correct. It takes the request and add the past prefix. However, something may be wrong with my repository, let’s check. So my server name is going through my host, Artifactory.com, but it doesn’t match what I’m seeing here. So let’s take it, modify it.

Now lets restart the container. Now let’s file the B2 end point again. It may take a little bit to refresh. Okay, now I’m seeing the URL in the return actually hit the token endpoint, which is going to be what Docker is going to do next. And then from our request log, I am actually seeing it to be, I’m seeing it comes in as the to API Docker Ruby to. Okay. So which means that ever since working out perspective. Now, if I try my Docker login, yeah it worked.

Okay, so this concludes our session today. If you have any comments, please feel free to leave below.