Skip to content

ctr restore fails #7672

@turan18

Description

@turan18

Description

After checkpointing a container and attempting to restore it ctr throws an error:

Error: [ctr error](ctr: OCI runtime restore failed: cannot allocate tty if runc will detach without setting console socket: unknown)

Although the restore fails, the task is actually created and can be found using ctr tasks ls. The task is in a created state with a PID of 0. Attempting to delete the task also fails ctr task rm restoredContainer=> err: ERRO[0000] unable to delete restoredContainer error="task must be stopped before deletion: created: failed precondition" ctr: task must be stopped before deletion: created: failed precondition. It appears that this issue is separate from the restore failure but seems to be caused by it. #7357 also describes this bug (task created but cannot be deleted)

Steps to reproduce the issue

  1. Start a container with a tty - ctr run -t --rm docker.io/library/busybox:latest testContainer
  2. In another shell checkpoint the container - ctr c checkpoint --rw --task --image testContainer testCheckpoint
  3. Now attempt to restore the container - ctr c restore --rw --live restoredContainer testCheckpoint
  4. err => [ctr error](ctr: OCI runtime restore failed: cannot allocate tty if runc will detach without setting console socket: unknown)

Describe the results you received and expected

Restore should not fail. Either a terminal should be allocated to the new container or it should be run in a detached mode. Similar to how ctr run handles IO.

What version of containerd are you using?

containerd github.com/containerd/containerd v1.6.10 770bd01

Any other relevant information

$ runc --version

runc version 1.0.0
commit: 84113eef6fc27af1b01b3181f31bbaf708715301
spec: 1.0.2-dev
go: go1.15.14
libseccomp: 2.4.1

Show configuration if it is related to CRI plugin.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions