docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

Error creating machine: Error getting SSH command: exit status 255 #1559

Open rogaha opened 9 years ago

rogaha commented 9 years ago

The machine was created, but without docker.

Creating SSH key...
Creating Digital Ocean droplet...
Created droplet ID 6230032, IP address 45.55.160.222
Getting to WaitForSSH function...
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Testing TCP connection to: 45.55.160.222:22
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /home/vagrant/.docker/machine/machines/swarm-2/id_rsa -p 22 root@45.55.160.222 exit 0] []     []    ?reflect.Value? false [] []
[] [] }
SSH cmd err, output: :
Using SSH client type: external
About to run SSH command:
cat /etc/os-release
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /home/vagrant/.docker/machine/machines/swarm-2/id_rsa -p 22 root@45.55.160.222 cat /etc/os-release] []     []    ?reflect.Value?
 false [] [] [] [] }
SSH cmd err, output: exit status 255:
Error creating machine: Error getting SSH command: exit status 255
You will want to check the provider to make sure the machine and associated resources were properly removed.
srinath-imaginea commented 8 years ago

+1. This happens with me as well. Just gets stuck at Creating Digital Ocean droplet... for a long time even though the droplet is actually up and running.

docker-machine version 0.4.0 (9d0dc7a)

PEM-- commented 8 years ago

+1

docker-machine version 0.4.1 (HEAD)

I'm using the generic driver. I can SSH to the remote server without password.

phlegx commented 8 years ago

+1

Having the same issues with the generic driver (none)

docker-machine version 0.4.1 (e2c88d6)

Jayphen commented 8 years ago

+1 docker-machine version 0.4.1 (e2c88d6)

AnneTheAgile commented 8 years ago

I believe I had this error due to a pre-existing 'default' Virtualbox machine. I deleted it and also uninstalled/reinstalled and all is now clear for me on Win8 box.

kostyanius commented 6 years ago

The same issue happens on centos 7.3.

(test) DBG | SSH cmd err, output: exit status 255: (test) DBG | Error getting ssh command 'exit 0' : ssh command error: (test) DBG | command : exit 0 (test) DBG | err : exit status 255 docker-machine version 0.12.2, build 9371605 WTF?

desinerlee commented 5 years ago

+1

vikasjayaswal commented 5 years ago

Same Problem:

Getting to WaitForSSH function... (sandboxprovisiontest) Calling .GetSSHHostname (sandboxprovisiontest) Calling .GetSSHPort (sandboxprovisiontest) Calling .GetSSHKeyPath (sandboxprovisiontest) Calling .GetSSHKeyPath (sandboxprovisiontest) Calling .GetSSHUsername Using SSH client type: external Using SSH private key: /Users/xxxxxl/.docker/machine/machines/sandboxprovisiontest/id_rsa (-rw-------) &{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@142.93.64.40 -o IdentitiesOnly=yes -i /Users/vxxxxxl/.docker/machine/machines/sandboxprovisiontest/id_rsa -p 22] /usr/bin/ssh } About to run SSH command: exit 0 SSH cmd err, output: exit status 255: Error getting ssh command 'exit 0' : ssh command error: command : exit 0 err : exit status 255 output : Getting to WaitForSSH function...

NO clue how to fix this. docker version Client: Docker Engine - Community Version: 18.09.2 API version: 1.39 Go version: go1.10.8 Git commit: 6247962 Built: Sun Feb 10 04:12:39 2019 OS/Arch: darwin/amd64 Experimental: false

Server: Docker Engine - Community Engine: Version: 18.09.2 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 6247962 Built: Sun Feb 10 04:13:06 2019 OS/Arch: linux/amd64 Experimental: true

Askam commented 5 years ago

Same problem, no solution...

septum commented 5 years ago

+1

docker-machine version 0.16.0, build 702c267f

MatthiasWinkelmann commented 4 years ago

So I solved this, at least for my case. Here's for posterity:

The important line in the output (run docker-machine -B ... to get debug info) is the following:

&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@142.93.64.40 -o IdentitiesOnly=yes -i /Users/vxxxxxl/.docker/machine/machines/sandboxprovisiontest/id_rsa -p 22] /usr/bin/ssh } (copied from above)

It does some shell wizardry you can ignore, just remove the cruft from the start, and put the /usr/bin/ssh in the beginning and run. With the example above, that would be:

/usr/bin/ssh -F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@142.93.64.40 -o IdentitiesOnly=yes -i /Users/vxxxxxl/.docker/machine/machines/sandboxprovisiontest/id_rsa -p 22

After it fails, remove the -o LogLevel=quiet and it might tell you what's wrong.

In my case–and this is unfortunately where our cases diverge– the reference to the identity/private key was actually missing, i. e. the -I /Users/vxxxxxl/.docker/machine/machines/sandboxprovisiontest/id_rsa. I edited /home//.docker/machine/machines//config.json and added the path under Driver -> SSHKeyPath.

In the examples here, the problem seems to be different. Check if the path is correct and also check permissions on the file. It should be 600.