Docker Community Forums

Share and learn in the Docker community.

Docker-Machine provisioned aws instance can not start docker engine

aws

(Marcelwolf) #1

When I start a EC2 Instance with

docker-machine create --driver amazonec2 --amazonec2-region eu-central-1  --amazonec2-instance-type t2.2xlarge aws-test

docker-machine can create the VM, exchange the certs but the start of the engine fails.

Log in the EC2:

ubuntu@aws-manager2:~$ systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e
  Drop-In: /etc/systemd/system/docker.service.d
           └─10-machine.conf
   Active: inactive (dead) (Result: exit-code) since Thu 2017-06-29 09:18:44 UTC
     Docs: https://docs.docker.com
  Process: 5263 ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 -H unix:/
 Main PID: 5263 (code=exited, status=1/FAILURE)

Jun 29 09:18:44 aws-manager2 systemd[1]: Failed to start Docker Application Cont
Jun 29 09:18:44 aws-manager2 systemd[1]: docker.service: Unit entered failed sta
Jun 29 09:18:44 aws-manager2 systemd[1]: docker.service: Failed with result 'exi
Jun 29 09:18:44 aws-manager2 systemd[1]: docker.service: Service hold-off time o
Jun 29 09:18:44 aws-manager2 systemd[1]: Stopped Docker Application Container En
Jun 29 09:18:44 aws-manager2 systemd[1]: docker.service: Start request repeated 
Jun 29 09:18:44 aws-manager2 systemd[1]: Failed to start Docker Application Cont
lines 1-16/16 (END)...skipping...
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/docker.service.d
           └─10-machine.conf
   Active: inactive (dead) (Result: exit-code) since Thu 2017-06-29 09:18:44 UTC; 1min 53s ago
     Docs: https://docs.docker.com
  Process: 5263 ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --s
 Main PID: 5263 (code=exited, status=1/FAILURE)

Jun 29 09:18:44 aws-manager2 systemd[1]: Failed to start Docker Application Container Engine.
Jun 29 09:18:44 aws-manager2 systemd[1]: docker.service: Unit entered failed state.
Jun 29 09:18:44 aws-manager2 systemd[1]: docker.service: Failed with result 'exit-code'.
Jun 29 09:18:44 aws-manager2 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jun 29 09:18:44 aws-manager2 systemd[1]: Stopped Docker Application Container Engine.
Jun 29 09:18:44 aws-manager2 systemd[1]: docker.service: Start request repeated too quickly.
Jun 29 09:18:44 aws-manager2 systemd[1]: Failed to start Docker Application Container Engine.

Log at startup:

$ docker-machine create --driver amazonec2 --amazonec2-region eu-central-1  --amazonec2-instance-type t2.2xlarge aws-manager2
Running pre-create checks...
Creating machine...
(aws-manager2) Launching instance...
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: ssh command error:
command : sudo systemctl -f start docker
err     : exit status 1
output  : Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

Yesterday it worked with the same configuration. Could there be a change in the used AIM since yesterday? I tried it from a different host but get also the same error.


Docker-machine create fails on digitalocean
(Prionic6) #2

We have the same problem. I’m pretty sure it’s related to the new docker version released yesterday…


(Ramoiseev) #3

Same with Digital Ocean and Amazon


(Marcelwolf) #4

We Found a workaround thats works:

docker-machine create
–driver amazonec2
–engine-install-url=https://web.archive.org/web/20170623081500/https://get.docker.com


Docker-machine create fails on digitalocean
(Zstarer) #5

will test this, same issue on ec2


(Petesaia) #6

I can confirm that this issue is happening on Google as well. Seems to be across the board.


(Iammerrick) #8

Seeing this same thing trying to provision an instance on EC2 or DigitalOcean with docker-machine on Mac v 7.06.0-ce-mac18 (18433).

Can also confirm that marcelwolfs fix, actually fixed it.


(Yogeek) #9

Same problem here on GCE…
The workaround of @marcelwolf is not working for me. It repeats this output indefinitely :

checking docker daemon
(mydm) Calling .GetSSHHostname
(mydm) Calling .GetSSHPort
(mydm) Calling .GetSSHKeyPath
(mydm) Calling .GetSSHKeyPath
(mydm) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/gdupin/.docker/machine/machines/mydm/id_rsa (-rw-------)
&{[-F /dev/null -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none docker-user@35.190.206.75 -o IdentitiesOnly=yes -i /home/gdupin/.docker/machine/machines/mydm/id_rsa -p 22] /bin/ssh <nil>}
About to run SSH command:
sudo docker version
SSH cmd err, output: exit status 1: Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:23:31 2017
 OS/Arch:      linux/amd64
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Error getting SSH command to check if the daemon is up: ssh command error:
command : sudo docker version
err     : exit status 1
output  : Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:23:31 2017
 OS/Arch:      linux/amd64
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

'sudo docker version' output:

(Maximgeerinck) #10

I can also confirm that the issue persists on a windows 10, 64-bit (17.06.0-ce-win18 (12627))

Having tried @marcelwolf solution fixed this. Most likely there is a compatibility issue between the last docker community edititon engine and the ones it installs on the server


(Iborysiuk) #11

I can confirm that I have the same issue on Digital Ocean when I have tried to create a new droplet. Also, @marcelwolf solution fixed this issue for me.


(Leesei) #12

Use docker with docker daemon:

--engine-install-url=https://releases.rancher.com/install-docker/1.13.sh
--engine-install-url=https://releases.rancher.com/install-docker/17.05.sh

(Febincloudyuga) #13

That worked! Thank you so much. I’ve been stuck on this from past 2 days. What do you think is the root cause ?


(Jglover) #14

This worked for me. Thank you!


Failure to start docker on an Amazon linux machine
(Cl3ntist) #15

Release 0.12.2 fixes this: https://github.com/docker/machine/issues/4198#issuecomment-315847971