Skip to content
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

podman-remote container restore: panic #12007

Closed
edsantiago opened this issue Oct 18, 2021 · 7 comments · Fixed by #12281
Closed

podman-remote container restore: panic #12007

edsantiago opened this issue Oct 18, 2021 · 7 comments · Fixed by #12281
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@edsantiago
Copy link
Member

I have no opinion on whether podman-remote container restore should work or not; but I would prefer if it didn't panic:

$ sudo bin/podman-remote run -d --name foo alpine sleep 100;sudo bin/podman-remote container checkpoint foo;sudo bin/podman-remote container restore foo

08d8f7bf3fd831295ed9931a652d7a4a2ed09ce0c37a21e518b162f166febcba
08d8f7bf3fd831295ed9931a652d7a4a2ed09ce0c37a21e518b162f166febcba
panic: reflect: call of reflect.Value.IsNil on zero Value

goroutine 1 [running]:
reflect.Value.IsNil(...)
        /usr/lib/golang/src/reflect/value.go:1086
github.com/containers/podman/v3/pkg/bindings/internal/util.Changed(0x12b0b00, 0xc000330800, 0x13170d4, 0xd, 0x0)
        /home/esm/src/atomic/2018-02.podman/libpod/pkg/bindings/internal/util/util.go:51 +0x1fa
github.com/containers/podman/v3/pkg/bindings/containers.(*RestoreOptions).Changed(...)
        /home/esm/src/atomic/2018-02.podman/libpod/pkg/bindings/containers/types_restore_options.go:12
github.com/containers/podman/v3/pkg/bindings/containers.Restore(0x14cf488, 0xc000696690, 0xc000387480, 0x40, 0xc000330800, 0x0, 0x0, 0x0)
        /home/esm/src/atomic/2018-02.podman/libpod/pkg/bindings/containers/checkpoint.go:52 +0x193
github.com/containers/podman/v3/pkg/domain/infra/tunnel.(*ContainerEngine).ContainerRestore(0xc0002f4450, 0x14cf418, 0xc000036110, 0xc0002f42c0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, ...)
        /home/esm/src/atomic/2018-02.podman/libpod/pkg/domain/infra/tunnel/containers.go:365 +0x25b
github.com/containers/podman/v3/cmd/podman/containers.restore(0x1b984e0, 0xc0002f42c0, 0x1, 0x1, 0x0, 0x0)
        /home/esm/src/atomic/2018-02.podman/libpod/cmd/podman/containers/restore.go:131 +0x255
github.com/spf13/cobra.(*Command).execute(0x1b984e0, 0xc0000320f0, 0x1, 0x1, 0x1b984e0, 0xc0000320f0)
        /home/esm/src/atomic/2018-02.podman/libpod/vendor/github.com/spf13/cobra/command.go:856 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0x1bafbe0, 0xc000036110, 0x1182c80, 0x1c60370)
        /home/esm/src/atomic/2018-02.podman/libpod/vendor/github.com/spf13/cobra/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /home/esm/src/atomic/2018-02.podman/libpod/vendor/github.com/spf13/cobra/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        /home/esm/src/atomic/2018-02.podman/libpod/vendor/github.com/spf13/cobra/command.go:895
main.Execute()
        /home/esm/src/atomic/2018-02.podman/libpod/cmd/podman/root.go:91 +0xe7
main.main()
        /home/esm/src/atomic/2018-02.podman/libpod/cmd/podman/main.go:39 +0x92
@mheon mheon added the kind/bug Categorizes issue or PR as related to a bug. label Oct 19, 2021
@vrothberg vrothberg self-assigned this Oct 20, 2021
@vrothberg
Copy link
Member

Thanks, Ed! I'll take a look.

@vrothberg
Copy link
Member

I wonder how we ended up with checkpoint being supported on remote and having e2e tests for it disabled.

@vrothberg
Copy link
Member

Fixing the panic is easy:

diff --git a/pkg/bindings/containers/checkpoint.go b/pkg/bindings/containers/checkpoint.go
index 7f7080f13be8..eea2b7b1f8d5 100644
--- a/pkg/bindings/containers/checkpoint.go
+++ b/pkg/bindings/containers/checkpoint.go
@@ -49,7 +49,7 @@ func Restore(ctx context.Context, nameOrID string, options *RestoreOptions) (*en
        }
        // The import key is a reserved golang term
        params.Del("ImportArchive")
-       if i := options.GetImportAchive(); options.Changed("ImportArchive") {
+       if i := options.GetImportAchive(); i != "" {
                params.Set("import", i)
        }
        response, err := conn.DoRequest(nil, http.MethodPost, "/containers/%s/restore", params, nil, nameOrID)

Getting checkpoint/restore to fully work (i.e., enabling the e2e tests for remote) is a bigger chunk of work. I have quite some work on my plate at the moment, but I try to push it forward as time allows.

@rhatdan
Copy link
Member

rhatdan commented Oct 20, 2021

Can you open a PR?

@vrothberg
Copy link
Member

Can you open a PR?

I prefer doing all at once.

@vrothberg
Copy link
Member

... continuing now

vrothberg added a commit to vrothberg/libpod that referenced this issue Nov 16, 2021
Nothing was working before, and it's too much to summarize.  To make
sure we're not regressing in the future again, enable the remote e2e
tests.

Fixes: containers#12007
Signed-off-by: Valentin Rothberg <[email protected]>
@edsantiago
Copy link
Member Author

Followup: confirmed that restore now works with podman-remote: CI logs from f34, ubuntu-2110.

However, there's a deeply troubling failure in a recent active PR run on f34. Filed #12334 for that.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants