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

docker daemon unable to access registry - Client.Timeout exceeded while awaiting headers #22635

Closed
almoehi opened this Issue May 10, 2016 · 52 comments

Comments

Projects
None yet
@almoehi
Contributor

almoehi commented May 10, 2016

Output of docker version:

Client:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Tue Apr 26 23:30:23 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Tue Apr 26 23:30:23 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 53
 Running: 0
 Paused: 0
 Stopped: 53
Images: 331
Server Version: 1.11.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 437
 Dirperm1 Supported: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: host bridge null
Kernel Version: 3.13.0-86-generic
Operating System: Ubuntu 14.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.66 GiB
Name: 3kolor
ID: BAOT:3C5I:WCTI:RXDF:5W55:BJTA:MRDP:NSAW:4H4R:ILDC:BG3Z:C65X
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): true
 File Descriptors: 12
 Goroutines: 35
 System Time: 2016-05-10T19:54:31.370342285+02:00
 EventsListeners: 0
Username: almoehi
Registry: https://index.docker.io/v1/
WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):
Ubuntu 14.04.4 LTS
Linux 3.13.0-86-generic #130-Ubuntu SMP Mon Apr 18 18:27:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce the issue:

  1. docker login

Describe the results you received:
It seems like docker daemon cannot access the internet, even though internet access is working on the box. I cant pull images and I cant even log-in to the registry.
I've re-installed the whole docker packages and rebooted the machine several times - no success.

docker login:

Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (******): 
Password: 
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

manually running a request with CURL works without problems:

 curl https://registry-1.docker.io/v2/
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}

running docker pull ubuntu just hangs forever without producing any debug output in the daemon logfile and after couple of minutes dies with following message:

Error response from daemon: error parsing HTTP 408 response body: invalid character '<' looking for beginning of value: "<html><body><h1>408 Request Time-out</h1>\nYour browser didn't send a complete request in time.\n</body></html>\n\n"

Describe the results you expected:
Docker daemon should be able to access the internet. Docker should successfully login to registry and pull images.

Additional information you deem important (e.g. issue happens only occasionally):

debug logfile

time="2016-05-10T19:56:01.669665420+02:00" level=debug msg="Calling GET /v1.23/info" 
time="2016-05-10T19:56:05.459596278+02:00" level=debug msg="Calling POST /v1.23/auth" 
time="2016-05-10T19:56:05.459709902+02:00" level=debug msg="form data: {\"email\":\"*****\",\"password\":\"*****\",\"serveraddress\":\"https://index.docker.io/v1/\",\"username\":\"******\"}" 
time="2016-05-10T19:56:05.459899278+02:00" level=debug msg="attempting v2 login to registry endpoint https://registry-1.docker.io/v2/" 
time="2016-05-10T19:56:06.429620835+02:00" level=debug msg="Increasing token expiration to: 60 seconds" 
time="2016-05-10T19:56:20.928767529+02:00" level=error msg="Handler for POST /v1.23/auth returned error: Get https://registry-1.docker.io/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)" 

debug logfile when running docker pull:

time="2016-05-10T20:03:52.257721929+02:00" level=error msg="Error trying v2 registry: error parsing HTTP 408 response body: invalid character '<' looking for beginning of value: \"<html><body><h1>408 Request Time-out</h1>\\nYour browser didn't send a complete request in time.\\n</body></html>\\n\\n\"" 
time="2016-05-10T20:03:52.257784072+02:00" level=error msg="Attempting next endpoint for pull after error: error parsing HTTP 408 response body: invalid character '<' looking for beginning of value: \"<html><body><h1>408 Request Time-out</h1>\\nYour browser didn't send a complete request in time.\\n</body></html>\\n\\n\"" 
time="2016-05-10T20:03:52.257835365+02:00" level=error msg="Handler for POST /v1.23/images/create returned error: error parsing HTTP 408 response body: invalid character '<' looking for beginning of value: \"<html><body><h1>408 Request Time-out</h1>\\nYour browser didn't send a complete request in time.\\n</body></html>\\n\\n\""
@ouyi

This comment has been minimized.

Show comment
Hide comment
@ouyi

ouyi Jun 2, 2016

Exactly the same issue here.

ouyi commented Jun 2, 2016

Exactly the same issue here.

@jsainzvela

This comment has been minimized.

Show comment
Hide comment
@jsainzvela

jsainzvela Jun 3, 2016

+1 on 1.11.2 under Ubuntu 14.04.4 LTS

jsainzvela commented Jun 3, 2016

+1 on 1.11.2 under Ubuntu 14.04.4 LTS

@jsainzvela

This comment has been minimized.

Show comment
Hide comment
@jsainzvela

jsainzvela Jun 3, 2016

Hi, I think we have hit the #15949 issue

Lowering my server's MTU to 1500 has worked around the problem.

Cheers

Hi, I think we have hit the #15949 issue

Lowering my server's MTU to 1500 has worked around the problem.

Cheers

@almoehi

This comment has been minimized.

Show comment
Hide comment
@almoehi

almoehi Jun 8, 2016

Contributor

I already hat MTU size of 1500 and still not working.

Apparently, enabling MTU probing in the kernel resolved the issue. To enable it just run:

 sudo sysctl -w net.ipv4.tcp_mtu_probing=1

To make this permanently, add the following line to /etc/sysctl.conf:

net.ipv4.tcp_mtu_probing=1

https://thesimplecomputer.info/pages/adventures-in-linux-tcp-tuning-page2

Contributor

almoehi commented Jun 8, 2016

I already hat MTU size of 1500 and still not working.

Apparently, enabling MTU probing in the kernel resolved the issue. To enable it just run:

 sudo sysctl -w net.ipv4.tcp_mtu_probing=1

To make this permanently, add the following line to /etc/sysctl.conf:

net.ipv4.tcp_mtu_probing=1

https://thesimplecomputer.info/pages/adventures-in-linux-tcp-tuning-page2

@almoehi almoehi closed this Jun 8, 2016

@justincormack

This comment has been minimized.

Show comment
Hide comment
@justincormack

justincormack Jun 8, 2016

Contributor

Glad you found a solution.

Contributor

justincormack commented Jun 8, 2016

Glad you found a solution.

@luxas

This comment has been minimized.

Show comment
Hide comment
@luxas

luxas Aug 28, 2016

I'm also getting this issue:

Error getting v2 registry: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Attempting next endpoint for pull after error: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Not continuing with pull after error: Network timed out while trying to connect to https://index.docker.io/v1/repositories/armhf/busybox/images. You may want to check your internet connection or if you are behind a proxy.

docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.1
Storage Driver: overlay
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: overlay null bridge host
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.19-1-ARCH
Operating System: Arch Linux ARM
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 922.2 MiB
Name: pi3arch
ID: 7MTA:UZIW:SVAS:H3U7:YBHE:FWXV:KWOS:4QAQ:HDLG:EWIV:DOAP:TWFR
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

I've set the mtu to 1500 and net.ipv4.tcp_mtu_probing=1 with no success :(
Any ideas?

luxas commented Aug 28, 2016

I'm also getting this issue:

Error getting v2 registry: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Attempting next endpoint for pull after error: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Not continuing with pull after error: Network timed out while trying to connect to https://index.docker.io/v1/repositories/armhf/busybox/images. You may want to check your internet connection or if you are behind a proxy.

docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.1
Storage Driver: overlay
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: overlay null bridge host
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.19-1-ARCH
Operating System: Arch Linux ARM
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 922.2 MiB
Name: pi3arch
ID: 7MTA:UZIW:SVAS:H3U7:YBHE:FWXV:KWOS:4QAQ:HDLG:EWIV:DOAP:TWFR
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
 127.0.0.0/8

I've set the mtu to 1500 and net.ipv4.tcp_mtu_probing=1 with no success :(
Any ideas?

@MathiasRenner

This comment has been minimized.

Show comment
Hide comment
@MathiasRenner

MathiasRenner Oct 13, 2016

Same issue here as reported by @luxas.

MathiasRenner commented Oct 13, 2016

Same issue here as reported by @luxas.

@LipingMao

This comment has been minimized.

Show comment
Hide comment
@LipingMao

LipingMao Nov 10, 2016

Same problem here, mtu already be 1500 and net.ipv4.tcp_mtu_probing=1 with no success.
@luxas @MathiasRenner

Same problem here, mtu already be 1500 and net.ipv4.tcp_mtu_probing=1 with no success.
@luxas @MathiasRenner

@luxas

This comment has been minimized.

Show comment
Hide comment
@luxas

luxas Nov 11, 2016

I found out that the problem might be in /etc/resolv.conf. I had:

nameserver 10.0.0.10
nameserver 8.8.8.8
nameserver 8.8.4.4

but moving the non-working (yet) 10.0.0.10 nameserver to the bottom fixed it for me I think

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 10.0.0.10

luxas commented Nov 11, 2016

I found out that the problem might be in /etc/resolv.conf. I had:

nameserver 10.0.0.10
nameserver 8.8.8.8
nameserver 8.8.4.4

but moving the non-working (yet) 10.0.0.10 nameserver to the bottom fixed it for me I think

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 10.0.0.10
@Nhoui

This comment has been minimized.

Show comment
Hide comment
@Nhoui

Nhoui Dec 29, 2016

Thank you luxas
It works great!!!

Nhoui commented Dec 29, 2016

Thank you luxas
It works great!!!

@Devendrabhat

This comment has been minimized.

Show comment
Hide comment
@Devendrabhat

Devendrabhat Jan 15, 2017

@luxas I worked for my linux system, but not getting what to do on windows. Please help if possible.

@luxas I worked for my linux system, but not getting what to do on windows. Please help if possible.

@diptiburli

This comment has been minimized.

Show comment
Hide comment
@diptiburli

diptiburli Jan 25, 2017

facing the same issue here changed the resolv.conf , modified mtu size .. no use. docker is still able to contact the registry.

facing the same issue here changed the resolv.conf , modified mtu size .. no use. docker is still able to contact the registry.

@diptiburli

This comment has been minimized.

Show comment
Hide comment
@diptiburli

diptiburli Jan 25, 2017

docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
Am seeing the above error

docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
Am seeing the above error

@chenrui333

This comment has been minimized.

Show comment
Hide comment
@chenrui333

chenrui333 Jan 26, 2017

@diptiburli I had the similar issue, what I did to resolve that:

  1. update docker and docker-machine to the latest version, 1.13.0
  2. brew link --overwrite docker and docker-machine
  3. docker-machine restart {VM}

Although I still have error with curl https://registry-1.docker.io/v2/, but the docker pull works for me:

$ curl https://registry-1.docker.io/v2/
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}

Let me know if this works for you.

chenrui333 commented Jan 26, 2017

@diptiburli I had the similar issue, what I did to resolve that:

  1. update docker and docker-machine to the latest version, 1.13.0
  2. brew link --overwrite docker and docker-machine
  3. docker-machine restart {VM}

Although I still have error with curl https://registry-1.docker.io/v2/, but the docker pull works for me:

$ curl https://registry-1.docker.io/v2/
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}

Let me know if this works for you.

@aasaanhai

This comment has been minimized.

Show comment
Hide comment
@aasaanhai

aasaanhai Jan 29, 2017

For Windows 10 Home, Putting 8.8.8.8 as the first dns resolves it.

For Windows 10 Home, Putting 8.8.8.8 as the first dns resolves it.

@kirstin

This comment has been minimized.

Show comment
Hide comment
@kirstin

kirstin Jan 30, 2017

@aasaanhai also worked for me.
Simply set the default DNS to 8.8.8.8 on the "vEthernet (DockerNAT)" network adapter.

kirstin commented Jan 30, 2017

@aasaanhai also worked for me.
Simply set the default DNS to 8.8.8.8 on the "vEthernet (DockerNAT)" network adapter.

@strainel

This comment has been minimized.

Show comment
Hide comment
@strainel

strainel Feb 6, 2017

thanks but where simply set the default DNS to 8.8.8.8 ?
on debian for exemple... thanks again

strainel commented Feb 6, 2017

thanks but where simply set the default DNS to 8.8.8.8 ?
on debian for exemple... thanks again

@JohnVonNeumann

This comment has been minimized.

Show comment
Hide comment
@JohnVonNeumann

JohnVonNeumann Feb 19, 2017

@strainel Should be on your network connections area, you're running linux so it should be similar to my ubuntu, use the GUI to go into your network settings, select the connection you're on, and then put the google dns settings in there. I don't have practical experience with debian but a google search should do the trick.

@strainel Should be on your network connections area, you're running linux so it should be similar to my ubuntu, use the GUI to go into your network settings, select the connection you're on, and then put the google dns settings in there. I don't have practical experience with debian but a google search should do the trick.

@strainel

This comment has been minimized.

Show comment
Hide comment
@strainel

strainel Feb 22, 2017

thanks @JohnVonNeumann i solved my issue.
the message "Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)" was caused by network connection with a proxy. with https://docs.docker.com/engine/admin/systemd/ (§ http proxy), it is ok.
i am surprised docker use systemd on debian... and not environment variables.
thanks again

thanks @JohnVonNeumann i solved my issue.
the message "Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled (Client.Timeout exceeded while awaiting headers)" was caused by network connection with a proxy. with https://docs.docker.com/engine/admin/systemd/ (§ http proxy), it is ok.
i am surprised docker use systemd on debian... and not environment variables.
thanks again

@cooligc

This comment has been minimized.

Show comment
Hide comment
@cooligc

cooligc Mar 2, 2017

+1 in RHEL 7

[root@minion2 yum.repos.d]# docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 17.03.0-ce
Storage Driver: overlay
 Backing Filesystem: xfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-514.el7.x86_64
Operating System: Red Hat Enterprise Linux Server 7.3 (Maipo)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 2.781 GiB
Name: minion2
ID: Q6KC:VGM5:DE7P:I2TW:H2SQ:A3CI:GFRM:IPLZ:MKA5:SHJI:6CLP:4XSU
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
[root@minion2 yum.repos.d]#

cooligc commented Mar 2, 2017

+1 in RHEL 7

[root@minion2 yum.repos.d]# docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 17.03.0-ce
Storage Driver: overlay
 Backing Filesystem: xfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-514.el7.x86_64
Operating System: Red Hat Enterprise Linux Server 7.3 (Maipo)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 2.781 GiB
Name: minion2
ID: Q6KC:VGM5:DE7P:I2TW:H2SQ:A3CI:GFRM:IPLZ:MKA5:SHJI:6CLP:4XSU
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
[root@minion2 yum.repos.d]#

@pronojitsaha

This comment has been minimized.

Show comment
Hide comment
@pronojitsaha

pronojitsaha Mar 8, 2017

Setting the DNS server to fixed (8.8.8.8) from automatic in docker settings solved the problem for me.
dns

Setting the DNS server to fixed (8.8.8.8) from automatic in docker settings solved the problem for me.
dns

@ravargs

This comment has been minimized.

Show comment
Hide comment
@ravargs

ravargs Mar 10, 2017

Hello,

I am still facing same issue. The server is behind the corporate proxy but woks for all other applications.

export http_proxy=http://user:password@proxyIP:8080/
export https_proxy=http://user:password@proxyIP:8080/
docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: xxxxxxx
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

ravargs commented Mar 10, 2017

Hello,

I am still facing same issue. The server is behind the corporate proxy but woks for all other applications.

export http_proxy=http://user:password@proxyIP:8080/
export https_proxy=http://user:password@proxyIP:8080/
docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: xxxxxxx
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

@ravargs

This comment has been minimized.

Show comment
Hide comment
@ravargs

ravargs Mar 10, 2017

I got it solved by adding the proxy details in the docker config file /etc/default/docker.

ravargs commented Mar 10, 2017

I got it solved by adding the proxy details in the docker config file /etc/default/docker.

@ratchakr

This comment has been minimized.

Show comment
Hide comment
@ratchakr

ratchakr Mar 19, 2017

Same problem faced running docker-machine on windows. Restarting docker-machine worked for me suggested by chenrui333. My docker version is 1.13.1

docker-machine restart

docker login as well as docker pull is working now.

Same problem faced running docker-machine on windows. Restarting docker-machine worked for me suggested by chenrui333. My docker version is 1.13.1

docker-machine restart

docker login as well as docker pull is working now.

@gfengwong

This comment has been minimized.

Show comment
Hide comment
@gfengwong

gfengwong Mar 27, 2017

Same problem here, mtu already be 1500 and net.ipv4.tcp_mtu_probing=1 with no success.dns=8.8.8.8 also no use

Same problem here, mtu already be 1500 and net.ipv4.tcp_mtu_probing=1 with no success.dns=8.8.8.8 also no use

@GArgiz

This comment has been minimized.

Show comment
Hide comment
@GArgiz

GArgiz Apr 21, 2017

I am getting the same issue...
I have tried change the mtu (1500,1400,1300) and nothing happens. There is not a proxy issue neither.
Can someone help ?
Thanks

Unable to find image 'mysql:latest' locally docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers). See 'docker run --help'.

docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Tue Mar 28 00:40:02 2017
OS/Arch: darwin/amd64

Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Fri Mar 24 00:00:50 2017
OS/Arch: linux/amd64
Experimental: false

GArgiz commented Apr 21, 2017

I am getting the same issue...
I have tried change the mtu (1500,1400,1300) and nothing happens. There is not a proxy issue neither.
Can someone help ?
Thanks

Unable to find image 'mysql:latest' locally docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers). See 'docker run --help'.

docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Tue Mar 28 00:40:02 2017
OS/Arch: darwin/amd64

Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Fri Mar 24 00:00:50 2017
OS/Arch: linux/amd64
Experimental: false

@matchilling

This comment has been minimized.

Show comment
Hide comment
@matchilling

matchilling Apr 26, 2017

I've experienced the above described problem this morning on my Ubuntu 16.04 machine (4.4.0-75-generic) as well.

$ docker version
Client:
 Version:      17.04.0-ce
 API version:  1.28
 Go version:   go1.7.5
 Git commit:   4845c56
 Built:        Mon Apr  3 18:07:42 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.04.0-ce
 API version:  1.28 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   4845c56
 Built:        Mon Apr  3 18:07:42 2017
 OS/Arch:      linux/amd64
 Experimental: false

After login with sudo rights (sudo docker login -u username -p password), which apparently worked, I've deleted the docker config (sudo rm ~/.docker/config.json) and restarted the docker service (sudo /etc/init.d/docker restart). For some magical reason I was now able to login again without super user rights.

Hope that helps.

matchilling commented Apr 26, 2017

I've experienced the above described problem this morning on my Ubuntu 16.04 machine (4.4.0-75-generic) as well.

$ docker version
Client:
 Version:      17.04.0-ce
 API version:  1.28
 Go version:   go1.7.5
 Git commit:   4845c56
 Built:        Mon Apr  3 18:07:42 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.04.0-ce
 API version:  1.28 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   4845c56
 Built:        Mon Apr  3 18:07:42 2017
 OS/Arch:      linux/amd64
 Experimental: false

After login with sudo rights (sudo docker login -u username -p password), which apparently worked, I've deleted the docker config (sudo rm ~/.docker/config.json) and restarted the docker service (sudo /etc/init.d/docker restart). For some magical reason I was now able to login again without super user rights.

Hope that helps.

@taostrive

This comment has been minimized.

Show comment
Hide comment
@taostrive

taostrive Apr 26, 2017

root@xxxx:# cat /etc/issue
Ubuntu 16.04 LTS \n \l
root@xxxx:
# docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:14:09 2017
OS/Arch: linux/amd64

Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:14:09 2017
OS/Arch: linux/amd64
Experimental: false
root@xxxx:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.

In my case, setting the environment variable http_proxy directly in shell and then run systemctl restart docker doesn't work at all, but we need to follow the instructions related to proxy server settings in https://docs.docker.com/engine/admin/systemd/, then it works!

root@xxxx:# cat /etc/issue
Ubuntu 16.04 LTS \n \l
root@xxxx:
# docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:14:09 2017
OS/Arch: linux/amd64

Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:14:09 2017
OS/Arch: linux/amd64
Experimental: false
root@xxxx:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.

In my case, setting the environment variable http_proxy directly in shell and then run systemctl restart docker doesn't work at all, but we need to follow the instructions related to proxy server settings in https://docs.docker.com/engine/admin/systemd/, then it works!

@alldev0825

This comment has been minimized.

Show comment
Hide comment
@alldev0825

alldev0825 Jul 3, 2017

Please refer to this: https://docs.docker.com/engine/admin/systemd/#httphttps-proxy
I have resolved on Ubuntu 16.04 LTS

Please refer to this: https://docs.docker.com/engine/admin/systemd/#httphttps-proxy
I have resolved on Ubuntu 16.04 LTS

@robbyemmert

This comment has been minimized.

Show comment
Hide comment
@robbyemmert

robbyemmert Jul 12, 2017

I'm getting this on Mac OS 10.12.5. I tried re-installing to the latest version of docker, and still no luck. Here's the error I'm getting:
Pulling wordpress (wordpress:latest)...
ERROR: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I'm getting this on Mac OS 10.12.5. I tried re-installing to the latest version of docker, and still no luck. Here's the error I'm getting:
Pulling wordpress (wordpress:latest)...
ERROR: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 24, 2017

Same issue here on Mac 10.12.4

Romans-Mac-Pro.local ➜  experimenting-armhf  docker build -t ruby-armhf-test .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM arm32v7/ruby:2.4.1
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Romans-Mac-Pro.local ➜  experimenting-armhf  wget 'https://registry-1.docker.io/v2/'
--2017-07-24 18:15:51--  https://registry-1.docker.io/v2/
Resolving registry-1.docker.io... 54.86.192.189, 52.72.188.69, 34.225.140.215
Connecting to registry-1.docker.io|54.86.192.189|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.
Romans-Mac-Pro.local ➜  experimenting-armhf  

Any ideas?

ghost commented Jul 24, 2017

Same issue here on Mac 10.12.4

Romans-Mac-Pro.local ➜  experimenting-armhf  docker build -t ruby-armhf-test .
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM arm32v7/ruby:2.4.1
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Romans-Mac-Pro.local ➜  experimenting-armhf  wget 'https://registry-1.docker.io/v2/'
--2017-07-24 18:15:51--  https://registry-1.docker.io/v2/
Resolving registry-1.docker.io... 54.86.192.189, 52.72.188.69, 34.225.140.215
Connecting to registry-1.docker.io|54.86.192.189|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.
Romans-Mac-Pro.local ➜  experimenting-armhf  

Any ideas?

@fcrimins

This comment has been minimized.

Show comment
Hide comment
@fcrimins

fcrimins Aug 8, 2017

I was getting this same error in Windows 10 Home using Docker Toolbox. Changing my DNS to Google's 8.8.8.8 (secondary to 8.8.4.4) worked for me (per @aasaanhai above). Detailed instructions for how to do so here (see section II).

fcrimins commented Aug 8, 2017

I was getting this same error in Windows 10 Home using Docker Toolbox. Changing my DNS to Google's 8.8.8.8 (secondary to 8.8.4.4) worked for me (per @aasaanhai above). Detailed instructions for how to do so here (see section II).

@BruceShenC

This comment has been minimized.

Show comment
Hide comment
@BruceShenC

BruceShenC Aug 9, 2017

@alldev0825, thanks! It works for me.

@alldev0825, thanks! It works for me.

@brunolm

This comment has been minimized.

Show comment
Hide comment
@brunolm

brunolm Aug 19, 2017

As kirstin said setting the DNS on Docker fixes the issue

DNS to 8.8.8.8 on the "vEthernet (DockerNAT)" network adapter.

You can do this from Powershell with

Get-DnsClientServerAddress | Where-Object { $_.InterfaceAlias -like "*(DockerNAT)" } | ForEach-Object { Set-DnsClientServerAddress -InterfaceIndex $_.InterfaceIndex -ServerAddresses @("8.8.8.8", "8.8.4.4") }

brunolm commented Aug 19, 2017

As kirstin said setting the DNS on Docker fixes the issue

DNS to 8.8.8.8 on the "vEthernet (DockerNAT)" network adapter.

You can do this from Powershell with

Get-DnsClientServerAddress | Where-Object { $_.InterfaceAlias -like "*(DockerNAT)" } | ForEach-Object { Set-DnsClientServerAddress -InterfaceIndex $_.InterfaceIndex -ServerAddresses @("8.8.8.8", "8.8.4.4") }
@1605200517

This comment has been minimized.

Show comment
Hide comment
@1605200517

1605200517 Oct 29, 2017

Here is a test setup with a Debian 9 Stretch; NOT behind a proxy.
From time to time the error is not there without system changes, so a pull occasionally succeeds or not.
Maybe this is due to slow network and timeout could be set higher?

Here is a test setup with a Debian 9 Stretch; NOT behind a proxy.
From time to time the error is not there without system changes, so a pull occasionally succeeds or not.
Maybe this is due to slow network and timeout could be set higher?

@jmaruti

This comment has been minimized.

Show comment
Hide comment
@jmaruti

jmaruti Nov 11, 2017

The solution from @brunolm worked for me! Thanks!

jmaruti commented Nov 11, 2017

The solution from @brunolm worked for me! Thanks!

@kiahmed

This comment has been minimized.

Show comment
Hide comment
@kiahmed

kiahmed Nov 19, 2017

adding name server 8.8.8.8 does it, wonder why docker don't care at all still this day? They want you to get the enterprise version or use their cloud?

kiahmed commented Nov 19, 2017

adding name server 8.8.8.8 does it, wonder why docker don't care at all still this day? They want you to get the enterprise version or use their cloud?

@fastinetserver

This comment has been minimized.

Show comment
Hide comment

I had a similar issue trying to login to my own docker repo.
Here is how i've managed to resolve it:
https://stackoverflow.com/questions/46822391/docker-toolbox-tutorial-client-timeout-exceeded-while-awaiting-headers/48064026#48064026

@gold-kou

This comment has been minimized.

Show comment
Hide comment
@gold-kou

gold-kou Jan 11, 2018

[ubuntu16.04, docker 18.01.0]
In my case, I could solve by setting proxy like this. This way is different one from above.

$ sudo mkdir -p /etc/systemd/system/docker.service.d
$ sudo vi /etc/systemd/system/docker.service.d/http_proxy.conf
[Service]
Environment="HTTP_PROXY=http://<your_proxy_ip>:/"
$ sudo vi /etc/systemd/system/docker.service.d/https_proxy.conf
[Service]
Environment="HTTPS_PROXY=http://<your_proxy_ip>:/"
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

[ubuntu16.04, docker 18.01.0]
In my case, I could solve by setting proxy like this. This way is different one from above.

$ sudo mkdir -p /etc/systemd/system/docker.service.d
$ sudo vi /etc/systemd/system/docker.service.d/http_proxy.conf
[Service]
Environment="HTTP_PROXY=http://<your_proxy_ip>:/"
$ sudo vi /etc/systemd/system/docker.service.d/https_proxy.conf
[Service]
Environment="HTTPS_PROXY=http://<your_proxy_ip>:/"
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

@virf9d0o

This comment has been minimized.

Show comment
Hide comment
@virf9d0o

virf9d0o Jan 22, 2018

I added below configuration on /etc/resolv.conf as suggested above and it works

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 10.0.0.10

I added below configuration on /etc/resolv.conf as suggested above and it works

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 10.0.0.10

@helysousa

This comment has been minimized.

Show comment
Hide comment
@helysousa

helysousa Jan 28, 2018

I faced the same problem on a Windows 10 machine. To solve the problem I accessed the Docker client Settings screen, tab Network, and changed the DNS Server to fixed IP 8.8.8.8. After restarting docker everything start working properly.

I faced the same problem on a Windows 10 machine. To solve the problem I accessed the Docker client Settings screen, tab Network, and changed the DNS Server to fixed IP 8.8.8.8. After restarting docker everything start working properly.

@IngoVals

This comment has been minimized.

Show comment
Hide comment
@IngoVals

IngoVals Feb 11, 2018

I'm on a Windows 10 machine as well, not behind proxy and setting DNS to 8.8.8.8 isn't working for me. No idea what is going on.

I'm on a Windows 10 machine as well, not behind proxy and setting DNS to 8.8.8.8 isn't working for me. No idea what is going on.

@vasantbala

This comment has been minimized.

Show comment
Hide comment
@vasantbala

vasantbala Feb 14, 2018

Changed the DNS Server to fixed IP 8.8.8.8 and it worked on windows 10

Changed the DNS Server to fixed IP 8.8.8.8 and it worked on windows 10

@montao

This comment has been minimized.

Show comment
Hide comment
@montao

montao Apr 23, 2018

I tried this "solution" and it doesn't work.

montao commented Apr 23, 2018

I tried this "solution" and it doesn't work.

@vzaidman

This comment has been minimized.

Show comment
Hide comment
@vzaidman

vzaidman Apr 25, 2018

8.8.8.8 didn't work for me, but 8.8.4.4 did work.
looks like whoever got this error- try different dns's and hopefully one of them will work.

vzaidman commented Apr 25, 2018

8.8.8.8 didn't work for me, but 8.8.4.4 did work.
looks like whoever got this error- try different dns's and hopefully one of them will work.

@irenekaiservi

This comment has been minimized.

Show comment
Hide comment
@irenekaiservi

irenekaiservi May 4, 2018

Windows 10: in Docker Client Settings, Network Tab. DNS Server set to Fixed and restart and then set back to Automatic and restart - worked for me.

Windows 10: in Docker Client Settings, Network Tab. DNS Server set to Fixed and restart and then set back to Automatic and restart - worked for me.

@supernicky

This comment has been minimized.

Show comment
Hide comment

supernicky commented Jun 12, 2018

thx

@shajay12

This comment has been minimized.

Show comment
Hide comment
@shajay12

shajay12 Jun 13, 2018

Hi Everyone,
Request every one to give any solution to me.
I have implemented everything that is written in this thread, but still the i am getting this error
"Client.Timeout exceeded while awaiting headers"
I am using Ubuntu 17.10.

Regards,
Aj

Hi Everyone,
Request every one to give any solution to me.
I have implemented everything that is written in this thread, but still the i am getting this error
"Client.Timeout exceeded while awaiting headers"
I am using Ubuntu 17.10.

Regards,
Aj

@supernicky

This comment has been minimized.

Show comment
Hide comment
@supernicky

supernicky Jun 13, 2018

Hi, in my case setting a fixed DNSmade things worse, the main course was the companys proxy (as always :) ). Try to change the proxy to a working one or working without one.

Hi, in my case setting a fixed DNSmade things worse, the main course was the companys proxy (as always :) ). Try to change the proxy to a working one or working without one.

@shajay12

This comment has been minimized.

Show comment
Hide comment
@shajay12

shajay12 Jun 13, 2018

@inevity

This comment has been minimized.

Show comment
Hide comment
@inevity

inevity Jul 2, 2018

@alldev0825 thanks. For old docker 1.13, can use /etc/sysconfig/docker to set proxy ,but for 17.06 docker-ce, it does not work,need setup proxy in the systemd dir as the link you supplied.

inevity commented Jul 2, 2018

@alldev0825 thanks. For old docker 1.13, can use /etc/sysconfig/docker to set proxy ,but for 17.06 docker-ce, it does not work,need setup proxy in the systemd dir as the link you supplied.

@shajay12

This comment has been minimized.

Show comment
Hide comment
@shajay12

shajay12 Jul 2, 2018

shajay12 commented Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment