machine icon indicating copy to clipboard operation
machine copied to clipboard

docker-machine create -d generic hangs on Importing SSH key...

Open sumerman opened this issue 11 years ago • 10 comments

docker-machine create -d generic --generic-ip-address XX.XX.XX.XX --generic-ssh-key "/Users/sumerman/.ssh/XXXX" the_name
Importing SSH key...

nothing else happens

sumerman avatar Aug 31 '15 21:08 sumerman

Could you paste the output using docker-machine -D create? Thanks.

nathanleclaire avatar Aug 31 '15 22:08 nathanleclaire

it prints help message then :open_mouth:

sumerman avatar Sep 01 '15 08:09 sumerman

I had a similar case of this behaviour today and it turned out the cause of the hang was that the target machine's firewall did not have the proper port (2376) open. The create process appears to continuously retry connecting on this port, waiting for the daemon to start (visible on the console with -D flag).

khaines avatar Sep 01 '15 22:09 khaines

@sumerman I mean the same command as before, but with -D arg to docker-machine included.

nathanleclaire avatar Sep 01 '15 22:09 nathanleclaire

@nathanleclaire I got that, and that's what I did. S

sumerman avatar Sep 02 '15 08:09 sumerman

I had a similar hang when trying to use docker-machine's generic driver to provision docker on a Linode host running Ubuntu 14.04. When I install docker manually on that host, I get warned that the aufs driver will not work, and docker magically falls back to the devicemapper driver instead. When docker-machine provisions the box, it provides specific configuration data in /etc/default/docker to use the aufs storage driver. When the docker daemon starts, it is unable to use aufs and restarts in a fast loop until upstart kills it for good. The solution for me was to use --engine-storage-driver devicemapper from docker-machine. So my command looks like this (with debug enabled):

docker-machine -D create --engine-storage-driver devicemapper -d generic --generic-ip-address 45.79.179.123 linode2

(Prior to running this, I also had to run ssh-copy-id [email protected] to get passwordless ssh into the Linode host).

Perhaps docker-machine by default shouldn't set the storage-driver and instead allow the docker daemon to use its own defaults.

rbrewer123 avatar Sep 03 '15 04:09 rbrewer123

@rbrewer We default to AUFS since it is the most stable storage driver but I had forgotten some providers such as Linode use incompatible kernels. I'll keep it in mind for the future.

nathanleclaire avatar Sep 03 '15 18:09 nathanleclaire

I had another similar issue.

I was trying to create a docker-machine inside an existing instance at my DO account with generic options. Everything was configured correctly but at some point the docker-machine tells that the remote daemon is not responding....

Here some debug info:

"Sucessfull stuff was left out of this [...]"
Using SSH client type: external
About to run SSH command:
sudo service docker start
&{/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 /root/.docker/machine/machines/dm2/id_rsa -p 22 [email protected] sudo service docker start] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}
SSH cmd err, output: <nil>: docker start/running, process 5332

Daemon not responding yet: dial tcp xxx.xxx.xx.xxx:port: connection timed out
Daemon not responding yet: dial tcp xxx.xxx.xx.xxx:port: connection timed out

Notice that the SSH yells some error but I couldn't find you what is happening... =/

EDIT:

docker-machine version 0.4.0 (9d0dc7a)

I found that the function that hangs here

func (d *Driver) GetState() (state.State, error) {
    addr := fmt.Sprintf("%s:%d", d.IPAddress, d.SSHPort)
    _, err := net.DialTimeout("tcp", addr, defaultTimeout)
    var st state.State
    if err != nil {
        st = state.Stopped
    } else {
        st = state.Running
    }
    return st, nil
}

migueleliasweb avatar Oct 01 '15 17:10 migueleliasweb

@nathanleclaire, maybe @sumerman was encountering the same problem...

migueleliasweb avatar Oct 01 '15 17:10 migueleliasweb

All, please try again and file a new issue if it still persists with 0.5.0. Thanks!

nathanleclaire avatar Nov 05 '15 21:11 nathanleclaire