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.
Bug 2100740 - podman can not force remove paused container
Summary: podman can not force remove paused container
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jindrich Novy
QA Contact: Alex Jia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-24 07:15 UTC by Joy Pu
Modified: 2023-09-18 04:40 UTC (History)
12 users (show)

Fixed In Version: podman-4.2.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-08 09:16:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github containers podman pull 14765 0 None Merged runtime: unpause the container before killing it 2022-06-29 09:42:20 UTC
Red Hat Issue Tracker RHELPLAN-126211 0 None None None 2022-06-24 07:34:19 UTC
Red Hat Product Errata RHSA-2022:7457 0 None None None 2022-11-08 09:16:49 UTC

Description Joy Pu 2022-06-24 07:15:36 UTC
Description of problem:
When try to remove a paused container with podman rm -f, the command will report error message:
ERRO[0000] container not paused                         
Error: `/usr/bin/runc resume 8d7dfd49b1dc557749a0d08022198847c689f611a53a914d6a14b7fbbf0bb03f` failed: exit status 1


Version-Release number of selected component (if applicable):
podman-4.1.1-1.module+el8.6.0+15659+f3ff693b.x86_64
runc-1.1.3-2.module+el8.6.0+15659+f3ff693b.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start a container
# podman run --name test -d quay.io/libpod/testimage:20210610 top
ab43e6eabc38bdced345be2a96bffdaa172b63432d08a37833173ad2e805723c

2. pause the container
# podman run --name test -d quay.io/libpod/testimage:20210610 top
ab43e6eabc38bdced345be2a96bffdaa172b63432d08a37833173ad2e805723c

3. Try to kill it with --force
# podman rm -f test
ERRO[0000] container not paused                         
Error: `/usr/bin/runc resume ab43e6eabc38bdced345be2a96bffdaa172b63432d08a37833173ad2e805723c` failed: exit status 1

Actual results:
rm failed with error message

Expected results:
Container can be removed as expected


Additional info:
The same problem also can be found in RHEL 8.7 but works well in RHEL 9.1 with similar version of podman and runc

Comment 1 Joy Pu 2022-06-24 07:17:19 UTC
The same steps works with runc-1.0.3-2.module+el8.6.0+15634+64c2e3db.x86_64.

Comment 3 Giuseppe Scrivano 2022-06-28 16:02:26 UTC
I think the "$RUNTIME resume $CTR" call should not fail in any case.

Comment 4 Ed Santiago 2022-06-28 16:47:28 UTC
Error reproduces easily on 1MT-RHEL-8.6.0-updates-20220614.0 with MB 15659. Cgroups is v1. Rebooting into cgroups v2, the error does not reproduce.

Comment 5 Giuseppe Scrivano 2022-06-28 20:08:04 UTC
the issue is caused by the block in removeContainer():

		isV2, err := cgroups.IsCgroup2UnifiedMode()
		if err != nil {
			return err
		}
		// cgroups v1 and v2 handle signals on paused processes differently
		if !isV2 {
			if err := c.unpause(); err != nil {
				return err
			}
		}


Matt, what do you suggest?  Do we move the unpause before the KillContainer, or do we drop it completely and let the OCI runtime deal with it (in this case I'd have to change crun)?

Comment 6 Matthew Heon 2022-06-28 20:13:26 UTC
The intent of killing before unpausing was, AFAIK, to ensure that containers that were acting maliciously (e.g. forkbomb) could be paused and removed without resuming execution. Changing the order of the operations would seem to defeat that, so relying on the OCI runtime to behave correctly seems best. It would be best if we could either ignore that error out of runc or be conditional about what runtimes require it, but that seems like an overly complicated solution.

Comment 7 Giuseppe Scrivano 2022-06-28 20:50:16 UTC
opened a PR: https://github.com/containers/podman/pull/14765

Comment 8 Alex Jia 2022-06-29 03:02:50 UTC
(In reply to Giuseppe Scrivano from comment #7)
> opened a PR: https://github.com/containers/podman/pull/14765

This PR works for me.

[root@kvm-05-guest11 podman]# git pull origin pull/14765/head
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0
Unpacking objects: 100% (4/4), 1004 bytes | 502.00 KiB/s, done.
From https://github.com/containers/podman
 * branch                refs/pull/14765/head -> FETCH_HEAD
Updating 653e87dd4..1affceb29
Fast-forward
 libpod/runtime_ctr.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

[root@kvm-05-guest11 podman]# make podman
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
	 \
	-ldflags '-X github.com/containers/podman/v4/libpod/define.gitCommit=1affceb29f197b0c3dca13391b8eef36e39a175b -X github.com/containers/podman/v4/libpod/define.buildInfo=1656471486 -X github.com/containers/podman/v4/libpod/config._installPrefix=/usr/local -X github.com/containers/podman/v4/libpod/config._etcDir=/usr/local/etc -X github.com/containers/common/pkg/config.additionalHelperBinariesDir= ' \
	-tags "   selinux systemd  exclude_graphdriver_devicemapper seccomp" \
	-o bin/podman ./cmd/podman
[root@kvm-05-guest11 podman]# ./bin/podman run --name foo -d quay.io/libpod/testimage:20210610 top
17f1031a6d54cd592401fe6b6b513de1d9ed272a0ea8f628153a2f2e95f6a52a

[root@kvm-05-guest11 podman]# ./bin/podman pause foo
17f1031a6d54cd592401fe6b6b513de1d9ed272a0ea8f628153a2f2e95f6a52a

[root@kvm-05-guest11 podman]# ./bin/podman ps -a --filter name=foo
CONTAINER ID  IMAGE                              COMMAND     CREATED         STATUS                      PORTS       NAMES
17f1031a6d54  quay.io/libpod/testimage:20210610  top         19 seconds ago  Paused                                  foo

[root@kvm-05-guest11 podman]# ./bin/podman rm -f foo
17f1031a6d54cd592401fe6b6b513de1d9ed272a0ea8f628153a2f2e95f6a52a

[root@kvm-05-guest11 podman]# ./bin/podman ps -a --filter name=foo
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES

Comment 14 Tom Sweeney 2022-07-20 21:04:11 UTC
This was not yet backported into v4.1.1-rhel so it won't make RHEL 8.6.0.2.  Will push this out to RHEL 8.7.

Comment 18 Alex Jia 2022-08-29 12:11:05 UTC
This bug has been verified on podman-4.2.0-1.module+el8.7.0+16493+89f82ab8.x86_64.

[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.7 Beta (Ootpa)

[root@hpe-dl380pgen8-02-vm-7 ~]# rpm -q podman runc systemd kernel
podman-4.2.0-1.module+el8.7.0+16493+89f82ab8.x86_64
runc-1.1.4-1.module+el8.7.0+16493+89f82ab8.x86_64
systemd-239-65.el8.x86_64
kernel-4.18.0-422.el8.x86_64

[root@hpe-dl380pgen8-02-vm-7 ~]# podman run --name foo -d quay.io/libpod/testimage:20210610 top
Trying to pull quay.io/libpod/testimage:20210610...
Getting image source signatures
Copying blob 9afcdfe780b4 done  
Copying config 9f9ec7f2fd done  
Writing manifest to image destination
Storing signatures
e7ae48c5f1838b10daea10ccfbd835397b36f23371c63ca6e1438df8295512fd

[root@hpe-dl380pgen8-02-vm-7 ~]# podman pause foo
e7ae48c5f1838b10daea10ccfbd835397b36f23371c63ca6e1438df8295512fd

[root@hpe-dl380pgen8-02-vm-7 ~]# podman ps -a --filter name=foo
CONTAINER ID  IMAGE                              COMMAND     CREATED         STATUS      PORTS       NAMES
e7ae48c5f183  quay.io/libpod/testimage:20210610  top         10 seconds ago  Paused                  foo

[root@hpe-dl380pgen8-02-vm-7 ~]# podman rm -f foo
e7ae48c5f1838b10daea10ccfbd835397b36f23371c63ca6e1438df8295512fd

[root@hpe-dl380pgen8-02-vm-7 ~]# podman ps -a --filter name=foo
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES

Comment 20 errata-xmlrpc 2022-11-08 09:16:27 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-2022:7457

Comment 21 Red Hat Bugzilla 2023-09-18 04:40:08 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.