August 6, 2017

Chapter 6 Lab - docker-machine create fails with error

Hello,

I'm working on Chapter 6, Exercise 3 where we create a host "demo" using docker-machine. I issue the actual docker-machine create command and everything appears to go smoothly until it tries to create the machine and then I get the following output:

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.

The command I used was the following (added a flag so I could use my own SSH key):
docker-machine create --driver digitalocean --digitalocean-access-token=$DO_TOKEN --digitalocean-ssh-key-fingerprint $DIGITALOCEAN_SSH_KEY_FINGERPRINT demo

Pasting the entirety of the screen logs here below. Thanks in advance for any help or pointers!

--Lee

Screen logs:

1) Run the command: 

Lees-iMac:LFS253-Containers Fundamentals lrazo$ docker-machine create --driver digitalocean --digitalocean-access-token=$DO_TOKEN --digitalocean-ssh-key-fingerprint $DIGITALOCEAN_SSH_KEY_FINGERPRINT demo
Running pre-create checks...
Creating machine...
(demo) Creating SSH key...
(demo) Assuming Digital Ocean private SSH is located at ~/.ssh/id_rsa
(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: 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.

2) ssh into virtual machine and run "systemctl status docker.service":

root@demo:~# systemctl status docker.service
● 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 Sun 2017-08-06 12:57:40 UTC; 7min ago
     Docs: https://docs.docker.com
  Process: 4873 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
 Main PID: 4873 (code=exited, status=1/FAILURE)

Aug 06 12:57:40 demo systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Aug 06 12:57:40 demo systemd[1]: Failed to start Docker Application Container Engine.
Aug 06 12:57:40 demo systemd[1]: docker.service: Unit entered failed state.
Aug 06 12:57:40 demo systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 06 12:57:40 demo systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Aug 06 12:57:40 demo systemd[1]: Stopped Docker Application Container Engine.
Aug 06 12:57:40 demo systemd[1]: docker.service: Start request repeated too quickly.
Aug 06 12:57:40 demo systemd[1]: Failed to start Docker Application Container Engine.

3) ssh into virtual machine and run "journalctl -xe":

root@demo:~# journalctl -xe
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is done.
Aug 06 13:04:37 demo systemd[4885]: Reached target Basic System.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is done.
Aug 06 13:04:37 demo systemd[4885]: Reached target Default.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is done.
Aug 06 13:04:37 demo systemd[4885]: Startup finished in 39ms.
-- Subject: System start-up is now complete
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- All system services necessary queued for starting at boot have been
-- successfully started. Note that this does not mean that the machine is
-- now idle as services might still be busy with completing start-up.
-- 
-- Kernel start-up required KERNEL_USEC microseconds.
-- 
-- Initial RAM disk start-up required INITRD_USEC microseconds.
-- 
-- Userspace start-up required 39925 microseconds.
Aug 06 13:04:37 demo systemd[1]: Started User Manager for UID 0.
-- Subject: Unit user@0.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user@0.service has finished starting up.
-- 
-- The start-up result is done.

Click Here!