Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker daemon "unknown: Authentication is required" message

I installed docker-toolbox on my Mac.

I ran the following command to login to our private registry (JFrog Artifactory 4.1). Provided username, email and password when requested and login succeeded.

docker login <registry url>

This created a file ~/.docker/config.json on my system having some representation of my credentials.

Pulling and pushing images worked fine for a while. At some point later, when i tried to pull an image, i ended up with the following

b745547eea8f: Retrying in 1 second
8e68617bcad0: Retrying in 1 second
d0a4a553178b: Retrying in 1 second 
4ef6bb1e3944: Retrying in 1 second 
5f70bf18a086: Retrying in 1 second 
69bd93b9db4e: Waiting
unknown: Authentication is required

Retried multiple times with no luck. Ran "docker login" again and retried. Same issue was seen for 2-3 minutes. After 2-3 minutes, "docker pull" worked.

Questions:

  • After ~/.docker/config.json file is created, do these credentials expire after a certain amount of time? If yes, how can i increase the expiration time.
  • Why did "docker pull" fail for first 2-3 minutes after logging in for the second time. Does this have anything to do with time on my local machine and VM on VirtualBox created by docker-toolbox?

We are about to open our private registry to everyone in our company. Don't want people to face these things while pulling images.

like image 413
pc70 Avatar asked Jul 09 '16 00:07

pc70


2 Answers

Your URL might be the culprit here. Since you didn't include it, it is hard to tell whether you used something like this:

https://artifactory.company.com (correct)

or this:

artifactory.company.com:443 (incorrect)

I have experienced that using a login URL like artifactory.company.com:443 will login successfully, but will have strange problems, such as preventing images from being pushed to Artifactory.

If this happens, either delete the file .docker/config.json and login again, or edit it, changing: artifactory.company.com:443 to https://artifactory.company.com

like image 75
tdensmore Avatar answered Sep 16 '22 11:09

tdensmore


Upgrading to latest version of Artifactory (4.10) helped. Didn't see this issue after that.

like image 26
pc70 Avatar answered Sep 18 '22 11:09

pc70