Unable to verify the Docker daemon is listening: Maximum number of retries (10) exceeded
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.
Same issue here
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 is right on point!
@MadeoIT thankU!!
hero!
How to change that default value of 10 retries to 20? Looks like with Parallels Desktop it is always not enough.
This is still happening in 2021. What, why and how do we fix this?
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
@MadeoIT Are your instructions to fix for a virtualbox driver? OP was posting an error about a digital-ocean driver.
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
https://www.digitalocean.com/community/questions/unable-to-verify-the-docker-daemon-is-listening?answer=67068
@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.
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
I have tried running the
docker-machinetool 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.
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.