-
Notifications
You must be signed in to change notification settings - Fork 18.8k
daemon: Fix panic on Windows when restoring pre v28 container #49626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The container platform migration tries to deduce the platform data from the containerd content store if it's available. However, on Windows we currently default to a non-containerd runtime setup, so the containerd client is nil and accessing its content store paniced: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0x11b48e4] goroutine 87 [running]: github.com/containerd/containerd/v2/client.(*Client).ContentStore(0xc0003a0008?) /go/src/github.com/docker/docker/vendor/github.com/containerd/containerd/v2/client/client.go:645 +0x24 github.com/docker/docker/daemon.(*Daemon).load(0xc00026e488, {0xc000c13d40, 0x40}) /go/src/github.com/docker/docker/daemon/container.go:84 +0x289 github.com/docker/docker/daemon.(*Daemon).restore.func1({0xc000c13d40, 0x40}) /go/src/github.com/docker/docker/daemon/daemon.go:236 +0x207 created by github.com/docker/docker/daemon.(*Daemon).restore in goroutine 1 /go/src/github.com/docker/docker/daemon/daemon.go:229 +0x1a7 panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0x11b48e4] goroutine 90 [running]: github.com/containerd/containerd/v2/client.(*Client).ContentStore(0xc000313608?) /go/src/github.com/docker/docker/vendor/github.com/containerd/containerd/v2/client/client.go:645 +0x24 github.com/docker/docker/daemon.(*Daemon).load(0xc00026e488, {0xc000c13e00, 0x40}) /go/src/github.com/docker/docker/daemon/container.go:84 +0x289 github.com/docker/docker/daemon.(*Daemon).restore.func1({0xc000c13e00, 0x40}) /go/src/github.com/docker/docker/daemon/daemon.go:236 +0x207 created by github.com/docker/docker/daemon.(*Daemon).restore in goroutine 1 /go/src/github.com/docker/docker/daemon/daemon.go:229 +0x1a7 panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0x11b48e4] ``` Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
content: daemon.containerdClient.ContentStore(), | ||
} | ||
if daemon.containerdClient != nil { | ||
migration.content = daemon.containerdClient.ContentStore() | ||
} | ||
migrate 8000 ContainerOS(context.TODO(), migration, ctr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other things are still needed in this case, or could this be skipped as a whole?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we still want to deduce the Architecture
from the image (but without using the containerd content store).
The container platform migration tries to deduce the platform data from the containerd content store if it's available.
However, on Windows we currently default to a non-containerd runtime setup, so the containerd client is nil and accessing its content store paniced:
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)