Unable to create machine in docker - docker

I've just installed docker on my windows 7 machine. When I start Docker QuickStart, I get following error which seems to be while creating the machine:
Creating machine...
(default) Unable to get the latest Boot2Docker ISO release version: Get https:/
/api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp 192.30.2
52.124:443: connectex: A connection attempt failed because the connected party d
id not properly respond after a period of time, or established connection failed
because connected host has failed to respond.
(default) Copying C:\Users\robot\.docker\machine\cache\boot2docker.iso to C:\Use
rs\robot\.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
Error attempting heartbeat call to plugin server: read tcp 127.0.0.1:60733->127.
0.0.1:60732: wsarecv: An existing connection was forcibly closed by the remote h
ost.
Error attempting heartbeat call to plugin server: connection is shut down
Error attempting heartbeat call to plugin server: connection is shut down
Error attempting heartbeat call to plugin server: connection is shut down
Error attempting heartbeat call to plugin server: connection is shut down
Error creating machine: Error in driver during machine creation: read tcp 127.0.
0.1:60733->127.0.0.1:60732: wsarecv: An existing connection was forcibly closed
by the remote host.
Looks like something went wrong... Press any key to continue...

There is a similar issue in docker/machine/issues/2773.
Try and see if the issue persists when creating a machine yourself instead of using quick-start:
Find where docker-machine.exe has been installed (or copy the latest released one in your %PATH%) and use that, from a regular CMD session:
First test the existing machine:
# find the name of the machine created.
docker-machine ls
docker-machine env --shell cmd <nameOfTheMachine>
docker machine ssh <nameOfTheMachine>
Then try creating a new one:
docker-machine create -d virtualbox <aNewMachine>
docker-machine env --shell cmd <aNewMachine>
docker machine ssh <aNewMachine>

I do not have a solution but found the root cause.
I had installed boot2docker and has been using for months. I had been creating all
my vbox images on the same folder all the while.
One fine day I decided to archive my machines and changed the folder in which I was creating the vbox images. It started giving this wired error. I reverted back my archive and tested again. It started working fine.
The difference I found on both the set up was, in the archived folder it was skipping the ca cert creation step and was directly creating the machine. In the new folder it was creating a cert and then creating the machine. It looks like the server doesn't like the new certs!!!!

Related

Docker Engine Fails to start on Windows Server 2019

Our application is docker based and requires Nat network to be created on the host machine in order to communicate since its a web service. It was working since last 4 months and suddenly stopped working. Checked and found that docker service is stopped. Manually tried restarting the service but it failed to start. Below is the error in the event log:
Error:
fatal: failed to start deamon: Error initializing network controller: Error creating default network: failed during hnsCallRawResponse: hnsCall failed in Win32: There are no more endpoints available from endpoint mapper. (0x6d9)
Tried the below steps:
Deleted the hns.data and restarted the hns service. Then restarted the docker engine service. The issue persists.
Tried running MOFCOMP. Same issue.
Tried removing docker and reinstalling it. Doesn't work.
Tried creating nat network manually. But getting the above mentioned error.
Can someone help here? what needs to be checked or what could be the reason for this issue?

Setup new connection in mysql workbench using standard TCP IP over SSH

Could not read the contents of .ssh directory.
Error opening directory '/home/[username]/.ssh': Permission denied
I can see in the list of running processes that mysql-workbench is not running as root user.
I am not sure what the actual issue is. I only want to load '/home/[username]/.ssh/id_rsa' file while adding parameter in 'SSH key file' during connection setup. So that my connection should be established successfully.
Presumably you're on Ubuntu. I had this problem too and https://askubuntu.com/a/1271919/48214 was the solution for me.

ECONNREFUSED 127.0.0.1:80 when connecting to remote Docker with Visual Studio Code

I want to develop code inside a container on a remote Docker host with VS Code, but I cannot connect to Docker on the remote machine via SSH (ECONNREFUSED 127.0.0.1:80).
Following the VS Code instructions to use a SSH tunnel (https://code.visualstudio.com/docs/remote/containers-advanced#_option-2-connect-using-an-ssh-tunnel) I got this error:
"Unable to connect to Docker. Please make sure you have installed
Docker and that it is running. Details: connect ECONNREFUSED
127.0.0.1:80"
I started VS Code (Windows 10), updated the docker.host (File->Preferences) property to:
{
"docker.host":"tcp://localhost:23750"
}
and ran:
ssh -NL localhost:23750:/var/run/docker.sock user#hostname
It looked like established the tunnel successfully. I run Docker on a virtual machine (centOS).
When I opened the Docker view and expanded the Containers node in the explorer I got the above mentioned error. To me it looks like VS Code tries to connect to port 80 but I specified port 23750 in the settings. How can I successfully connect to the remote host?
I found a fix here: https://github.com/microsoft/vscode-docker/issues/580
Remove the prefix tcp:// from the docker.host settings, e.g.:
"docker.host": "localhost:23750"
I know that this question is old but for anyone still looking for options I solved a similar issue on my computer using IPv6.
So in your case:
{
"docker.host":"tcp://[::1]:23750"
}
I configured the host on the environment variable DOCKER_HOST.

PyCharm cannot use interpreter in local docker-machine

I am using windows 10 professional and I have installed docker using DockerToolBox, so I have a docker-machine running in VirtualBox. When trying to configure an interpreter in PyCharm using my docker-machine, I get the following error:
"Cannot connect: java.lang.NullPointerException: uri was not specified"
docker-machine error
When I choose 'TCP socket', I get the following error which is different from above:
"Cannot connect: java.io.IOException: Channel disconnected before any data was received"
TCP socket error
I am sure my docker-machine is running because I can connect to it using terminal tools like MobaXterm or XShell, and I can also connect to MySQL running in my docker-machine.
Replacing tcp:// by https:// in the api url works for me in Webstorm (Windows 8.1).
https://github.com/kubernetes/minikube/issues/580
I have tried thousands of methods, and finally resolved this problem. The solution is running pycharm as administrator. WTF
I have same issue.
You must check Pycharm logs. There is detailed information about error.
In my case Pycharm shows same error "Channel disconnected before any data was received".
But in logs i found that error is caused by:
"ERROR - HttpResponseStreamHandlerFixed - exceptionCaught before first read or disconnect, we may be hanging
io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: No name matching "my_server_hostname" found"
In my case, the problem was that domain name that i connecting to is in not the same as hostname in SSL self signed cert installed in dockerd.
Domain name that you are connecting to must match domain name in SSL cert that dockerd uses.
I have to make hosts record (C:\Windows\System32\drivers\etc\hosts on Windows, and /etc/hosts on Linux) and connect to it.
And "https://" protocol is required :)
PS. You can check SSL cert hostname by opening Chrome browser to the docker API endpoint with https and opening certificate details.

Docker Kitematic connect ETIMEDOUT error

Starting Kitematic on Windows 10 gives me this error
Error: connect ETIMEDOUT 198.105.254.24:2375
I'm already running 'default' vm in VirtualBox. The only way to start Kitematic is to hit the 'USE VIRTUALBOX' button.
Why won't Kitematic start unless I click 'USE VIRTUALBOX' button? I've already got VirtualBox running the 'default' vm successfully...
I commented on the docker / kitematic Github issues page and one of the participants told me to simply click USE VIRTUALBOX button to use VirtualBox on Windows since they are in favor of Docker for Windows.
https://github.com/docker/kitematic/issues/1029#issuecomment-226974739
You can turn off Hyper-V in your system, then reboot and click run VirtualBox next time.
I faced the same error. Below solution worked for me:
Deleted the folder C:\Users\{Account_name}\.docker
Clicked on the "Retry setup" button on Kitematic. It re-created C:\Users\{Account_name}\.docker with a new default machine. Error : connect ETIMEDOUT 192.168.xxx.xxx:2376 disappeared but faced new error: C:\Users\{Account_name}\.docker\machine\machines\default\ca.pem does not exist
Copied all certificate files from C:\Users\{Account_name}\.docker\machine\certs to C:\Users\{Account_name}\.docker\machine\machines\default. Then I got error
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.xxx.xxx:2376"
Regenerated certificates for default machine by running below command on Command Prompt.
docker-machine regenerate-certs default
It showed below output:
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...
After this, I was able to access default machine through Kitematic GUI. I figured that issue was due to TLS connection and these steps fixed it.

Resources