Types of errors docker in Windows? - windows

When I began to start docker it stuck and there are so many bad problem with it
System: Windows 8.1 64-bit
I replace virtualbox 5.0.6 to virtualbox 5.0.7 Still, there's an error
Error One:
When Docker Quickstart Terminal want to begin Starting VM... is hanging
Error two
I test my installation with docker run hello-world I get the following:
Post http://127.0.0.1:2375/v1.20/containers/create: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it..
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
Error three
Kinematic doesn't work
It work until 99% BUT suddenly it doesn't work
Machine IP could not be fetched. Please retry the setup. If this fails please file a ticket on our GitHub repo.

Best solution I've found after googling for a while:
First check if your Virtualbox version is the latest or at least above 5, then
Run on CMD docker-machine rm -f ##dockerContainerName## (Generally: default)
Delete .docker folder from your user folder
Run docker-machine create --driver virtualbox ##dockerContainerName##
Profit!!!

Related

Unable to create new docker instances with docker-machine

I am using AWS with docker-machine to create and provision my instances. I would use this command to create a new instance:
docker-machine create --driver amazonec2 --amazonec2-instance-type "t2.micro" --amazonec2-security-group zhxw-production-sg zhxw-production-3
About a month ago, that worked fine. I just went to create a fresh machine, and I can no longer connect to it. When I run the above command, it gets stuck on "waiting for SSH to be available..."
Running pre-create checks...
Creating machine...
(zhxw-production-3) Launching instance...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
It just hangs at that point. If I cancel the command, and check the AWS EC2 console, it suggests that it's running:
When I run docker-machine ls, it also suggests that it's running, but with errors:
$-> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
zhxw-production-2 - amazonec2 Running tcp://3.86.xxx.xxx:2376 v19.03.12
zhxw-production-3 - amazonec2 Running tcp://54.167.xxx.xxx:2376 Unknown Unable to query docker version: Cannot connect to the docker engine endpoint
I'm able to connect to the zhxw-production-2 machine (which has been running for a month). Just not the new one zhxw-production-3 one I just launched.
$-> docker-machine env zhxw-production-3
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "54.167.123.108:2376": dial tcp 54.167.123.108:2376: connect: connection refused
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.
The regenerate-certs command doesn't help either. I'm not really sure where to start debugging, because as far as I can tell, the docker-machine create command is the very beginning.
Turned out to be a problem with SSH to my AWS environment. I had my public IP address whitelisted, but it had changed.
I came across a problem like this and I found out that the AWS EC2 AMI did not have SSH installed, so I had to use different AMI, eg. Ubuntu.
I went through the same problem recently and found that the cause was the public ip change when I enabled elastic ip on the machine. I don't know if this is your case. Maybe my solution will help you or help others. He follows:
usually the file path is: /User/<name_your_user>/.docker/machine/<name_machine_ploblem>
edit parameter value: "IPAdress"
After making the change, run the command: docker-machine regenerate-certs <name_instance_ec2>
With these procedures, my problem was solved. I hope it helps! hug to everyone.

Docker on Win10 - is it possible to have multiple terminals?

I am new to Docker - installed DockerToolbox on Win10. And managed to run some basic docker examples. But I cannot seem to figure out how to access same container from multiple command line windows.
Quick online search suggested finding container ID (e.g. 2c7e29b9b666) via
docker ps
then running (I presume in new command window)
docker exec -it 2c7e29b9b666 bash
but that does not work in Win10.
Error message received is:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Edit: in the first window I started docker machine via:
docker-machine create --driver virtualbox tombox
and I can see 'tombox' in second window if I do:
docker-machine ls
Do I need to somehow reference 'tombox' when running docker commands in second window?

Starting minikube on Windows 7 fails to start with - Error getting state for host: machine does not exist

Have been trying to setup Kubernetes for local development on my Windows 7 machine with a VirtualBox VM Driver. Installing and running minikube fails each time with the below error:
D:\minikube>minikube start --vm-driver=virtualbox
Starting local Kubernetes v1.9.0 cluster...
Starting VM...
E0219 09:47:24.441727 4220 start.go:159] Error starting host: Error getting state for host: machine does not exist.
Retrying.
E0219 09:47:24.448727 4220 start.go:165] Error starting host: Error getting state for host: machine does not exist
E0219 09:47:54.448727 4220 util.go:151] Error uploading error message: :
Post https://clouderrorreporting.googleapis.com/v1beta1/projects/k8s-minikube/events:report?key=AIzaSyACUwzG0dEPcl-eOgpDKnyKoUFgHdfoFuA: dial tcp 172.217.25.138:443: i/o timeout
I suspected this may be happening due to minikube cache downloading at a network drive folder (N:) due to enterprise configurations in my laptop, however, copying the .minikube folder from N:\.minikube to C:\Users\abc123\.minikube has not abated the problem.
Do let me know if someone has managed to solve it.
I ran into the same error on osx after re-installing minikube. Simply deleting the minikube VM and restarting fixed everything:
$ minikube delete
$ minikube start
Go to C:\Users\\
Delete the .minikube folder
Start minikube (minikube.exe start --kubernetes-version="v1.10.0" --vm-driver="virtualbox")
Try using powershell/cygwin instead of cmd.
Also delete .minikube folder
do minikube delete
then minikube start
In certain scenarios, it may be an issue with your VM driver. If you don't specify one, it may default to VirtualBox. But if you have HyperV instead (due to installing docker on windows, for example) then it won't start. You may have to start it like so:
minikube start --vm-driver hyperv
Or whatever is appropriate.

Docker unreachable after computer sleep

I have just installed docker using docker-toolbox 1.8.2 on Windows 10.
Due to due to this issue I had to recreate the docker image using these commands
docker-machine rm default
docker-machine --native-ssh create -d virtualbox default
After that it has been working fine, except for one problem:
When the PC has gone to sleep and then wakes again, the docker commands can no longer connect. Example:
> docker images
An error occurred trying to connect: Get https://192.168.99.100:2376/v1.20/images/json:
dial tcp 192.168.99.100:2376: ConnectEx tcp: A connection attempt failed because the
connected party did not properly respond after a period of time, or established connection
failed because connected host has failed to respond.
However the docker-machine lists the machine as running:
> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
default * virtualbox Running tcp://192.168.99.100:2376
I can also confirm in VirtualBox that the VM screen seems to be active.
I have tried starting and stopping the machine, but that does not help
C:\x> docker-machine stop default
C:\x> docker-machine start default
Starting VM...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
C:\x> docker-machine env default --shell=powershell
Ironically, the last command hangs, so I never get any environment settings.
The only thing that helps is to restart the whole PC. But that should be unnecessary?
I have also posted this as an issue on the docker github repository,but that was closed. A related issue seems to be this one, but no workaround or solution has been posted for Windows.
After hous of fighting with VirtualBox + Docker Toolbox, I finally found the way, how to make Docker working again (even without restarting all the containers):
Wake up PC from sleep
Try docker images (won`t work)
Open VirtualBox -> Close VM with saving state (CTRL+V)
Run your VM again
Try docker images again (now should work)
Please note: All steps are in VirtualBox only! Running docker-machine restart default will create another host-only adapter, which is something you do not want. If you did it anyway, delete all additionally created adapters (File->Preferences->Network on VirtualBox), then follow steps 1-5.
I have experienced the exact same symptoms on Windows 8.1... The thing is that it's not really a docker-specific issue, but more how Windows manages the VirtualBox network adapters after sleep (I think...). The culprit in my case is that the network adapter's addresses were becoming private after sleep (they became 169.* addresses).
Credits to this guy who gave me the idea: http://lyngtinh.blogspot.ca/2011/12/how-to-disable-autoconfiguration-ipv4.html
Fix:
Start a command prompt as Administrator
Find out the "useful" network adapters: ipconfig /all. The useful ones in my case were the ones labeled "VirtualBox Host-Only Ethernet Adapter" that didn't have private ips (not starting with 169.*).
Run this command and note the "Idx" of the useful VirtualBox network adapters: netsh interface ipv4 show inter.
Run this command to disable the IP auto configuration: netsh interface ipv4 set interface <idx> dadtransmits=0 store=persistent. Replace <idx> with each index found in the previous step.
Restart Windows
Afterwards, I was able to docker-machine start default, then docker-machine env default --shell cmd, put the PC to sleep, wake up and run docker-machine env default --shell cmd again.
I found that removing 'host only adapter' (File->Preferences->Network on VirtualBox), and restart the docker-machine helps.
Not a real solution. But probably better over restart the computer.
Having tried all the other answers here, and having varying but not consistent success, the following seems to reliably bring it back for me after this problem occurs.
Open a powershell/command window (I have most success if I run all docker-machine commands in a powershell window opened as administrator, I don't know if that's important or not) then run (where "dev" is the name of your docker machine instance):
docker-machine ssh dev
Then on the terminal that is opened, run:
sudo shutdown -r now
When the machine restarts, it seems to refresh the network and work correctly. Note, however, that simply running docker-machine restart dev did not have the same effect for me.
Your machine needs to be running before you can do the ssh, so if it's not running, execute docker-machine start dev before trying to SSH.
Had the same problem on Windows 8.1 and docker toolbox 1.12.0
None of the above solutions worked for me, too.
[edited]
Found another way to make docker work after system wake up:
In the docker Quickstart Terminal window, stop docker process Ctrl-C (if it is still running)
Run command docker-compose down
Shut down docker with docker-machine stop default
Exit terminal window Ctrl-D
Run Quickstart Terminal again and do all subsequent steps you need.
This worked for me, on Windows host machine.
Configure your network adapter to
1) Allow the network adapter to wake the computer,
2) Allow a magic packet to wake the computer,
3) Allow IPV6
http://www.worldstart.com/dropped-internet-connection-in-sleep-mode/
Also, on virtual box network settings, go to advanced, and allow promiscuous mode to VM machines, or allow all

Troubleshoot Docker-On-Windows attempt to run hello-world

I have installed docker on windows and successfully brought up the bash shell window. However, when I test my installation with docker run hello-world I get the following:
Post http://127.0.0.1:2375/v1.20/containers/create: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it..
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
I thought at first it was because I needed to be logged in to docker hub. When I tried docker login and gave it my docker-hub account name, I got
The handle is invalid.
BTW, it did not ask me for my password.
I am puzzled. Please advise.
A little more troubleshooting helped resolve the problem. Steps taken:
I ran the new program Kitematic. It complained that it could not run the VM and offered a remove-and-setup-again option.
I chose the remove-and-setup-again option.
I then ran Kitematic again and it prompted for my dockerhub credentials
Once I successfully entered those and Kitematic seemed healthy I tried the Quickstart terminal again.
Running that provoked some checks from my anti-virus software which wanted to block internet activity from the VM. Once I overrode that, all went well.
In conclusion, it seems that retrying an install does change things (I do not know why) and secondly, anti-virus software can be a bother.

Resources