Skip to content

Pre-golang 1.6 Dockers can't talk to golang 1.6 Docker #20865

@duglin

Description

@duglin

When Docker v1.9 (and before) talks to Docker v1.11 (master) via a unix socket the daemon will reject the request with this error:

Error response from daemon: 400 Bad Request: malformed Host header

I believe this is because the HTTP Host header will have a value of: /var/run/docker.sock which isn't a valid hostname and I believe golang 1.6 is now checking the value in validHostHeader() (in https://golang.org/src/net/http/request.go) and "/" isn't a valid char.

In Docker v1.11 (master) we now set the HTTP Host header to "", which is why we don't see this on master.

I've been looking into a way to avoid having golang perform this check but haven't found a way yet.

Net is that this may force all clients that want to talk to a daemon via a unix docker to be upgraded at the same time as the daemon. Not an ideal UX situation.

The only other option I can think of, and its not great, is to postpone upgrading to golang 1.6 until v1.12 so that we can make v1.11 send a Host header with a value of "" for one release before we turn on this check in the daemon. Then during the v1.12 upgrade process clients can upgrade later then the daemon, as long as they're at least on v1.11.

Anyway, wanted to open an issue so we could have a discussion and brainstorm on ideas.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions