docker login issue - request canceled while waiting for connection

Viewed 4954

All of a sudden docker is showing a strange issue in my system. docker login is intermittently failing and docker pull is not working at all :(.

Here is one instance where the docker login was successful but the docker pull failed with an error.

$ docker login
Authenticating with existing credentials...
Login Succeeded

$ docker pull cooldocker19/manas-simple-flask:latest
Error response from daemon: Head https://registry-1.docker.io/v2/cooldocker19/manas-simple-flask/manifests/latest: Get https://auth.docker.io/token?account=cooldocker19&scope=repository%3Acooldocker19%2Fmanas-simple-flask%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

When I tried the above url ( ref: https://auth.docker.io/token?) from my browser or postman, it returns proper access_token as expected but not sure why docker daemon is not able to get it.

I followed multiple docker/StackOverflow threads where several people have reported this issue. Ex :

enter image description here

I added the following DNS as suggested in several threads but nothing helped. After trying different settings and spending more than 4/5 hours, I am kind of exhausted. Please let me know if you know how to fix this issue.

{
  "dns": [
    "8.8.8.8",
    "8.8.4.4"
  ]
}

PN - I am able to login to the docker hub from the tray-icon.

enter image description here

Update 1 As per my friend's suggestion, I tried adding the above DNS addressed to my system(Mac) DNS configuration but that didn't help.

Ref: https://osxdaily.com/2015/12/05/change-dns-server-settings-mac-os-x/

Update 2 I tried to troubleshoot with the dig and nslookup.

I found that the dig command with the registry-1.docker.io is intermittently(<20% time) failing. As mentioned above, there was no significant change in my system in the last few days.

Not sure if it suggests some issues with that server or my internet(system)!!

here is the log(lookup failed)

$ dig @8.8.8.8 registry-1.docker.io

; <<>> DiG 9.10.6 <<>> @8.8.8.8 registry-1.docker.io
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

Ref: https://www.a2hosting.in/kb/getting-started-guide/internet-and-networking/troubleshooting-dns-with-dig-and-nslookup

0 Answers
Related