machine icon indicating copy to clipboard operation
machine copied to clipboard

docker-machine does not wait for systemd reload

Open lwyszynski opened this issue 4 years ago • 1 comments

I've been testing docker-machine recently and I've encountered a problem. Apparently docker-machine does not wait for command execution during docker setup.

Driver: Openstack System: Debian 10 docker-machine version 0.16.2, build bd45ab13 Docker version 20.10.3, build 48d30b5

Process from docker-machine perspective (without debug)

Running pre-create checks...
Creating machine...
(test-docker-machine-1) Creating machine...
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 debian...
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 issue - host perspective

2021-02-02T15:24:45.286308+01:00 test-docker-machine-1.novalocal systemd[1]: Stopping Docker Application Container Engine...
2021-02-02T15:24:45.292407+01:00 test-docker-machine-1.novalocal systemd[1]: docker.service: Succeeded.
2021-02-02T15:24:45.293015+01:00 test-docker-machine-1.novalocal systemd[1]: Stopped Docker Application Container Engine.
2021-02-02T15:24:46.811691+01:00 test-docker-machine-1.novalocal systemd[1]: Starting Docker Application Container Engine...
2021-02-02T15:24:46.896541+01:00 test-docker-machine-1.novalocal systemd[1]: var-lib-docker-overlay2-check\x2doverlayfs\x2dsupport939803425-merged.mount: Succeeded.
2021-02-02T15:24:49.377698+01:00 test-docker-machine-1.novalocal systemd[1]: var-lib-docker-overlay2-opaque\x2dbug\x2dcheck644985868-merged.mount: Succeeded.
2021-02-02T15:24:49.425912+01:00 test-docker-machine-1.novalocal systemd[1]: Started Docker Application Container Engine.
2021-02-02T15:24:49.925524+01:00 test-docker-machine-1.novalocal systemd[1]: Reloading.
2021-02-02T15:24:50.047452+01:00 test-docker-machine-1.novalocal systemd[1]: docker.service: Current command vanished from the unit file, execution of the command list won't be resumed.

Current behaviour:

docker.service is stopped
docker.service is started
systemd is reloaded

Expected behaviour:

docker.service is stopped
systemd is reloaded
docker.service is started

lwyszynski avatar Feb 02 '21 15:02 lwyszynski

I have the same issue.

Restarting the docker daemon after the provisioning works.

docker-machine ssh [machine-name] service docker restart

https://user-images.githubusercontent.com/1749936/114251609-ee327280-99a1-11eb-9205-710113b16d56.mov

Nemo64 avatar Apr 10 '21 00:04 Nemo64