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 stop --ignore returns an error if --cidfile argument is used #19546

Closed
rbagd opened this issue Aug 8, 2023 · 4 comments · Fixed by #19549
Closed

podman stop --ignore returns an error if --cidfile argument is used #19546

rbagd opened this issue Aug 8, 2023 · 4 comments · Fixed by #19549
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

@rbagd
Copy link
Contributor

rbagd commented Aug 8, 2023

Issue Description

We noticed this issue after upgrade to RHEL 8.8 and podman v4.4.1, when timer-driven systemd services kept restarting. It turns out that this line in systemd service file kept failing with an error

ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id

I am not able to test with latest upstream at the moment.

Steps to reproduce the issue

Steps to reproduce the issue

  1. podman stop --ignore --cidfile=whatever.cid # should not return any errors but does
  2. echo$? # returns 125

On the other hand, podman stop --ignore nonexistent-container exits with 0.

Describe the results you received

Error was returned, even though it should be ignored. systemd services kept restarting because of it.

Describe the results you expected

Error should not be returned and podman stop --ignore should exit with 0.

podman info output

host:
  arch: amd64
  buildahVersion: 1.29.0
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.1.6-1.module+el8.8.0+18098+9b44df5f.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.6, commit: 8c4ab5a095127ecc96ef8a9c885e0e1b14aeb11b'
  cpuUtilization:
    idlePercent: 99.36
    systemPercent: 0.26
    userPercent: 0.39
  cpus: 4
  distribution:
    distribution: '"rhel"'
    version: "8.8"
  eventLogger: file
  hostname: ourserver.local
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000394
      size: 1
    - container_id: 1
      host_id: 2000000
      size: 1000000
    uidmap:
    - container_id: 0
      host_id: 1002705
      size: 1
    - container_id: 1
      host_id: 2000000
      size: 1000000
  kernel: 4.18.0-477.15.1.el8_8.x86_64
  linkmode: dynamic
  logDriver: k8s-file
  memFree: 318619648
  memTotal: 8038875136
  networkBackend: cni
  ociRuntime:
    name: runc
    package: runc-1.1.4-1.module+el8.8.0+18060+3f21f2cc.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.1.4
      spec: 1.0.2-dev
      go: go1.19.4
      libseccomp: 2.5.2
  os: linux
  remoteSocket:
    path: /tmp/podman-run-1002705/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_SYS_CHROOT,CAP_NET_RAW,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-2.module+el8.8.0+18060+3f21f2cc.x86_64
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.4.0
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.2
  swapFree: 1029328896
  swapTotal: 1073737728
  uptime: 482h 44m 57.00s (Approximately 20.08 days)
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.access.redhat.com
  - registry.redhat.io
  - docker.io
store:
  configFile: /home/gitlab-runner/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/gitlab-runner/.local/share/containers/storage
  graphRootAllocated: 99951767552
  graphRootUsed: 16146886656
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 228
  runRoot: /tmp/podman-run-1002705/containers
  transientStore: false
  volumePath: /home/gitlab-runner/.local/share/containers/storage/volumes
version:
  APIVersion: 4.4.1
  Built: 1686839996
  BuiltTime: Thu Jun 15 16:39:56 2023
  GitCommit: ""
  GoVersion: go1.19.6
  Os: linux
  OsArch: linux/amd64
  Version: 4.4.1

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@rbagd rbagd added the kind/bug Categorizes issue or PR as related to a bug. label Aug 8, 2023
@vrothberg
Copy link
Member

Thanks for reaching out, @rbagd.

Since you reported using RHEL. If you desire a backport, please go through the Red Hat customer channels (e.g., Bugzilla). We can fix the issue upstream but backporting is up to the respective downstream distributions.

@vrothberg
Copy link
Member

Podman 4.6.0 fails as follows:

$ podman stop --cidfile /tmp/cid --ignore
Error: reading CIDFile: open /tmp/cid: no such file or directory

I think Podman should ignore the cidfile error with --ignore. @rbagd is this error message what you're seeing in 4.4.1 as well?

@rbagd
Copy link
Contributor Author

rbagd commented Aug 8, 2023

@vrothberg, yes, that's the error. I think that's a regression from v4.3 as I didn't notice any issues with RHEL 8.7.

rhatdan added a commit to rhatdan/podman that referenced this issue Aug 8, 2023
Podman should ignore failures to find a cidfile when stoping the
container if the user specified --ignore

Fixes: containers#19546

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Aug 8, 2023

Looks like podman rm --cidfile missing --ignore already handled this situation.

rhatdan added a commit to rhatdan/podman that referenced this issue Aug 8, 2023
Podman should ignore failures to find a cidfile when stoping the
container if the user specified --ignore

Fixes: containers#19546

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Aug 8, 2023
Podman should ignore failures to find a cidfile when stoping the
container if the user specified --ignore

Fixes: containers#19546

Signed-off-by: Daniel J Walsh <dwalsh@redhat.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 Nov 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 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