New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker daemon not running (17.06.0-ce) on ubuntu 16.04 #34023

Closed
basz opened this Issue Jul 8, 2017 · 20 comments

Comments

Projects
None yet
8 participants
@basz

basz commented Jul 8, 2017

Description

Docker won't start on a new Ubuntu 16.04 installation.

Steps to reproduce the issue:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt update
apt-cache policy docker-ce
apt install docker-ce=17.06.0~ce-0~ubuntu

Describe the results you received:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  docker-ce
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.5 MB of archives.
After this operation, 96.2 MB of additional disk space will be used.
Get:1 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce amd64 17.06.0~ce-0~ubuntu [20.5 MB]
Fetched 20.5 MB in 2s (9,948 kB/s)    
Selecting previously unselected package docker-ce.
(Reading database ... 88702 files and directories currently installed.)
Preparing to unpack .../docker-ce_17.06.0~ce-0~ubuntu_amd64.deb ...

Progress: [  0%] [...............................................................................................................................................................................................................................] 
Unpacking docker-ce (17.06.0~ce-0~ubuntu) ...###########.........................................................................................................................................................................................] 

Progress: [ 33%] [###########################################################################....................................................................................................................................................] 
Processing triggers for man-db (2.7.5-1) ...######################################################################################...............................................................................................................] 
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up docker-ce (17.06.0~ce-0~ubuntu) ...

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.##############..........................................................................] 
invoke-rc.d: initscript docker, action "start" failed.
● 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: activating (auto-restart) (Result: exit-code) since Sat 2017-07-08 11:41:41 UTC; 16ms ago
     Docs: https://docs.docker.com
  Process: 26137 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 (code=exited, status=1/FAILURE)
 Main PID: 26137 (code=exited, status=1/FAILURE)

Jul 08 11:41:41 node-1 systemd[1]: docker.service: Unit entered failed state.
Jul 08 11:41:41 node-1 systemd[1]: docker.service: Failed with result 'exit-code'.
dpkg: error processing package docker-ce (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
docker stats
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Describe the results you expected:

success

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

docker --version
Docker version 17.06.0-ce, build 02c1d87

Output of docker info:

docker info
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Additional environment details (AWS, VirtualBox, physical, etc.):

DigitalOcean 512Mb Droplet

@kkadir

This comment has been minimized.

kkadir commented Jul 8, 2017

Just a reminder: the user that you are running as may not have permissions to talk to /var/run/docker.sock on that system. Have you tried sudo docker or add your user to the group by sudo usermod -aG docker $(whoami)? And also do not forget to log-out/log-in to make these changes have effect.

@basz

This comment has been minimized.

basz commented Jul 8, 2017

well, I'm root, but

root@node-1:~# sudo usermod -aG docker $(whoami)
root@node-1:~# exit
logout
rattletrap:Bushbaby.Swarm bas$ docker-machine ssh node-1
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-83-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.


Last login: Sat Jul  8 12:02:39 2017 from 143.179.0.82
root@node-1:~# sudo docker stats
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
@basz

This comment has been minimized.

basz commented Jul 8, 2017

ls -la /var/run/docker.sock
srw-rw---- 1 root docker 0 Jul  8 11:41 /var/run/docker.sock
@basz

This comment has been minimized.

basz commented Jul 8, 2017

Hm, digital ocean has pre build docker images with 17.06 and ubuntu 16.04. Using those command on the host run fine. But local commands (machine env node-1 will error) still have the same issue.

firewall is turned off btw

docker-machine env node-1
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "188.226.165.11:2376": dial tcp 188.226.165.11:2376: getsockopt: connection refused
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.
@basz

This comment has been minimized.

basz commented Jul 8, 2017

docker-machine regenerate-certs node-1
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Waiting for SSH to be available...

Detecting the provisioner...
Installing Docker...
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?

.. repeated 50 times
@basz

This comment has been minimized.

basz commented Jul 8, 2017

related to docker/machine#4156 replacing docker daemon with docker in /etc/systemd/system/docker.service.d/10-machine.conf solves it.

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Jul 9, 2017

Yes this was a bug in docker machine - should be fixed in docker machine 0.12.1

closing this but feel free to comment after I closed

@thaJeztah thaJeztah closed this Jul 9, 2017

@basz

This comment has been minimized.

basz commented Jul 9, 2017

nice! How do i get that version? Or isnt it released yet?

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Jul 9, 2017

@basz

This comment has been minimized.

basz commented Jul 10, 2017

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Jul 10, 2017

Docker machine is a tool to provision machines; there was a bug in that tool that caused machines to be provisioned incorrectly

@jfederico

This comment has been minimized.

jfederico commented Jul 12, 2017

The problem is still there using docker-machine v0.12.1 and provisioning either docker v17.05.0-ce or v17.06.0 using --driver amazonec2

Funny story, it was working until yesterday when provisioning specifically v17.05.0-ce with this script --engine-install-url=https://releases.rancher.com/install-docker/17.05.sh but not anymore. I went back to docker-machine v0.10.0 though, due issues with the rm

For those experiencing the same issue, @basz solution is good, but use dockerd instead of docker

related to docker/machine#4156 replacing docker daemon with docker in /etc/systemd/system/docker.service.d/10-machine.conf solves it.

@thaJeztah

This comment has been minimized.

Member

thaJeztah commented Jul 12, 2017

ping @shin- is this a known issue? ^^

@shin-

This comment has been minimized.

Contributor

shin- commented Jul 12, 2017

@jfederico Does it work if you provision with --engine-storage-driver=overlay2?

docker/machine#4191

@jfederico

This comment has been minimized.

jfederico commented Jul 13, 2017

No. The result is the same

Using SSH private key: /home/ubuntu/.docker/machine/machines/machine-dev1/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 ubuntu@ww.xx.yy.zz -o IdentitiesOnly=yes -i /home/ubuntu/.docker/machine/machines/machine-dev1/id_rsa -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
sudo systemctl -f start docker
SSH cmd err, output: exit status 1: Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

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.

notifying bugsnag: [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.
]

Inside

Jul 13 15:35:49 machine-dev1 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 13 15:35:49 machine-dev1 systemd[1]: Failed to start Docker Application Container Engine.
Jul 13 15:35:49 machine-dev1 systemd[1]: docker.service: Unit entered failed state.
Jul 13 15:35:49 machine-dev1 systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 13 15:35:49 machine-dev1 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 13 15:35:49 machine-dev1 systemd[1]: Stopped Docker Application Container Engine.
Jul 13 15:35:49 machine-dev1 systemd[1]: docker.service: Start request repeated too quickly.
Jul 13 15:35:49 machine-dev1 systemd[1]: Failed to start Docker Application Container Engine.
-- Unit docker.service has begun starting up.
Jul 13 15:35:49 machine-dev1 docker[5218]: `docker daemon` is not supported on Linux. Please run `dockerd` directly
Jul 13 15:35:49 machine-dev1 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 13 15:35:49 machine-dev1 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
Jul 13 15:35:49 machine-dev1 systemd[1]: docker.service: Unit entered failed state.
Jul 13 15:35:49 machine-dev1 systemd[1]: docker.service: Failed with result 'exit-code'.
@noyb34

This comment has been minimized.

noyb34 commented Jul 14, 2017

same issue here. running docker-machine version 0.12.0, build 45c69ad.
docker client version 17.06.0-ce
docker server version 17.06.0-ce
gcloud deployement. I've used the engine storage driver overlay2 - same result as above.

@basz

This comment has been minimized.

basz commented Jul 14, 2017

@proch04 use docker-machine v0.12.1 not v0.12.0

@noyb34

This comment has been minimized.

noyb34 commented Jul 16, 2017

@basz Thank You! things are all good now. Cheers

@brandontamm

This comment has been minimized.

brandontamm commented Jul 17, 2017

@shin - Is this ticket the root cause to the docker-machine create issue that is being reported in multiple recent tickets:

@kumarabhishek0809

This comment has been minimized.

kumarabhishek0809 commented Jul 13, 2018

Same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment