machine icon indicating copy to clipboard operation
machine copied to clipboard

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

Open rogaha opened this issue 11 years ago • 11 comments

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 [email protected] 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 [email protected] 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.

rogaha avatar Jul 21 '15 00:07 rogaha

+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)

srinath-imaginea avatar Aug 18 '15 08:08 srinath-imaginea

+1

docker-machine version 0.4.1 (HEAD)

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

PEM-- avatar Aug 25 '15 09:08 PEM--

+1

Having the same issues with the generic driver (none)

docker-machine version 0.4.1 (e2c88d6)

phlegx avatar Sep 23 '15 13:09 phlegx

+1 docker-machine version 0.4.1 (e2c88d6)

Jayphen avatar Sep 28 '15 04:09 Jayphen

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.

AnneTheAgile avatar Dec 21 '15 18:12 AnneTheAgile

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?

kostyanius avatar Oct 19 '17 09:10 kostyanius

+1

desinerlee avatar Sep 26 '18 07:09 desinerlee

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 [email protected] -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

vikasjayaswal avatar Mar 20 '19 14:03 vikasjayaswal

Same problem, no solution...

Askam avatar Mar 26 '19 08:03 Askam

+1

docker-machine version 0.16.0, build 702c267f

septum avatar May 14 '19 00:05 septum

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 [email protected] -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 [email protected] -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.

KarlAmort avatar Feb 04 '20 21:02 KarlAmort