machine icon indicating copy to clipboard operation
machine copied to clipboard

Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded

Open theodotos opened this issue 7 years ago • 15 comments

I'm trying to provision a machine on DO:

$ docker-machine create --driver digitalocean --digitalocean-access-token=$DO_TOKEN demo
Running pre-create checks...
Creating machine...
(demo) Creating SSH key...
(demo) Creating Digital Ocean droplet...
(demo) Waiting for IP address to be assigned to the Droplet...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
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

The service file looks like this:

[Service]
ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=digitalocean
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
Environment=[Service]
ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem --tlscert /etc/docker/server.pem --tlskey /etc/docker/server-key.pem --label provider=digitalocean
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
Environment=

[Install]
WantedBy=multi-user.target


[Install]
WantedBy=multi-user.target

Take note of the double '-H' option in 'ExecStart'. This results to:

# systemctl status docker
● docker.service
   Loaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2018-09-06 16:00:41 UTC; 3h 49min ago
  Process: 4906 ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --storage-driver aufs --tlsverify --tlscacert /etc/docker/ca.pem -
 Main PID: 4906 (code=exited, status=1/FAILURE)

Sep 06 16:00:41 demo systemd[1]: Started docker.service.
Sep 06 16:00:41 demo docker[4906]: Please specify only one -H
Sep 06 16:00:41 demo systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Sep 06 16:00:41 demo systemd[1]: docker.service: Unit entered failed state.
Sep 06 16:00:41 demo systemd[1]: docker.service: Failed with result 'exit-code'.

I'll leave this here in case the project gets back to track.

theodotos avatar Sep 06 '18 19:09 theodotos

Same issue here

MadeoIT avatar Oct 28 '18 03:10 MadeoIT

I have solved the issue in the following manner:

1- Re-install VB. Download a new version if needed 2- Reboot the system. 4- Start Docker by opening Docker Quickstart Terminal 3- The following error was still appearing: Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded

4- In my git bash I have used the following command to solve it :

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

I hope this can help you.

MadeoIT avatar Nov 04 '18 02:11 MadeoIT

@MadeoIT is right on point!

Shivendra30 avatar Jun 13 '19 02:06 Shivendra30

@MadeoIT thankU!!

GabbyYam avatar Nov 09 '19 09:11 GabbyYam

hero!

eduardomgonzalez avatar Dec 18 '19 10:12 eduardomgonzalez

How to change that default value of 10 retries to 20? Looks like with Parallels Desktop it is always not enough.

JulyIghor avatar Jun 29 '20 13:06 JulyIghor

This is still happening in 2021. What, why and how do we fix this?

asencis avatar Feb 03 '21 10:02 asencis

Yup, same! Running into it running this command docker-machine create --driver digitalocean --digitalocean-size s-1vcpu-1gb --digitalocean-access-token YOUR_TOKEN_HERE tinyboxes-alert

skyfly200 avatar Feb 20 '21 17:02 skyfly200

@MadeoIT Are your instructions to fix for a virtualbox driver? OP was posting an error about a digital-ocean driver.

zwhitchcox avatar Feb 25 '21 16:02 zwhitchcox

I have tried this on @digitalocean machines 16.04, 18.04, and 20.04, same error

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

zwhitchcox avatar Feb 25 '21 19:02 zwhitchcox

https://www.digitalocean.com/community/questions/unable-to-verify-the-docker-daemon-is-listening?answer=67068

ansiwen avatar Mar 24 '21 03:03 ansiwen

@ansiwen thanks, this solves the issue (as a temporary workaround)

I think, DigitalOcean driver should just use the Docker app from DigitalOCean marketplace instead of installing it on an empty machine.

bazzilic avatar May 06 '21 11:05 bazzilic

I have tried running the docker-machine tool on Windows and Linux. It still doesn't work with DigitalOcean, generic, VirtualBox driver, or maybe the others. The result is always the same.

...
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

lukibsubekti avatar Aug 25 '21 09:08 lukibsubekti

I have tried running the docker-machine tool on Windows and Linux. It still doesn't work with DigitalOcean, generic, VirtualBox driver, or maybe the others. The result is always the same.

...
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

Oh, the answer from @ansiwen was right. The link contains a snippet that includes --engine-install-url "https://releases.rancher.com/install-docker/19.03.9.sh" parameter on docker-machine create command.

lukibsubekti avatar Aug 25 '21 10:08 lukibsubekti

After lots of tinkering and research on this, it's quite apparent that Docker Machine is, for better or for worse, abandonware now. Unlikely that this will ever get fixed, except for by accident. Solution suggested by @ansiwen does work... about 1 times out of 3 :) One way is to just restart the script several times. What ended up working for me, was to use doctl to deploy a Docker-ready droplet, and then manually set the DOCKER_HOST env variable. This is what Docker Machine was doing under the hood anyway.

bazzilic avatar Aug 26 '21 08:08 bazzilic