Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

This machine has been allocated an IP address, but Docker Machine could not reach it successfully #4100

Open
mariotoffia opened this issue May 22, 2017 · 20 comments

Comments

@mariotoffia
Copy link

I have a little project called Fluentdocker here on GitHub. I've got a bug report that made me run my old docker-machine unit test and I get errors back when creating a new docker machine.

  • Environment: Windows 10
  • Docker: Community Edition, Version 17.05.0-ce-win11 (12053), Channel: edge, ffbc5f5

This is the error output:
"This machine has been allocated an IP address, but Docker Machine could not reach it successfully.
SSH for the machine should still work, but connecting to exposed ports, such as the Docker daemon port (usually :2376), may not work properly.
You may need to add the route manually, or use another related workaround.
This could be due to a VPN, proxy, or host file configuration issue.
You also might want to clear any VirtualBox host only interfaces you are not using."

Howerver the new machine works - but it is hard for me to determine when such an operation has gone well or not during the create phase.

Cheers,
Mario

@mariotoffia
Copy link
Author

Anyone? Is this expected behavior?

@jblakeley
Copy link

I'm having the same issue.

Environment: macOS 10.12.5
Docker: Version 17.05.0-ce

Can't seem to find any solution to this error.

@namgivu
Copy link

namgivu commented Jul 3, 2017

I am having the same issue!

@namgivu
Copy link

namgivu commented Jul 3, 2017

I have the same issue on Ubuntu Desktop 16.04 today

@fiorix
Copy link

fiorix commented Jul 20, 2017

Just tried this today after not using docker for a while, brand new install, doesn't work. Tried removing the host-only interface from vbox, deleted my ~/.docker, no luck.

@ghost
Copy link

ghost commented Jul 21, 2017

Hi,

For me, removing Virtual Box 5.1 and installing Virtual Box 5.0 work

CentOS Linux release 7.3.1611 (Core)
docker-machine version 0.12.1

@ecylmz
Copy link

ecylmz commented Jul 21, 2017

For me the problem is in VirtualBox 5.1
I have to give the following command every reboot.

sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up

My environment:
OS: Ubuntu 16.04 LTS
Docker version 17.05.0-ce, build 89658be
docker-machine version 0.12.1, build c8b17e8

@deepvoice
Copy link

deepvoice commented Jul 22, 2017

Same issue - I have docker running hosts on a different subnet that work just fine. Just docker-machine that is the issue. No routing set up to get to the 192.168.x.x subnet when creating the host.
Tried setting it up manually with no luck as a ifconfig setup docker-machine sees as a conflict.

root@ubuntu:~# docker-machine version
docker-machine version 0.12.2, build 9371605
Ubuntu 16.04 LTS
Oracle VM VirtualBox Manager 5.1.24

Tried host-only mode and get the exact same indications

root@ubuntu:# VBoxManage list hostonlyifs
root@ubuntu:
# docker-machine create -d virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying /root/.docker/machine/cache/boot2docker.iso to /root/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Found a new host-only adapter: "vboxnet0"
(default) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually :2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.
Checking connection to Docker...
Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.101:2376": dial tcp 192.168.99.101:2376: getsockopt: no route to host
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

@donorodatio
Copy link

Hi all,

removing Virtual Box 5.1 and installing Virtual Box 5.0 worked for me

@baldervanx
Copy link

I ran into this problem as well, but fortunately VirtualBox recently released a new version 5.1.30 which made the issue go away for me. So seems to have been a problem in VirtualBox 5.1 up until this version.

@vinnyA3
Copy link

vinnyA3 commented Oct 26, 2017

Updating VirtualBox fixed the errors for me. Thanks @baldervanx !

@tsvetann
Copy link

same issue with version 5.2.2 r119230

@gautamsatpathy
Copy link

I had the same problem today with a new VM (VirtualBox 5.2.8 r121009). docker-machine ls would error out with a "timeout" and problems similar to the ones stated above.

Then I remembered that I had connected to my work VPN. Shutdown the VPN connection and the problem went away!

:-)

docker-machine version 0.14.0, build 89b8332

@invad0r
Copy link

invad0r commented Jul 16, 2018

same issue with:

vboxmanage: 5.2.4r119785
docker-machine: 0.14.0, build 89b8332

@syeds-git
Copy link

Thanks @gautamsatpathy , I was having similar problem then came across your post. Somehow vpn messes it up.

@VAggrippino
Copy link

Same problem for me on Linux Mint 19 (based on Ubuntu 18.04)

Docker version 18.06.1-ce, build e68fc7a
VirtualBox version 5.2.18r124319

Bringing the interface down and back up as suggested by ecylmz fixed it for me.

@sangramga
Copy link

sangramga commented Jan 16, 2019

same problem for

Oracle VM VirtualBox Manager 5.1.38_Ubuntu
docker-machine version 0.16.0, build 702c267f

for Ubuntu 16.04.5 LTS

@anentropic
Copy link

anentropic commented Feb 4, 2019

same problem

in the past when it happened I got it working again by deleting the machine and recreating

it has just hit me again today and nothing works:

$ docker-machine regenerate-certs anentropic
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Waiting for SSH to be available...
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.
...

$ curl -L https://github.com/docker/machine/releases/download/v0.16.1/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
>   chmod +x /usr/local/bin/docker-machine

$ dm --version
docker-machine version 0.16.1, build cce350d7

$ dm stop anentropic
Stopping "anentropic"...
Machine "anentropic" was stopped.

$ dm rm anentropic
About to remove anentropic
WARNING: This action will delete both local reference and remote instance.
Are you sure? (y/n): y
Successfully removed anentropic

$ sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up

$ dm create anentropic
Running pre-create checks...
Creating machine...
(anentropic) Copying /Users/anentropic/.docker/machine/cache/boot2docker.iso to /Users/paul/.docker/machine/machines/anentropic/boot2docker.iso...
(anentropic) Creating VirtualBox VM...
(anentropic) Creating SSH key...
(anentropic) Starting the VM...
(anentropic) Check network to re-create if needed...
(anentropic) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually <ip>:2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.
Checking connection to Docker...
Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": dial tcp 192.168.99.100:2376: i/o timeout
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

I can't do anything, it just doesn't work

@anentropic
Copy link

rebooting my laptop and then recreating the machine fixed it

@berdon
Copy link

berdon commented Sep 2, 2021

I believe the issue is multiple VBox IF devices being created. I had two: vboxnet0 and vboxnet1. Manually removing my machines and those devices then allowed a new device (created through docker-machine) to function correctly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests