This machine has been allocated an IP address, but Docker Machine could not reach it successfully - Docker Machine Error
Sun, 26 Apr 2020
I recently encountered this docker machine IP allocation error while trying to power up my docker machine.
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.100.101:2376": dial tcp 192.168.100.101: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 tried to regenerate-certs and with the existing Network adapter config, or with a new one, but the errors continued to reproduce.
The only fix that worked for me was to restart the virtualbox network adapter. Open the Virtual Box UI, go to Preferences -> Network -> view the name of the adapter.
It's usually vboxnet0 or vboxnet1.
After manually restarting that network adapter things should work nicely:
sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up
This did the trick for me.
Categories: docker, docker-compose, linux