Open TamsynUlthara opened 8 years ago
Same is still happening to me today. Client:
$ docker-machine --version
docker-machine version 0.8.2, build e18a919
Server:
$ sudo docker version
Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:42:17 2016
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
This is my log file:
Docker Machine Version: 0.8.2, build e18a919
Found binary path at /usr/local/bin/docker-machine
Launching plugin server for driver generic
Plugin server listening at address 127.0.0.1:41866
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at /usr/local/bin/docker-machine
Launching plugin server for driver generic
Plugin server listening at address 127.0.0.1:42910
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(mymachinename) Calling .GetMachineName
(mymachinename) Calling .DriverName
(mymachinename) Calling .GetCreateFlags
(mymachinename) Calling .SetConfigFromFlags
Running pre-create checks...
(mymachinename) Calling .PreCreateCheck
(mymachinename) Calling .GetConfigRaw
Creating machine...
(mymachinename) Calling .Create
(mymachinename) Importing SSH key...
(mymachinename) Calling .GetConfigRaw
(mymachinename) DBG | IP: server.ip.address
(mymachinename) Calling .DriverName
(mymachinename) Calling .DriverName
Waiting for machine to be running, this may take a few minutes...
(mymachinename) Calling .GetState
Detecting operating system of created instance...
Waiting for SSH to be available...
Getting to WaitForSSH function...
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
exit 0
SSH cmd err, output: <nil>:
Detecting the provisioner...
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
cat /etc/os-release
SSH cmd err, output: <nil>: NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
Couldn't set key UBUNTU_CODENAME, no corresponding struct field found
found compatible host: ubuntu
Provisioning with ubuntu(systemd)...
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
stat -f -c %T /var/lib
SSH cmd err, output: <nil>: ext2/ext3
No storagedriver specified, using aufs
setting hostname
(mymachinename) Calling .GetMachineName
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
sudo hostname mymachinename && echo "mymachinename" | sudo tee /etc/hostname
SSH cmd err, output: <nil>: mymachinename
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
if ! grep -xq .*mymachinename /etc/hosts; then
if grep -xq 127.0.1.1.* /etc/hosts; then
sudo sed -i 's/^127.0.1.1.*/127.0.1.1 mymachinename/g' /etc/hosts;
else
echo '127.0.1.1 mymachinename' | sudo tee -a /etc/hosts;
fi
fi
SSH cmd err, output: <nil>:
installing base packages
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
sudo apt-get update
SSH cmd err, output: <nil>: Hit:1 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:5 https://apt.dockerproject.org/repo ubuntu-xenial InRelease
Fetched 306 kB in 0s (920 kB/s)
Reading package lists...
package: action=install name=curl
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y curl
SSH cmd err, output: <nil>: Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.47.0-1ubuntu2.2).
The following packages were automatically installed and are no longer required:
aufs-tools cgroupfs-mount
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 42 not upgraded.
Installing Docker...
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
if ! type docker; then curl -sSL https://get.docker.com | sh -; fi
SSH cmd err, output: <nil>: bash: line 0: type: docker: not found
apparmor is enabled in the kernel and apparmor utils were already installed
+ sudo -E sh -c apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Executing: /tmp/tmp.OvO4HG59b7/gpg.1.sh --keyserver
hkp://ha.pool.sks-keyservers.net:80
--recv-keys
58118E89F3A912897C070ADBF76221572C52609D
gpg: requesting key 2C52609D from hkp server ha.pool.sks-keyservers.net
gpg: key 2C52609D: "Docker Release Tool (releasedocker) <docker@docker.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
+ break
+ sudo -E sh -c apt-key adv -k 58118E89F3A912897C070ADBF76221572C52609D >/dev/null
+ sudo -E sh -c mkdir -p /etc/apt/sources.list.d
+ dpkg --print-architecture
+ sudo -E sh -c echo deb \[arch=amd64\] https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list
+ sudo -E sh -c sleep 3; apt-get update; apt-get install -y -q docker-engine
Hit:1 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:5 https://apt.dockerproject.org/repo ubuntu-xenial InRelease
Fetched 306 kB in 0s (903 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
docker-engine
0 upgraded, 1 newly installed, 0 to remove and 42 not upgraded.
Need to get 0 B/19.4 MB of archives.
After this operation, 102 MB of additional disk space will be used.
Selecting previously unselected package docker-engine.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 125225 files and directories currently installed.)
Preparing to unpack .../docker-engine_1.12.5-0~ubuntu-xenial_amd64.deb ...
Unpacking docker-engine (1.12.5-0~ubuntu-xenial) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu11) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up docker-engine (1.12.5-0~ubuntu-xenial) ...
Processing triggers for systemd (229-4ubuntu11) ...
Processing triggers for ureadahead (0.100.0-19) ...
+ sudo -E sh -c docker version
Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:42:17 2016
OS/Arch: linux/amd64
If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:
sudo usermod -aG docker ubuntu
Remember that you will have to log out and back in for this to take effect!
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
waiting for docker daemon
checking docker daemon
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
sudo docker version
SSH cmd err, output: exit status 1: Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:42:17 2016
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Error getting SSH command to check if the daemon is up: Something went wrong running an SSH command!
command : sudo docker version
err : exit status 1
output : Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:42:17 2016
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
'sudo docker version' output:
checking docker daemon
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
sudo docker version
SSH cmd err, output: exit status 1: Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:42:17 2016
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Error getting SSH command to check if the daemon is up: Something went wrong running an SSH command!
command : sudo docker version
err : exit status 1
output : Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:42:17 2016
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
'sudo docker version' output:
checking docker daemon
(mymachinename) Calling .GetSSHHostname
(mymachinename) Calling .GetSSHPort
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHKeyPath
(mymachinename) Calling .GetSSHUsername
Using SSH client type: external
Using SSH private key: /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem (-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@server.ip.address -o IdentitiesOnly=yes -i /home/myusername/.docker/machine/machines/mymachinename/mycompany_staging.pem -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
sudo docker version
SSH cmd err, output: exit status 1: Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:42:17 2016
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Error getting SSH command to check if the daemon is up: Something went wrong running an SSH command!
command : sudo docker version
err : exit status 1
output : Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:42:17 2016
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
...keeps looping the same output from 'sudo docker version' output: now...
What's wrong here - why is Docker not being started on the remote machine?
I was able to fix my problem. It seems that my host had some old docker related data on it, for whatever reasons, which prevented it from starting/installing correctly.
I had to delete the existing /var/lib/docker
and /etc/systemd/system/docker*
files and folders.
After that I had to issue a sudo systemctl daemon-reload
.
(Found also this: https://github.com/docker/docker/issues/15651#issuecomment-212992755)
The /var/lib/docker
folder was primarily a problem because I ran into msg="Error starting daemon: error initializing graphdriver: \"/var/lib/docker\"
, reported by the docker service, checked via journalctl -xe
.
After cleaning the host docker-machine was able to use it again.
Following my experience with #2976, I stumbled upon another issue: if Docker is installed, but currently stopped,
docker-machine create
fails.The following logs have machine names, hostnames, and IPs changed to protect the guilty. ;-)
I ran the following command on a machine with Docker installed, but stopped (via systemd):
I killed it here; otherwise it loops like that forever.