Skip to content

[1.12.x] docker pull for plugin should fail with a human-friendly error #23752

@AkihiroSuda

Description

@AkihiroSuda

Output of docker version:

Client:
 Version:      1.12.0-rc2
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   906eacd-unsupported
 Built:        Fri Jun 17 21:12:28 2016
 OS/Arch:      linux/amd64
 Experimental: true

Server:
 Version:      1.12.0-rc2
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   906eacd-unsupported
 Built:        Fri Jun 17 21:12:28 2016
 OS/Arch:      linux/amd64
 Experimental: true

Output of docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.0-rc2
Storage Driver: overlay2
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge null host overlay
Swarm: inactive
Runtimes: default
Default Runtime: default
Security Options: apparmor seccomp
Kernel Version: 4.4.0-22-generic
Operating System: Ubuntu 16.04 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.795 GiB
Name: hoge
ID: 5HJM:SQPO:3NEM:ZYX7:3LME:WIHB:E3BN:RNMZ:6K4F:JCQ6:UY2Z:CR26
Docker Root Dir: /mnt/disk2/docker3
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: true
Insecure Registries:
 127.0.0.0/8

Steps to reproduce the issue:
Do docker pull tiborvass/no-remove

Describe the results you received:

$ docker pull tiborvass/no-remove
Using default tag: latest
latest: Pulling from tiborvass/no-remove
1c482de4cb9f: Pull complete 
unexpected EOF

Plus the daemon panics (and recovered, so this is not critical)

http: panic serving @: runtime error: invalid memory address or nil pointer dereference
goroutine 137 [running]:
net/http.(*conn).serve.func1(0xc820323700)
        /usr/local/go/src/net/http/server.go:1389 +0xc1
panic(0x1a56920, 0xc82000e090)
        /usr/local/go/src/runtime/panic.go:443 +0x4e9
github.com/docker/docker/distribution.(*v2Puller).pullSchema2(0xc8203c0960, 0x7f1f8fc0a2a0, 0xc820e78740, 0x7f1f8fc1b388, 0xc820d710b0, 0xc820967830, 0xc820df48c0, 0x47, 0xc820d

        /usr/src/docker/.gopath/src/github.com/docker/docker/distribution/pull_v2.go:585 +0xca4
github.com/docker/docker/distribution.(*v2Puller).pullV2Tag(0xc8203c0960, 0x7f1f8fc0a2a0, 0xc820d8e380, 0x7f1f8fc1b388, 0xc820d710b0, 0x2, 0x0, 0x0)
        /usr/src/docker/.gopath/src/github.com/docker/docker/distribution/pull_v2.go:378 +0xd8d
github.com/docker/docker/distribution.(*v2Puller).pullV2Repository(0xc8203c0960, 0x7f1f8fc0a2a0, 0xc820d8e380, 0x7f1f8fc1b388, 0xc820d710b0, 0x0, 0x0)
        /usr/src/docker/.gopath/src/github.com/docker/docker/distribution/pull_v2.go:86 +0xdb
github.com/docker/docker/distribution.(*v2Puller).Pull(0xc8203c0960, 0x7f1f8fc0a2a0, 0xc820d8e380, 0x7f1f8fc1b388, 0xc820d710b0, 0x0, 0x0)
        /usr/src/docker/.gopath/src/github.com/docker/docker/distribution/pull_v2.go:67 +0x283
github.com/docker/docker/distribution.Pull(0x7f1f8fc0a2a0, 0xc820d8e380, 0x7f1f8fc1b388, 0xc820d710b0, 0xc8207e5ce0, 0x0, 0x0)
        /usr/src/docker/.gopath/src/github.com/docker/docker/distribution/pull.go:138 +0x9ed
github.com/docker/docker/daemon.(*Daemon).pullImageWithReference(0xc8204441a0, 0x7f1f8fc0a2a0, 0xc820d8e380, 0x7f1f8fc1b388, 0xc820d710b0, 0xc820d85980, 0xc8207e5b90, 0x7f1f8fc1

        /usr/src/docker/.gopath/src/github.com/docker/docker/daemon/image_pull.go:102 +0x39c
github.com/docker/docker/daemon.(*Daemon).PullImage(0xc8204441a0, 0x7f1f8fc0a2a0, 0xc820d8e240, 0xc820d86e60, 0x13, 0xc820d7267e, 0x6, 0xc820d85980, 0xc8207e5b90, 0x7f1f8fc1b168

        /usr/src/docker/.gopath/src/github.com/docker/docker/daemon/image_pull.go:44 +0x34c
github.com/docker/docker/api/server/router/image.(*imageRouter).postImagesCreate(0xc820452280, 0x7f1f8fc0a2a0, 0xc820d8e240, 0x7f1f8fbd0d20, 0xc820aceb60, 0xc820d6c380, 0xc820d8

        /usr/src/docker/.gopath/src/github.com/docker/docker/api/server/router/image/image_routes.go:108 +0xb74
github.com/docker/docker/api/server/router/image.(*imageRouter).(github.com/docker/docker/api/server/router/image.postImagesCreate)-fm(0x7f1f8fc0a2a0, 0xc820d8e240, 0x7f1f8fbd0d
20d85770, 0x0, 0x0)
        /usr/src/docker/.gopath/src/github.com/docker/docker/api/server/router/image/image.go:43 +0x74
github.com/docker/docker/api/server/router.cancellableHandler.func1(0x7f1f8fc0a2a0, 0xc820d8e240, 0x7f1f8fbd0d20, 0xc820aceb60, 0xc820d6c380, 0xc820d85770, 0x0, 0x0)
        /usr/src/docker/.gopath/src/github.com/docker/docker/api/server/router/local.go:84 +0x1ed
github.com/docker/docker/api/server/middleware.VersionMiddleware.WrapHandler.func1(0x7f1f8fc0a230, 0xc820d858c0, 0x7f1f8fbd0d20, 0xc820aceb60, 0xc820d6c380, 0xc820d85770, 0x0, 0

        /usr/src/docker/.gopath/src/github.com/docker/docker/api/server/middleware/version.go:56 +0x9aa
github.com/docker/docker/api/server/middleware.UserAgentMiddleware.WrapHandler.func1(0x7f1f8fc0a230, 0xc820d857d0, 0x7f1f8fbd0d20, 0xc820aceb60, 0xc820d6c380, 0xc820d85770, 0x0,

        /usr/src/docker/.gopath/src/github.com/docker/docker/api/server/middleware/user_agent.go:45 +0x68e
github.com/docker/docker/api/server.(*Server).makeHTTPHandler.func1(0x7f1f8fbd0d20, 0xc820aceb60, 0xc820d6c380)
        /usr/src/docker/.gopath/src/github.com/docker/docker/api/server/server.go:139 +0x138
net/http.HandlerFunc.ServeHTTP(0xc8204656c0, 0x7f1f8fbd0d20, 0xc820aceb60, 0xc820d6c380)
        /usr/local/go/src/net/http/server.go:1618 +0x3a
github.com/gorilla/mux.(*Router).ServeHTTP(0xc82000b040, 0x7f1f8fbd0d20, 0xc820aceb60, 0xc820d6c380)
        /usr/src/docker/vendor/src/github.com/gorilla/mux/mux.go:98 +0x29e
github.com/docker/docker/api/server.(*routerSwapper).ServeHTTP(0xc8208103e0, 0x7f1f8fbd0d20, 0xc820aceb60, 0xc820d6c380)
        /usr/src/docker/.gopath/src/github.com/docker/docker/api/server/router_swapper.go:29 +0x72
net/http.serverHandler.ServeHTTP(0xc8203e4080, 0x7f1f8fbd0d20, 0xc820aceb60, 0xc820d6c380)
        /usr/local/go/src/net/http/server.go:2081 +0x19e
net/http.(*conn).serve(0xc820323700)
        /usr/local/go/src/net/http/server.go:1472 +0xf2e
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:2137 +0x44e

Describe the results you expected:
(example)

$ docker pull tiborvass/no-remove
tiborvass/no-remove is a plugin. Please use `docker plugin` instead for installing this plugin.

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

Metadata

Metadata

Assignees

Labels

kind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.priority/P3Best effort: those are nice to have / minor issues.version/1.12

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions