Machine: generic ssh key 'Too many retries waiting for SSH to be available.'

Created on 3 Apr 2016  路  14Comments  路  Source: docker/machine

Hi, when I use docker-machine for provisioning a remote host and set a ssh key with --generic-ssh-key ~/.ssh/id_rsa I get the following error Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded. When I don't set the --generic-ssh-key flag it works. I even tried to place the ssh key on another path which didn't work aswell.

Most helpful comment

It already does : --generic-ssh-user :)

All 14 comments

Hi, does your key has a passphrase? I suspect this to be partly related to #3306. The rest should be fixed with #3330.

But as you noticed, the --generic-ssh-key flag is not necessary in your case because it's the default location anyway.

Ah that's the error. My key is password protected.

@BraunreutherA If you're feeling ambitious, would be good to get you to try a master build (now containing @bamarni's fix) and see if it fixes your issue.

@nathanleclaire did you already consider having nightly builds available? That could help in such situations.

@bamarni We've considered it at various times and even had unofficial ones available but so far haven't set up the infrastructure to support it. In the future the Docker projects are intended to share more infrastructure to (hopefully) have a common set of interfaces to things like nightlies, but we aren't sure when that will shape up.

cool 馃憤

I have the same problem with latest master.

$ ~/bin/docker-machine version
docker-machine version 0.7.0, build ae9f392
$ ~/bin/docker-machine create --driver generic --generic-ip-address=11.111.111.16  node1                                                                                                                        
Running pre-create checks...
Creating machine...
(node1) No SSH key specified. Assuming an existing key at the default location.
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available.  Last error: Maximum number of retries (60) exceeded

It does not work even if I give ssh key explicitly:

$ ~/bin/docker-machine create --driver generic --generic-ip-address=11.111.111.16 --generic-ssh-key=$HOME/.ssh/id_rsa  node3
Running pre-create checks...
Creating machine...
(node3) Importing SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available.  Last error: Maximum number of retries (60) exceeded

I could see this errors when I run it again with --debug option:

Getting to WaitForSSH function...
(node5) Calling .GetSSHHostname
(node5) Calling .GetSSHPort
(node5) Calling .GetSSHKeyPath
(node5) Calling .GetSSHUsername
Using SSH client type: external
&{[-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 [email protected] -p 22] /usr/bin/ssh <nil>}
About to run SSH command:
exit 0
SSH cmd err, output: exit status 255: 
Error getting ssh command 'exit 0' : Something went wrong running an SSH command!
command : exit 0
err     : exit status 255
output  : 

Okay, now I know what's the problem. docker-machine tried to connect the host with root user but my ssh key has no permission to do that.

It would be nice if docker-machine supports nonroot sudoer.

It already does : --generic-ssh-user :)

@bamarni Thank you for letting me know!

I have no idea why this been solved like this, but I've removed --generic-ssh-user parameter and it started to work )

@holms I solved this by ADDING the --generic-ssh-user parameter 馃槅

I also added <user> ALL=(ALL) NOPASSWD: ALL to the bottom of my sudoers file using visudo so that it's not trying to ask for a password when creating the machine

Was this page helpful?
0 / 5 - 0 ratings