# On agent start : "Error response from daemon: 400 Bad Request: malformed Host header"

**URL:** <https://forums.suse.com/t/on-agent-start-error-response-from-daemon-400-bad-request-malformed-host-header/2522>\
**Category:** Rancher 1.x\
**Created:** [April 19, 2016, 7:04pm UTC](https://forums.suse.com/t/on-agent-start-error-response-from-daemon-400-bad-request-malformed-host-header/2522 "2016-04-19T19:04:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nrvale0](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/nrvale0/32/1047_2.png) [@nrvale0](https://forums.suse.com/u/nrvale0)\
**Post date:** [April 19, 2016, 7:04pm UTC](https://forums.suse.com/t/on-agent-start-error-response-from-daemon-400-bad-request-malformed-host-header/2522/1 "2016-04-19T19:04:08Z")

</div>

Hey, folks.

I’ve been using RancherOS nodes as VMs for my experimentation and just this morning I decided to give my local workstation a try.

I get this when I try to start rancher/agent:

```
➜ ~ sudo docker run -ti --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.1 http://localhost:8080/v1/scripts/7E1B3B7754062FA12ABF:1461088800000:jQodlZauxaM3du4KRtR0Oga6Rs
Error response from daemon: 400 Bad Request: malformed Host header%

```

Note that I’ve stripped off the ‘-d’ option so I could see the error message.

dockerd is running on Ubuntu 16.04 fully-patched. Here’s the output of ‘docker version’:

```
➜ ~ docker version
Client:
  Version: 1.10.3
  API version: 1.22
  Go version: go1.6
  Git commit: 20f81dd
  Built: Mon, 11 Apr 2016 14:15:45 +1200
  OS/Arch: linux/amd64

Server:
 Version: 1.10.3
 API version: 1.22
 Go version: go1.6
 Git commit: 20f81dd
 Built: Mon, 04 Apr 2016 16:27:28 +1200
 OS/Arch: linux/amd64

```

According to this GH Issue, this might be related to Golang runtime’s handling of the Host header when the docker client is talking to the dockerd:

> <https://github.com/moby/moby/issues/20865>

When I login to my rancher VMs and check the output of ‘docker version’ I see an older version of Docker running against the Golang 1.5 runtime.

Any ideas?

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [April 21, 2016, 8:18pm UTC](https://forums.suse.com/t/on-agent-start-error-response-from-daemon-400-bad-request-malformed-host-header/2522/2 "2016-04-21T20:18:03Z")

</div>

It sounds like these are Docker errors as there is also this issue with Ubuntu 16.04.

> <https://github.com/rancher/rancher/issues/4500>

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [April 21, 2016, 10:12pm UTC](https://forums.suse.com/t/on-agent-start-error-response-from-daemon-400-bad-request-malformed-host-header/2522/3 "2016-04-21T22:12:00Z")

</div>

Docker reverted this and compiles releases with 1.5 because it broke older clients, but Ubuntu 16.04 is packaging a version with their own patches that was compiled with Go 1.6.

---

<div class="post-metadata">

**Author:** ![nrvale0](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/nrvale0/32/1047_2.png) [@nrvale0](https://forums.suse.com/u/nrvale0)\
**Post date:** [April 23, 2016, 12:24am UTC](https://forums.suse.com/t/on-agent-start-error-response-from-daemon-400-bad-request-malformed-host-header/2522/4 "2016-04-23T00:24:22Z")

</div>

Thanks for the info, folks.

Confirming that when I uninstalled the [docker.io](http://docker.io) package from Ubuntu and installed the docker-engine package from the official Docker apt repo things are now working as expected.

---

<div class="post-metadata">

**Author:** ![marceloaguero](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@marceloaguero](https://forums.suse.com/u/marceloaguero)\
**Post date:** [June 14, 2016, 10:18pm UTC](https://forums.suse.com/t/on-agent-start-error-response-from-daemon-400-bad-request-malformed-host-header/2522/5 "2016-06-14T22:18:26Z")

</div>

I can confirm that the problem is present in Archlinux too. They use go 1.6.2 in their docker package.
