Skip to content
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

Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection #611

Closed
mferlay opened this issue Mar 29, 2017 · 100 comments

Comments

@mferlay
Copy link

mferlay commented Mar 29, 2017

Expected behavior

Download an image and run the container

Actual behavior

Unable to download images

Information

  • Diagnostic ID: 04FECEE9-EA0F-4558-9DD2-1DC576836119/2017-03-29_15-30-01
  • docker run hello-world without locally image
  • Windows 10
  • Docker
    Version 17.03.1-ce-win5 (10743)
    Channel: stable
    b18e2a5

Steps to reproduce the behavior

  1. launch docker run hello-world without locally image in the least version of docker for windows
@hotdogee
Copy link

hotdogee commented Apr 3, 2017

I'm also experiencing this issue.
Diagnostic ID: 79D6DCBD-03D0-46A5-93B8-A6A28E122565/2017-04-03_18-16-29

@mferlay
Copy link
Author

mferlay commented Apr 3, 2017 via email

@mirzapourh
Copy link

I am experiencing the same issue since the latest update:
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

@MaxPovver
Copy link

The same issue...

@IAmAStealer
Copy link

IAmAStealer commented Apr 5, 2017

Same here,
Behind a proxy, installed 2 days ago, tried many of the DNS / PROXY solutions already posted.

EDIT : http://stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy
Repaired the proxy options for Docker with this link. Enjoy.

@friism
Copy link

friism commented Apr 11, 2017

I'm closing this issue since folks seem to have resolved the problem. @MaxPovver @hotdogee please open separate issues with diagnostic ids and details if you're still experiencing problems.

@videni
Copy link

videni commented May 16, 2017

@IAmAStealer , you link is for linux , not windows, I am using the latest docker Docker version 17.03.1-ce, build c6d412e , I have tried two windows 10 machines , still the problem, any solution please?

@Galilyou
Copy link

@videni try changing your DNS and proxy settings and retry. Changing the DNS from 8.8.8.8 to auto fixed it for me. Not sure why, though.

@DileepHariharanNokia
Copy link

Facing the same issue in windows enviornment. Any solutions?

@S4lem
Copy link

S4lem commented Jul 13, 2017

I had the same issue on Windows.
I Fixed this by setting 8.8.8.8 as the default DNS for the VM.

  • Go check your Network connections

  • Right click/Properties on your VM

  • Click once on Internet Protocol Version 4 (TCP/IPv4) to highlight it, then click on the Properties button again.

  • Then, set the default DNS at 8.8.8.8

@fcrimins
Copy link

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) also worked for me (per @aasaanhai here). Detailed instructions for how to do so here (see section II).

@mriffault
Copy link

Thanks for the DNS tips, it works.
For your privacy, you may use a more neutral DNS server, not the Google one, visit https://www.opennic.org/ to find the closest open server ;)

@baltzarmattsson
Copy link

baltzarmattsson commented Sep 2, 2017

Restarting docker fixed it for me on Windows

@l3x
Copy link

l3x commented Sep 29, 2017

In Ubuntu 16 had to change
from: dns-nameservers 8.8.8.8 8.8.4.4
to: dns-nameservers 8.8.8.8
in /etc/network/interfaces file

@evinhas
Copy link

evinhas commented Oct 11, 2017

For anyone who is changing the DNS but it is not getting results, check the proxy.
You should setup a proxy for docker:
https://stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy

First, create a systemd drop-in directory for the docker service:

mkdir /etc/systemd/system/docker.service.d

Now create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

If you have internal Docker registries that you need to contact without proxying you can specify them via the NO_PROXY environment variable:

Environment="HTTP_PROXY=http://proxy.example.com:80/"
Environment="NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com"

Flush changes:

$ sudo systemctl daemon-reload

Verify that the configuration has been loaded:

$ sudo systemctl show --property Environment docker
Environment=HTTP_PROXY=http://proxy.example.com:80/

Restart Docker:

$ sudo systemctl restart docker

@s-dobrovolschi
Copy link

The following works for me. I'm using Boot2Docker on Windows 10:
Go to ~/.docker/machine/machines/default/config.json and add your own DNS server into HostOptions/EngineOptions/Dns and restart docker machine.
{ "HostOptions": { "Driver": "", "Memory": 0, "Disk": 0, "EngineOptions": { "ArbitraryFlags": [], "Dns": ["8.8.8.8","8.8.4.4"] <-- set it here } }
https://stackoverflow.com/questions/34296230/how-to-change-default-docker-machines-dns-settings

@hilleer
Copy link

hilleer commented Oct 26, 2017

I met the same issue and solved it by restarting docker, as someone suggested here :-)

@andreipaz
Copy link

On Windows 10 docker's gui give some facilities.

Just right click on docker's icon in the tray bar and select "Settings"

Then, on the Docker's window, select the "Network" section and change the DNS option from "Automatic" to "Fixed" and hit "Apply". Docker will restart itself after that. I putted the Google's DNS (8.8.8.8) and it worked fine to me.

Hope it helps.

@ghost
Copy link

ghost commented Nov 21, 2017

Both windows 10 pro machines I have here have the same issue ( using docker for windows )

It's always broken after a machine reboot, and fixed by using the docker for windows gui to restart docker.
The issue is specific to docker as the machines work in all other ways.
Its a major pain foor our headless build machines which no longer just works from a boot and I have to remote desktop in to restart docker in order for it to function as a build client.

@mytech1235
Copy link

mytech1235 commented Dec 22, 2017

Make sure your proxy settings are correct in your docker settings. After I changed the proxy settings to Manual from "Use System Proxy" and supply the URL, it worked for me. (On Mac)

@ghayes7
Copy link

ghayes7 commented Jan 16, 2018

Still having this issue on Windows 10 with Docker v17.12.0-ce-win74 after an os boot / restart. No proxy but Docker still fails to connect. Restarting docker usually fixes the issue. Applying the DNS change in docker's network settings also fixes the issue but I'd wager it's because applying the network changes still enacts a docker restart.

@jongio
Copy link

jongio commented Jan 31, 2018

Some things that have worked:

  1. Disconnect any VPN connections
  2. Switch to Windows Containers and then back to Linux Containers

@WhatFreshHellIsThis
Copy link

WhatFreshHellIsThis commented Feb 2, 2018

I just downloaded Docker stable to my windows 10 today, not behind a proxy and ran into this issue, why on earth was it closed? This software is not ready for release with such a serious bug in it.

@starquake
Copy link

@WhatFreshHellIsThis The reason why it is closed is mentioned right before it is closed. Just scroll back...

@WhatFreshHellIsThis
Copy link

@starquake this should not have been closed in my opinion, nothing is "resolved" and this is the case where the issue was reported and this is the first result that comes up when I search for this problem.

@starquake
Copy link

@WhatFreshHellIsThis The issue was resolved. See comment by @mferlay. If you have a similar issue I suggest you do what @friism said: Open a new issue.

He probably needs to information to help you. Or maybe has other reasons. The point is: if you want results you should probably follow orders.

Hope this helps!

@hilleer
Copy link

hilleer commented Feb 5, 2018

@WhatFreshHellIsThis just to be sure - have you tryed to restart docker? :-) If you haven't read comments, that solved it for others.

@WhatFreshHellIsThis
Copy link

WhatFreshHellIsThis commented Feb 5, 2018

Yes, it was resolved (not by restarting, that did nothing) after I installed it tried it and it immediately failed and I needed it to work and had some free time on my hands so took the time to find a solution and after repeated searching came here to see it's a well known bug experienced by many people and apparently because there are some workarounds discovered by the victims of this bug it was decided there was no need to respect the users that took the time to report the issue and to respect the time of countless other potential users of the software that will give up on it after wasting their time installing it only to have it immediately fail by actually fixing it in the first place.

It's baffling to me that such a showstopper bug would be considered fine to leave in there, but other people jumping in to excuse it and normalize it is to be honest even more baffling.

@sreetejarusum
Copy link

I tried changing DNS to 8.8.8.8 in Docker network settings and restarted my docker, i am still not able to download images.

@junghanChoi
Copy link

junghanChoi commented Jun 17, 2019

Just restarting docker solved my problem.

@SBlechmann
Copy link

Well, for me the issue was that I forgot to give docker access to my local drive <.<*

@houmanb
Copy link

houmanb commented Jul 11, 2019

WE are actually sitting behind our company proxy and this configuration worked at least for us:
/etc/systemd/system/docker.service.d/http-proxy.conf

[Service]
Environment="http_proxy=http://proxy.xxxxxx:8080/"
Environment="https_proxy=http://proxy.xxxxxx:8080/"
Environment="HTTP_PROXY=http://proxy.xxxxxx:8080/"
Environment="HTTPS_PROXY=http://proxy.xxxxxx:8080/"

@markelliottsmarsh
Copy link

Thanks. DNS Change to 8.8.8.8 in Docker Network settings worked for me as well.

@jyleehe
Copy link

jyleehe commented Jul 25, 2019

@andreipaz Thanks It works!

@sbdevman
Copy link

Changing to Windows Containers is worked for but, But I want to use Linux Containers too.

@absay
Copy link

absay commented Aug 27, 2019

  • Changing DNS to 8.8.8.8 in Docker's Settings didn't work ❌
  • Restarting Docker didn't work ❌
  • Disconnecting from my VPN worked ✔️

edit: disregard that. It only worked for one image, attempting to download another image will fail again. Disappointing.

@svenluijten
Copy link

svenluijten commented Sep 4, 2019

Chiming in here for people still running into this issue:

You should run docker login from outside of WSL (1.0). I used PowerShell, and it worked first time.

@brabia
Copy link

brabia commented Sep 16, 2019

Facing the same issue in ubuntu 16.04 enviornment, no proxy, any solutions?

@brabia
Copy link

brabia commented Sep 16, 2019

SOLUTION:
ubuntu 16.04
no proxy

Updated /etc/resolv.conf
nameserver 10.0.2.3
nameserver 8.8.8.8
nameserver 8.8.4.4

@tiantiandas
Copy link

restarting docker also works for me.

@AlbertSugi
Copy link

Chiming in here for people still running into this issue:

You should run docker login from outside of WSL (1.0). I used PowerShell, and it worked first time.

This works for me Thank you a lot.

@andyraddatz
Copy link

Restarting docker fixed it for me on Windows

I'm on Windows 10 Pro, none of the DNS things fixed it or restarting docker, but restarting my PC did fix it.

@eduardhyan
Copy link

In my case, removing registry-1.docker.io from my hosts files fixed the issue. (running on windows)

@montao
Copy link

montao commented Mar 19, 2020

I had a strange error message trying to run docker behind a proxy last year, turned out that I had a typo in my proxy conf, had to fix "http:/proxy.." and correct it "http://proxy...". It took some time to find because the error message was not really informative...

@jiovanniro
Copy link

Restarting docker fixed it for me on Windows

If you're not sure how to restart docker, this forum was helpful:
https://forums.docker.com/t/restart-docker-service-from-command-line/27331/6

docker-machine restart

@komali2
Copy link

komali2 commented May 12, 2020

I fixed this issue by continuing to repeat my docker-compose up command, but on one of my attempts I also ran the google speed test, which i think spooked comcast into giving me the network speed I needed to not timeout. Then it worked.

@AvirupDas
Copy link

Updating nameservers to 8.8.8.8 within /etc/resolv.conf fixed the issue.

@Danielotuo
Copy link

restarting docker fixed the issue

docker-machine restart

@MateoLa
Copy link

MateoLa commented Jun 24, 2020

On linux, and working with rails, ruby verison on Dockerfile must match ruby version on Gemfile.
And thats it.

@lucassutelo
Copy link

Alterando o DNS para o do Google: 8.8.4.4 funcionou para mim.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Aug 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests