Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Unable to connect to Docker daemon, Maximum number of retries (60) exceeded #2879

Closed
alycda opened this issue Jan 19, 2016 · 23 comments
Closed

Comments

@alycda
Copy link

alycda commented Jan 19, 2016

Hi,

Last week I was able to run docker without any issues. The only thing that I have changed since then was upgrading node to latest stable, v5.4.1

Steps to reproduce:

$ docker-machine start default
Starting VM...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

$ eval "$(docker-machine env default)"
Maximum number of retries (60) exceeded

Because of the last error, I am unable to run docker:

$ docker run -i -p 80:80 -p 8080:8080 --add-host='<REDACTED>' --add-host='<REDACTED>' --add-host='<REDACTED>' -v `pwd`:/var/folder_name -t alyda/tr $1
Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

docker-machine version 0.4.1 (e2c88d6)

@alycda
Copy link
Author

alycda commented Jan 19, 2016

So I upgraded docker-machine to version 0.5.6, build 61388e9, but I am still getting errors:

$ docker-machine start default
Starting "default"...
(default) Waiting for an IP...
Machine "default" was started.
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

$ eval "$(docker-machine env default)"
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": dial tcp 192.168.99.100:2376: getsockopt: connection refused
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.

$ docker-machine regenerate-certs default
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Detecting the provisioner...
Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded

$ docker run -i -p 80:80 -p 8080:8080 --add-host='<REDACTED>' --add-host='<REDACTED>' --add-host='<REDACTED>' -v `pwd`:/var/folder_name -t alyda/tr $1
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

@jeanlaurent
Copy link
Member

what does a docker-machine ls returns ?

You may have to delete / recreate a machine if still stuck.
To do this :

docker-machine rm -f default
docker-machine create -d virtualbox default

btw, on which OS are your running all this ?

@alycda
Copy link
Author

alycda commented Jan 20, 2016

$ docker-machine ls
NAME      ACTIVE   URL          STATE     URL   SWARM   DOCKER    ERRORS
default   -        virtualbox   Stopped                 Unknown  

Running on OSX 10.10.5 (Yosemite)

Update: this might be more useful:

NAME      ACTIVE   URL          STATE     URL                         SWARM   DOCKER    ERRORS
default   -        virtualbox   Running   tcp://192.168.99.100:2376           Unknown   Unable to query docker version: Cannot connect to the docker engine endpoint

@brandontamm
Copy link

@alycda - I had the same issue twice after upgrading docker-machine. if you are using brew, you can try what I did - uninstall docker, docker-compose, docker-machine, restart your mac, and reinstall.

This worked after the above steps:
~ ❯ docker-machine create --virtualbox-memory "4096" --virtualbox-disk-size "20000" --virtualbox-cpu-count "2" --driver virtualbox dev

OS X 10.11 El Capitan
Docker version 1.9.1, build a34a1d5
docker-machine version 0.5.6, build 61388e9
docker-compose version 1.5.2, build unknown

@alycda
Copy link
Author

alycda commented Jan 20, 2016

Thanks,

the following worked for me:

$ brew uninstall docker docker-compose docker-machine
Error: No such keg: /usr/local/Cellar/docker

restart computer...

$ brew install docker docker-machine
==> Downloading https://homebrew.bintray.com/bottles/docker-1.9.1_1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring docker-1.9.1_1.yosemite.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/docker
Target /usr/local/bin/docker
already exists. You may want to remove it:
  rm '/usr/local/bin/docker'

To force the link and overwrite all conflicting files:
  brew link --overwrite docker

To list all files that would be deleted:
  brew link --overwrite --dry-run docker

Possible conflicting files are:
/usr/local/bin/docker
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/docker/1.9.1_1: 10 files, 9.6M
==> Downloading https://homebrew.bintray.com/bottles/docker-machine-0.5.6_1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring docker-machine-0.5.6_1.yosemite.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/docker-machine
Target /usr/local/bin/docker-machine
already exists. You may want to remove it:
  rm '/usr/local/bin/docker-machine'

To force the link and overwrite all conflicting files:
  brew link --overwrite docker-machine

To list all files that would be deleted:
  brew link --overwrite --dry-run docker-machine

Possible conflicting files are:
/usr/local/bin/docker-machine
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/docker-machine/0.5.6_1: 5 files, 36.3M
$ docker-machine create -d virtualbox dev
Running pre-create checks...
(dev) You are using version 4.3.34r104062 of VirtualBox. If you encouter issues, you might want to upgrade to version 5 at https://www.virtualbox.org
Creating machine...
(dev) Copying /Users/adavis/.docker/machine/cache/boot2docker.iso to /Users/adavis/.docker/machine/machines/dev/boot2docker.iso...
(dev) Creating VirtualBox VM...
(dev) Creating SSH key...
(dev) Starting the VM...
(dev) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available...
Detecting operating system of created instance...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect Docker to this machine, run: docker-machine env dev
$ eval $(docker-machine env dev)
$ docker run -i -p 80:80 -p 8080:8080 --add-host='<REDACTED>' --add-host='<REDACTED>' --add-host='<REDACTED>' -v `pwd`:/var/folder_name -t alyda/tr $1
Unable to find image 'alyda/tr:latest' locally
latest: Pulling from alyda/tr
...

The 'dev' machine appears to be working now, but the 'default' machine is still broken. I don't care to fix it if I can work off the recently created 'dev' machine but I am curious to know what happened and how to prevent it.

dev machine running:

$ docker-machine ls
NAME      ACTIVE   URL          STATE     URL                         SWARM   DOCKER    ERRORS
default   -        virtualbox   Stopped                                       Unknown   
dev       *        virtualbox   Running   tcp://192.168.99.100:2376           v1.9.1    

attempting to run 'default'

$ docker-machine ls
NAME      ACTIVE   URL          STATE     URL                         SWARM   DOCKER    ERRORS
default   *        virtualbox   Running   tcp://192.168.99.100:2376           Unknown   Unable to query docker version: Cannot connect to the docker engine endpoint
dev       -        virtualbox   Stopped                                       Unknown   

@dideler
Copy link

dideler commented Jan 28, 2016

Running into the same issue as described in #2879 (comment).

Output of docker-machine ls

NAME      ACTIVE   URL          STATE     URL                         SWARM   DOCKER    ERRORS
default   *        virtualbox   Running   tcp://192.168.99.100:2376           Unknown   Unable to query docker version: Cannot connect to the docker engine endpoint

Docker version 1.9.1, build a34a1d5
docker-machine version 0.5.6, build 61388e9
docker-compose version 1.5.2, build 7240ff3

Installed with DockerToolbox-1.9.1i.pkg

Recreating the default machine worked, did not have to reinstall docker or restart computer.

@jimzucker
Copy link

I am suddenly having the same issue:

➜ ~ docker-machine start default
Starting "default"...
(default) Waiting for an IP...
Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded

Deleting the machine and trying to re-create it seemed to work, but it look some time:

➜ ~ docker-machine create -d virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying /Users/jaz/.docker/machine/cache/boot2docker.iso to /Users/jaz/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available...
Detecting operating system of created instance...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect Docker to this machine, run: docker-machine env default

@jpae
Copy link

jpae commented Feb 19, 2016

I ran into the same issue of Unable to query docker version: Cannot connect to the docker engine endpoint This happened after using a VPN. Fortunately, I didn't have to create a new one. What I did to bring it back to life is just stop it and start it again.

@rehia
Copy link

rehia commented Feb 22, 2016

Same for me here.
Like @alycda, my VM was running.
And like @jpae, I just restarted it, and I didn't get error messages anymore.

@rafaelverger
Copy link

@jimzucker @dideler @alycda I got the same issue here. It seems to started after I've updated docker and docker-machine.
I tried to stop/start but it doesn't worked and when I remove them and try to create again I got this message:

Running pre-create checks...
(default) Default Boot2Docker ISO is out-of-date, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v1.10.2
(default) Downloading /Users/rafaelverger/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v1.10.2/boot2docker.iso...

@spencerkohan
Copy link

Having the same problem.

I'm running OSX 10.11 - my setup was working fine, and after a couple weeks of not working with Docker this is now happening:

NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   -        virtualbox   Running   tcp://192.168.99.100:2376           Unknown   Unable to query docker version: Cannot connect to the docker engine endpoint

I have now updated the docker toolkit, and virtual box, but the error was showing up before I changed anything. I may have run some updates to OSX in that time, but I am not sure.

versions:

$ docker version
Client:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   c3959b1
 Built:        Mon Feb 22 22:37:33 2016
 OS/Arch:      darwin/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

$ docker-machine version
docker-machine version 0.6.0, build e27fb87

@n3integration
Copy link

FWIW - I was having the same problem with the vmwarefusion driver. I eventually upgraded my docker client from 1.10.2 to 1.10.3 and recreated the boot2docker VM to resolve an issue similar to the one above. One thing that helped troubleshoot the issue was to run docker-machine with the --debug flag.

@Laxman-SM
Copy link

Hi,
On digitalocean i'm getting error "Error creating machine: Error running provisioning: Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded" i try to

Mac-Laxman:~ laxmansingh$ docker-machine create -d digitalocean yash
Running pre-create checks...
Creating machine...
(yash) Creating SSH key...
(yash) Creating Digital Ocean droplet...
(yash) Waiting for IP address to be assigned to the Droplet...
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available...
Detecting operating system of created instance...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Error creating machine: Error running provisioning: Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded

docker-machine --version
docker-machine version 0.5.3, build 4d39a66

i tried same on last week but no luck, as per my analysis systemd failing and unable to restart. anyone got success to fix the issue.

@mabounassif
Copy link

I was able to solve the issue by going on the VirtualBox console and remove any reference to a "default" box. I removed the whole folder ~/.docker [Do this with care as you'd loose all the machines you created, you probably can selectively remove the machines that you don't want]. Restart computer [was too lazy to pick and choose my processes]. It worked!

@alycda alycda closed this as completed Mar 7, 2018
@nhooey
Copy link

nhooey commented Mar 20, 2018

@alycda: Could you reopen this issue until we find the cause and solution? It's the top-ranking Google hit for "Unable to verify the Docker daemon is listening", and it seems to continuously happen for several people.

This happens to me often when I stop the machine with docker-machine stop default and start it up again with docker-machine start default without any other changes to the system. I often have to delete and recreate the machine.

I'm using Docker on Mac OS 10.13.3 with Parallels Desktop Pro. The same issue occurs with VMWare Fusion and with VirtualBox, as reported in this bug thread. So it seems to be non-driver-specific.

$ docker-machine ls
NAME      ACTIVE   DRIVER      STATE     URL                       SWARM   DOCKER    ERRORS
default   -        parallels   Running   tcp://10.211.55.11:2376           Unknown   Unable to query docker version: Cannot connect to the docker engine endpoint

$ docker --version && docker-compose --version && docker-machine --version
Docker version 18.02.0-ce, build fc4de44
docker-compose version 1.19.0, build unknown
docker-machine version 0.14.0, build 89b8332

@nhooey
Copy link

nhooey commented Mar 20, 2018

@jpae: How sure are you that the VPN is affecting your broken Docker machine?

@nhooey
Copy link

nhooey commented Mar 20, 2018

@jimzucker @dideler @alycda I got the same issue here. It seems to started after I've updated docker and docker-machine.

It happens to me without updating anything Docker or from the OS.

@brandontamm
Copy link

brandontamm commented Mar 20, 2018 via email

@nhooey
Copy link

nhooey commented Mar 21, 2018

This is no longer any issue. Previous releases many months ago have resolved issue

Which specific cause of the issue are you referring to?

Is it resolved as of the latest Docker versions that I mentioned in my comment?

@paulsimongb
Copy link

I am still getting this issue on Docker version 18.03.1-ce. I am trying to run Docket for Planning Analytics Workspace from IBM. The docket machine repeatedly fails at this step Setting Docker configuration on the remote daemon.... No explanation is given.

@duxbuse
Copy link

duxbuse commented Jan 22, 2019

Im still having this same issue

@paulsimongb
Copy link

Strange this issue shows as closed but there are still messages. Anyway, I don't know the context you are are working in. If it is Planning Analytics, I would advise your to uninstall everything. Put at least 16GB of RAM into the box, and then try again. It will probably work. Docker for Planning Analytics needs a lot of RAM!

@nielsole
Copy link

We also started having this issue at 22nd of Janauary. Maybe related to @duxbuse ? Or did you have this issue before?

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