Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionFrancois Andrieu
2022-12-22 14:10:16 UTC
Description of problem:
Under some rare conditions, 'podman rm' succeeds but leaves the container running.
When a container is being stopped (or restarted), and if the main container process is not able to handle SIGTERM, podman fallback to SIGKILL after the default 10 seconds.
During these 10 seconds, a 'podman rm' command will succeed but will cancel the SIGKILL signal, leaving the container running behind.
Version-Release number of selected component (if applicable):
podman 4.2.0-4
conman 2.1.4-1
runc 1.1.4-1
How reproducible:
easily reproducible (see next section)
Steps to Reproduce:
1. Create the container (I'm also using systemd here to automatically restart the container and make it easier to catch the 10 seconds window)
$ podman create --name test_healthcheck --health-cmd /bin/false --health-interval 5s --health-retries 3 --health-timeout 1s --health-on-failure=stop --health-start-period 5s --stop-signal SIGTERM ubi8 sleep infinity
$ podman generate systemd test_healthcheck > /etc/systemd/system/test_healthcheck.service
$ systemctl daemon-reload
2. Start the container
$ systemctl start test_healthcheck.service
$ ps -ef |grep sleep
root 6691 6689 0 14:51 ? 00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep infinity
$ pstree -ps 6691
systemd(1)───conmon(6689)───sleep(6691)
3. Try to remove the container (will only work if you are in the 10s window after the first SIGTERM)
$ podman rm test_healthcheck
test_healthcheck
$ podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
<nothing>
Container has been removed, but the process is still running:
$ pstree -ps 6691
systemd(1)───conmon(6689)───sleep(6691)
Stopping the associated systemd unit does not help either:
$ systemctl stop test_healthcheck.service
Dec 22 14:54:56 rhel9 systemd[1]: Stopping Podman container-4b8219383aa5f26e9b02b7be78a09791751b07861c0a9a7ae1899667661745a0.service...
Dec 22 14:54:56 rhel9 podman[6830]: Error: no container with name or ID "4b8219383aa5f26e9b02b7be78a09791751b07861c0a9a7ae1899667661745a0" found: no such container
Dec 22 14:54:56 rhel9 systemd[1]: test_healthcheck.service: Control process exited, code=exited, status=125/n/a
Dec 22 14:56:07 rhel9 systemd[1]: test_healthcheck.service: State 'stop-sigterm' timed out. Killing.
Dec 22 14:56:07 rhel9 systemd[1]: test_healthcheck.service: Killing process 6689 (conmon) with signal SIGKILL.
Dec 22 14:56:07 rhel9 systemd[1]: test_healthcheck.service: Main process exited, code=killed, status=9/KILL
Dec 22 14:56:07 rhel9 podman[6837]: Error: no container with name or ID "4b8219383aa5f26e9b02b7be78a09791751b07861c0a9a7ae1899667661745a0" found: no such container
Dec 22 14:56:07 rhel9 systemd[1]: test_healthcheck.service: Control process exited, code=exited, status=125/n/a
Dec 22 14:56:07 rhel9 systemd[1]: test_healthcheck.service: Failed with result 'exit-code'.
Dec 22 14:56:07 rhel9 systemd[1]: Stopped Podman container-4b8219383aa5f26e9b02b7be78a09791751b07861c0a9a7ae1899667661745a0.service.
$ pstree -ps 6691
systemd(1)───sleep(6691)
Actual results:
The container is still running, and the containerized process is orphaned.
Expected results:
The container is stopped and then removed.
Additional info:
Same issue on both 8.7 with podman 4.2.0-1 and 9.2 with podman 4.3.1-3
Comment 3Giuseppe Scrivano
2023-01-03 15:48:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2023:2758