Skip to content

[1.11-rc5] docker daemon can send application/json type with invalid text payload #21957

@bboreham

Description

@bboreham

Seen via strace:

[pid  9460] read(5, "HTTP/1.1 200 OK\r\nContent-Length: 167\r\nContent-Type: application/json\r\nDate: Tue, 12 Apr 2016 10:25:27 GMT\r\nServer: Docker/1.11.0-rc5 (linux)\r\n\r\nThe image weaveworks/weave:latest already exists, renaming the old one with ID sha256:8a1f2f5f008334b625425659bab9ebdd2ffaea7dae6821d57bf9e0c2e9ad0c69 to empty string\n", 4096) = 311

it is claiming to send JSON, but actually sends plain text, which the client then barfs on.

Output of docker version:

Client:
 Version:      1.11.0-rc5
 API version:  1.23
 Go version:   go1.5.3
 Git commit:   6178547
 Built:        Mon Apr 11 21:11:46 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.0-rc5
 API version:  1.23
 Go version:   go1.5.3
 Git commit:   6178547
 Built:        Mon Apr 11 21:11:46 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 3
 Running: 0
 Paused: 0
 Stopped: 3
Images: 29
Server Version: 1.11.0-rc5
Storage Driver: overlay
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 4.2.0-34-generic
Operating System: Ubuntu 15.10
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 362.9 MiB
Name: host1
ID: WSO5:2WPX:NINR:DJJJ:U5VI:VZRJ:KBFJ:JCSE:VQGB:Y5WX:AOMI:24L6
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): true
 File Descriptors: 14
 Goroutines: 30
 System Time: 2016-04-12T10:40:04.73189936Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):

VirtualBox running Ubuntu 15.10

Steps to reproduce the issue:

  1. build the Weave Net project https://github.com/weaveworks/weave
  2. docker load the output on a different machine
  3. change something and rebuild the project, so you get different checksums
  4. docker load the output onto the same machine as before

Describe the results you received:

$ docker load -i weave.tar.gz 
2aa27ff8f322: Loading layer [==================================================>] 21.24 MB/21.24 MB
6c02f687aa00: Loading layer [==================================================>]   277 kB/277 kB
invalid character 'T' looking for beginning of value

Describe the results you expected:

The image weaveworks/weave:latest already exists, renaming the old one with ID sha256:8a1f2f5f008334b625425659bab9ebdd2ffaea7dae6821d57bf9e0c2e9ad0c69 to empty string

Additional information you deem important (e.g. issue happens only occasionally):

Happens every time.

The comparable http reply from 1.10.3 is:

HTTP/1.1 200 OK\r\nServer: Docker/1.10.3 (linux)\r\nDate: Tue, 12 Apr 2016 10:29:53 GMT\r\nContent-Length: 167\r\nContent-Type: text/plain; charset=utf-8\r\n\r\nThe image weaveworks/weave:latest already exists, renaming the old one with ID sha256:3cb08e6d141a1545e066e4e3f4873e4869bc62752a01e8c4342176ac252dcaca to empty string\n

Note the content-type matches the content there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiAPIkind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions