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

Remote error: handshake failure #1683

Open
anshumanbh opened this issue Aug 12, 2015 · 9 comments
Open

Remote error: handshake failure #1683

anshumanbh opened this issue Aug 12, 2015 · 9 comments

Comments

@anshumanbh
Copy link

I installed a fresh copy of docker toolbox and had docker-machine up and running just fine.

As soon as I run the docker run command as shown below:
docker run -dt -p 127.0.0.1:8483:80 /

I start seeing this error:
(env)bash-3.2$ docker images
An error occurred trying to connect: Get https://192.168.99.100:2376/v1.20/images/json: remote error: handshake failure
(env)bash-3.2$ docker ps -a
An error occurred trying to connect: Get https://192.168.99.100:2376/v1.20/containers/json?all=1: remote error: handshake failure

Does anybody know why this is happening? The versions are listed below:

(env)bash-3.2$ docker --version
Docker version 1.8.0, build 0d03096

(env)bash-3.2$ docker-machine --version
docker-machine version 0.4.0 (9d0dc7a)

(env)bash-3.2$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
default * virtualbox Running tcp://192.168.99.100:2376

Does it have to do with how the registry accepts connections? I am trying to connect to our internal docker registry so it might be configured in a different way. Is there a way to get past this?

Thanks!

@anshumanbh
Copy link
Author

The docker run command got cut above..It looks something like this:

docker run -dt -p 127.0.0.1:8483:80 docker-registry.test.com/test

@nathanleclaire
Copy link
Contributor

Well, you should be able to do docker images and docker ps without any issue, regardless of which registry you are eventually wanting to use.

Can you try:

$ docker-machine regenerate-certs -f default
$ eval $(docker-machine env default)
$ docker ps

And post the output of:

$ docker-machine ssh default cat /var/log/docker.log

Preferably in a Github Gist?

@anshumanbh
Copy link
Author

So, after yesterday, I didn't do anything. Now, when I typed "docker ps -a", I got the following message:
usxxbharta1m1:~ bharta1$ docker ps -a
Get http:///var/run/docker.sock/v1.20/containers/json?all=1: dial unix /var/run/docker.sock: no such file or directory.

  • Are you trying to connect to a TLS-enabled daemon without TLS?
  • Is your docker daemon up and running?

I ran the following commands:
$ docker-machine regenerate-certs -f default
$ eval $(docker-machine env default)
$ docker ps

And, everything was working fine again.

But then, I ran my "docker run" command, and I start seeing the same error now:
(env)usxxbharta1m1:ecr bharta1$ docker ps -a
An error occurred trying to connect: Get https://192.168.99.100:2376/v1.20/containers/json?all=1: remote error: handshake failure

The log file as requested is here - https://gist.github.com/anshumanbh/8ad8be4ea9b84708a93f

Is it because my virtualbox VM is in NAT mode? I remember facing something similar with boot2docker every time I would connect to a VPN using the Cisco AnyConnect client. I am not using Cisco AnyConnect anymore though so I don't really know why its failing with the handshake error.

@ehazlett
Copy link
Contributor

The Cisco VPN will definitely interfere. It could be something left over that is causing the issue. Could you try docker-machine stop default and docker-machine start default?

@anshumanbh
Copy link
Author

I am not using the Cisco VPN anymore so I don't see any reason why it should interfere.

I did the docker-machine stop default and docker-machine start default.
I was able to run the docker ps -a and docker images command just fine.

But, then when I run my docker run command again as shown below, I start getting a new error message now:
docker run -dt -p 127.0.0.1:8483:80 docker-registry.test.com/test

Error message:
"Cannot connect to the Docker daemon. Is 'docker -d' running on this host?"

Now, when I do the docker-machine stop default and docker-machine start default commands and then docker ps -a, I still get the above error.

So, again, I am not exactly sure what's going on here..

@marzolfb
Copy link

I had the same issues as @anshumanbh and from past experience fighting with docker behind my corporate proxy environment, I realized I just needed to set my "no_proxy" environment variable to tell docker to bypass my corp proxy when communicating with my vm:

export no_proxy=$no_proxy,192.168.99.100

Not sure if this is what's going on but thought I'd mention it...

@tristanwietsma
Copy link

Thanks @marzolfb , that worked for me.

@nathanleclaire
Copy link
Contributor

Thanks @marzolfb @tristanwietsma for the feedback, working on #631 and some new guides to help to try and mitigate this type of issue.

@marcellodesales
Copy link

@nathanleclaire I'm getting this same error on Docker-machine 0.5.4... #2628 Is this related?

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

No branches or pull requests

6 participants