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

Failed to container restore a container which name is equal to a image name #15055

Closed
sstosh opened this issue Jul 25, 2022 · 3 comments · Fixed by #15066
Closed

Failed to container restore a container which name is equal to a image name #15055

sstosh opened this issue Jul 25, 2022 · 3 comments · Fixed by #15066
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

@sstosh
Copy link
Contributor

sstosh commented Jul 25, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Related to #13505

If a container name is equal to a image name, failed to restore the container.
The reason is that image has a higher search priority than container.
I don't know what this priority is correct.

Steps to reproduce the issue:

# podman run -d --name nginx nginx
08ab88ed33f54a00d5fc4269d535361f1aa7ae6e8c8e648ea0fcca045474b3a7

# podman container checkpoint nginx
08ab88ed33f54a00d5fc4269d535361f1aa7ae6e8c8e648ea0fcca045474b3a7

# podman images
REPOSITORY                       TAG         IMAGE ID      CREATED       SIZE
docker.io/library/nginx          latest      670dcc86b69d  5 days ago    146 MB

Describe the results you received:

# podman container restore nginx
Error: image is not a checkpoint: 670dcc86b69df89a9d5a9e1a7ae5b8f67619c1c74e19de8a35f57d6c06505fd4

Describe the results you expected:

# podman container restore nginx
670dcc86b69df89a9d5a9e1a7ae5b8f67619c1c74e19de8a35f57d6c06505fd4

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

If a container name is NOT equal to a image name, succeed to restore the container.

# podman run -d --name nginx2 nginx
f58ad2dfb7b8e856e03f98a29a9b234e2bdf117bfb8d4ceef07c0e45bbe9053e

# podman container checkpoint nginx2
f58ad2dfb7b8e856e03f98a29a9b234e2bdf117bfb8d4ceef07c0e45bbe9053e

# podman images
REPOSITORY               TAG         IMAGE ID      CREATED     SIZE
docker.io/library/nginx  latest      670dcc86b69d  5 days ago  146 MB

# podman container restore nginx2
f58ad2dfb7b8e856e03f98a29a9b234e2bdf117bfb8d4ceef07c0e45bbe9053e

Output of podman version:

# podman version
Client:       Podman Engine
Version:      4.2.0-dev
API Version:  4.2.0-dev
Go Version:   go1.18.3
Git Commit:   da1f47921685f40f1b26405278cbf9cb2d06fe09
Built:        Mon Jul 25 09:40:45 2022
OS/Arch:      linux/amd64

Output of podman info --debug:

# podman info --debug
host:
  arch: amd64
  buildahVersion: 1.27.0-dev
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.0-2.fc36.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpuUtilization:
    idlePercent: 99.74
    systemPercent: 0.14
    userPercent: 0.12
  cpus: 12
  distribution:
    distribution: fedora
    variant: server
    version: "36"
  eventLogger: journald
  hostname: fedora36
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.18.11-200.fc36.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 1518333952
  memTotal: 8326590464
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.4.5-1.fc36.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.4.5
      commit: c381048530aa750495cf502ddb7181f2ded5b400
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 8315465728
  swapTotal: 8325689344
  uptime: 74h 9m 12.00s (Approximately 3.08 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 2
    paused: 0
    running: 1
    stopped: 1
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 106285760512
  graphRootUsed: 24363585536
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 5
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.2.0-dev
  Built: 1658709645
  BuiltTime: Mon Jul 25 09:40:45 2022
  GitCommit: da1f47921685f40f1b26405278cbf9cb2d06fe09
  GoVersion: go1.18.3
  Os: linux
  OsArch: linux/amd64
  Version: 4.2.0-dev

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

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

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 25, 2022
@vrothberg
Copy link
Member

Nice catch, @sstosh!

Podman should probably try looking up the container if the image has failed. If both fail, both errors should returned.

@Luap99
Copy link
Member

Luap99 commented Jul 25, 2022

I would also say if there is a match for both we should prefer the container.

@vrothberg
Copy link
Member

I would also say if there is a match for both we should prefer the container.

SGTM. If that fails, try an image.

sstosh added a commit to sstosh/podman that referenced this issue Jul 26, 2022
If there is a match for both container and image, we restore the container.

Fixes: containers#15055

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
sstosh added a commit to sstosh/podman that referenced this issue Jul 26, 2022
If there is a match for both container and image, we restore the container.

Fixes: containers#15055

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
sstosh added a commit to sstosh/podman that referenced this issue Jul 27, 2022
If there is a match for both container and image, we restore the container.

Fixes: containers#15055

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
mheon pushed a commit to mheon/libpod that referenced this issue Aug 10, 2022
If there is a match for both container and image, we restore the container.

Fixes: containers#15055

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
mheon pushed a commit to mheon/libpod that referenced this issue Aug 10, 2022
If there is a match for both container and image, we restore the container.

Fixes: containers#15055

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
@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 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 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.

3 participants