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

Malformed HTTP Request #869

Closed
rajurs opened this issue Mar 24, 2015 · 13 comments
Closed

Malformed HTTP Request #869

rajurs opened this issue Mar 24, 2015 · 13 comments

Comments

@rajurs
Copy link

rajurs commented Mar 24, 2015

Trying to get Docker-Machine to run on Ubuntu 14.04. Machine gets created just fine on VirtualBox
The env variables are set, I have a valid IP, TLS certs seem to be in place but docker commands fail when called directly (like docker ps or docker run) with the malformed error.
If I run docker $(machine config test) command, everything is just fine. I can ssh into the machine as well.

rajurs@rajurs:$ machine ls
NAME ACTIVE DRIVER STATE URL SWARM
test * virtualbox Running tcp://192.168.99.100:2376
rajurs@rajurs:
$ machine url
tcp://192.168.99.100:2376
rajurs@rajurs:$ machine config test
--tls --tlscacert=/home/rajurs/.docker/machine/machines/test/ca.pem --tlscert=/home/rajurs/.docker/machine/machines/test/cert.pem --tlskey=/home/rajurs/.docker/machine/machines/test/key.pem -H="tcp://192.168.99.100:2376"rajurs@rajurs:
$
rajurs@rajurs:$
rajurs@rajurs:
$ machine env test
export DOCKER_TLS_VERIFY=yes
export DOCKER_CERT_PATH=/home/rajurs/.docker/machine/machines/test
export DOCKER_HOST=tcp://192.168.99.100:2376
rajurs@rajurs:$ eval "$(machine env test)"
rajurs@rajurs:
$ docker ps
2015/03/24 13:49:58 Get http://192.168.99.100:2376/v1.12/containers/json: malformed HTTP response "\x15\x03\x01\x00\x02\x02"

But this works!
rajurs@rajurs:$ docker $(machine config test) ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
rajurs@rajurs:
$

Any ideas why the short form of docker commands are failing?

@ehazlett
Copy link
Contributor

Thanks for reporting. Can you try it with just eval $(docker-machine env test) -- no quotes?

@rajurs
Copy link
Author

rajurs commented Mar 24, 2015

Same issue. See below.

rajurs@rajurs:$ eval $(machine env test)
rajurs@rajurs:
$ machine ls
NAME ACTIVE DRIVER STATE URL SWARM
test * virtualbox Running tcp://192.168.99.100:2376
rajurs@rajurs:$ docker ps
2015/03/24 15:58:24 Get
http://192.168.99.100:2376/v1.12/containers/json: malformed HTTP
response "\x15\x03\x01\x00\x02\x02"
rajurs@rajurs:
$ docker $(machine config test) ps
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
rajurs@rajurs:~$

On 03/24/2015 03:29 PM, Evan Hazlett wrote:

Thanks for reporting. Can you try it with just |eval $(docker-machine
env test)| -- no quotes?


Reply to this email directly or view it on GitHub
#869 (comment).

@ehazlett
Copy link
Contributor

hmm ok thanks -- could you run docker version as well?

@hairyhenderson
Copy link
Contributor

@rajurs - It's a little odd that machine env test returns a DOCKER_CERT_PATH without double-quotes. Also, machine config test should have double-quotes surrounding each of the paths. Which version of docker-machine is this?

@rajurs
Copy link
Author

rajurs commented Mar 25, 2015

Being a Linux Noob, I don’t know why the quotes are not showing up!

I just checked the version for docker machine, I am running 0.1.0

Sent from Windows Mail

From: Dave Henderson
Sent: ‎Tuesday‎, ‎March‎ ‎24‎, ‎2015 ‎5‎:‎47‎ ‎PM
To: docker/machine
Cc: Pradeep Rajurs

@rajurs - It's a little odd that machine env test returns a DOCKER_CERT_PATH without double-quotes. Also, machine config test should have double-quotes surrounding each of the paths. Which version of docker-machine is this?


Reply to this email directly or view it on GitHub.

@rajurs
Copy link
Author

rajurs commented Mar 25, 2015

Here is what is confusing to me…

When I remove the machines, (machine stop, rm etc) and then just use the docker installation on the Ubuntu box, docker version says its 1.5 (this is the docker installation from sudo apt-get install docker.io).

When a machine is running, docker version is returning Client Version 1.0.1

Rajurs

Sent from Windows Mail

From: Evan Hazlett
Sent: ‎Tuesday‎, ‎March‎ ‎24‎, ‎2015 ‎4‎:‎16‎ ‎PM
To: docker/machine
Cc: Pradeep Rajurs

hmm ok thanks -- could you run docker version as well?


Reply to this email directly or view it on GitHub.

@hairyhenderson
Copy link
Contributor

@rajurs - would you mind trying this out with the 0.2.0 release candidate? Download it from https://github.com/docker/machine/releases/tag/v0.2.0-rc1

I thought you were using a more recent build, which is why I assumed there would be quotes :)

@rajurs
Copy link
Author

rajurs commented Mar 25, 2015

I downloaded the linux amd64 binary from the link below and ran machine

It still says it is version
VERSION:
0.1.0 (aeb89ff)

Is this the right version? Does not say its 0.2.0

On 03/24/2015 06:39 PM, Dave Henderson wrote:

@rajurs https://github.com/rajurs - would you mind trying this out
with the 0.2.0 release candidate? Download it from
https://github.com/docker/machine/releases/tag/v0.2.0-rc1

I thought you were using a more recent build, which is why I assumed
there would be quotes :)


Reply to this email directly or view it on GitHub
#869 (comment).

@ehazlett
Copy link
Contributor

@rajurs yes there was a versioning issue but that is the correct SHA for the RC1.

Do you have any aliases or functions in your shell config that would be changing the Docker binary used? Can you also run docker version so we can see what versions you are working with?

Thanks

@rajurs
Copy link
Author

rajurs commented Mar 25, 2015

Nope, its a clean machine with no aliases.

Even with version 0.2.0, machine is failing to list containers.

Here is what I did:

rajurs@rajurs:$ machine create --driver virtualbox dev
INFO[0000] Creating SSH key...
INFO[0000] Creating VirtualBox VM...
INFO[0011] Starting VirtualBox VM...
INFO[0011] Waiting for VM to start...
INFO[0044] "dev" has been created and is now the active machine.
INFO[0044] To point your Docker client at it, run this in your shell:
eval "$(machine env dev)"
rajurs@rajurs:
$ machine ls
NAME ACTIVE DRIVER STATE URL SWARM
dev * virtualbox Running tcp://192.168.99.100:2376

rajurs@rajurs:$ machine env dev
export DOCKER_TLS_VERIFY=1
export DOCKER_CERT_PATH="/home/rajurs/.docker/machine/machines/dev"
export DOCKER_HOST=tcp://192.168.99.100:2376
rajurs@rajurs:
$ machine config dev
--tlsverify
--tlscacert="/home/rajurs/.docker/machine/machines/dev/ca.pem"
--tlscert="/home/rajurs/.docker/machine/machines/dev/cert.pem"
--tlskey="/home/rajurs/.docker/machine/machines/dev/key.pem"
-H=tcp://192.168.99.100:2376

rajurs@rajurs:$ eval "$(machine env dev)"
rajurs@rajurs:
$ docker ps
2015/03/25 09:41:05 Get
http://192.168.99.100:2376/v1.12/containers/json: malformed HTTP
response "\x15\x03\x01\x00\x02\x02"

When I run docker version, this is what I get..
rajurs@rajurs:~$ docker version
Client version: 1.0.1
Client API version: 1.12
Go version (client): go1.2.1
Git commit (client): 990021a
2015/03/25 09:41:29 Get http://192.168.99.100:2376/v1.12/version:
malformed HTTP response "\x15\x03\x01\x00\x02\x02"

On 03/25/2015 09:30 AM, Evan Hazlett wrote:

@rajurs https://github.com/rajurs yes there was a versioning issue
but that is the correct SHA for the RC1.

Do you have any aliases or functions in your shell config that would
be changing the Docker binary used? Can you also run |docker version|
so we can see what versions you are working with?

Thanks


Reply to this email directly or view it on GitHub
#869 (comment).

@ehazlett
Copy link
Contributor

So it looks like you have an old version of the client as it cannot even get the Docker version. Can you try updating your local client to 1.5?

@rajurs
Copy link
Author

rajurs commented Mar 26, 2015

Evan,

Installed newer versions of machine and docker. Things seem to be working as documented.

Thanks

Rajurs

Sent from Surface

From: Evan Hazlett
Sent: ‎Wednesday‎, ‎March‎ ‎25‎, ‎2015 ‎10‎:‎58‎ ‎AM
To: docker/machine
Cc: 'Pradeep Rajurs'

So it looks like you have an old version of the client as it cannot even get the Docker version. Can you try updating your local client to 1.5?


Reply to this email directly or view it on GitHub.

@ehazlett
Copy link
Contributor

@rajurs awesome! thanks for reporting and letting us know it fixed it!

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

3 participants