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 2233218 - Containers created with --restart=always do not restart when started through a pod
Summary: Containers created with --restart=always do not restart when started through ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Deadline: 2023-08-15
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.9
Hardware: x86_64
OS: FreeBSD
unspecified
high
Target Milestone: rc
: ---
Assignee: Valentin Rothberg
QA Contact: Alex Jia
URL:
Whiteboard:
Depends On:
Blocks: 2233222
TreeView+ depends on / blocked
 
Reported: 2023-08-21 18:19 UTC by Tom Sweeney
Modified: 2024-03-14 04:26 UTC (History)
11 users (show)

Fixed In Version: podman-4.6.1-3.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2233222 (view as bug list)
Environment:
Last Closed: 2023-11-14 15:30:48 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github containers podman pull 19692 0 None Merged [v4.6.1-rhel] use container restart policy if user specifies one 2023-08-22 10:56:26 UTC
Red Hat Issue Tracker RHELPLAN-166100 0 None None None 2023-08-21 18:22:25 UTC
Red Hat Product Errata RHSA-2023:6939 0 None None None 2023-11-14 15:30:59 UTC

Description Tom Sweeney 2023-08-21 18:19:01 UTC
Description of problem:

containers created with `--restart-always` are not restarting within a pod.

Version-Release number of selected component (if applicable): 4.6.1


Additional info: See GitHub Issue: https://github.com/containers/podman/issues/19671 for full details.

Comment 1 Tom Sweeney 2023-08-21 18:45:17 UTC
@vrothber please backport this fix to the Podman v4.6.1-rhel branch.  Once merged, please set this to post, assign to Jindrich, and set needinfo for him.

Comment 2 Valentin Rothberg 2023-08-22 07:18:47 UTC
Backport has merged: https://github.com/containers/podman/pull/19692

Assigning to Jindrich.

Comment 3 Alex Jia 2023-08-23 05:56:51 UTC
[root@kvm-02-guest03 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 9.3 Beta (Plow)

[root@kvm-02-guest03 ~]# rpm -q podman podman-tests crun systemd kernel
podman-4.6.1-3.el9.x86_64
podman-tests-4.6.1-3.el9.x86_64
crun-1.8.6-1.el9.x86_64
systemd-252-17.el9.x86_64
kernel-5.14.0-356.el9.x86_64

[root@kvm-02-guest03 ~]# cd /usr/share/podman/
[root@kvm-02-guest03 podman]# bats -t -f "podman pod create restart tests" test/system/
1..1
ok 1 podman pod create restart tests

Comment 4 Alex Jia 2023-08-23 06:26:15 UTC
[root@kvm-02-guest12 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.9 Beta (Ootpa)

[root@kvm-02-guest12 ~]# rpm -q podman podman-tests crun systemd kernel
podman-4.6.1-3.module+el8.9.0+19731+94cfa27e.x86_64
podman-tests-4.6.1-3.module+el8.9.0+19731+94cfa27e.x86_64
crun-1.8.7-1.module+el8.9.0+19731+94cfa27e.x86_64
systemd-239-77.el8.x86_64
kernel-4.18.0-511.el8.x86_64

[root@kvm-02-guest12 ~]# cd /usr/share/podman/
[root@kvm-02-guest12 podman]# grep -n "podman pod create restart tests" test/system/200-pod.bats
[root@kvm-02-guest12 podman]#

NOTE: the 'podman pod create restart tests' case is not included by
podman-tests-4.6.1-3.module+el8.9.0+19731+94cfa27e rpm package.

And added the following testing into test/system/200-pod.bats manually then test it.

<slice>
@test "podman pod create restart tests" {
    podname=pod$(random_string)

    run_podman pod create --restart=on-failure --name $podname
    run_podman create --name test-ctr --pod $podname $IMAGE
    run_podman container inspect --format '{{ .HostConfig.RestartPolicy.Name }}' test-ctr
    is "$output" "on-failure" "container inherits from pod"

    run_podman create --replace --restart=always --name test-ctr --pod $podname $IMAGE
    run_podman container inspect --format '{{ .HostConfig.RestartPolicy.Name }}' test-ctr
    is "$output" "always" "container overrides restart policy from pod"

    run_podman pod rm -f -a
}
</slice>

[root@kvm-02-guest12 podman]# bats -t -f "podman pod create restart tests" test/system/
1..1
not ok 1 podman pod create restart tests
# (from function `is' in file test/system/helpers.bash, line 866,
#  in test file test/system/200-pod.bats, line 687)
#   `is "$output" "always" "container overrides restart policy from pod"' failed
# [02:19:37.149952774] # podman rm -t 0 --all --force --ignore
# [02:19:37.255416505] # podman ps --all --external --format {{.ID}} {{.Names}}
# [02:19:37.310543288] # podman images --all --format {{.Repository}}:{{.Tag}} {{.ID}}
# [02:19:37.355657569] # podman image exists quay.io/libpod/testimage:20221018
# [02:19:37.395975899] [ rc=1 ]
# # skopeo copy --preserve-digests docker://quay.io/libpod/testimage:20221018 oci-archive:/tmp/podman-systest-imagecache-0/quay.io--libpod--testimage--20221018.tar
# Getting image source signatures
# Copying blob sha256:578f06cc66c59303d36e0c83b8c7fd9b2da35cca97118700cb4a373677c01dca
# Copying blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
# Copying config sha256:f5a99120db6452661930a1db3bf7390eec9b963f5f62c068fa32dc1d550afad3
# Writing manifest to image destination
# # skopeo copy --all oci-archive:/tmp/podman-systest-imagecache-0/quay.io--libpod--testimage--20221018.tar containers-storage:quay.io/libpod/testimage:20221018
# time="2023-08-23T02:19:38-04:00" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
# Getting image source signatures
# Copying blob sha256:578f06cc66c59303d36e0c83b8c7fd9b2da35cca97118700cb4a373677c01dca
# Copying blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
# Copying config sha256:f5a99120db6452661930a1db3bf7390eec9b963f5f62c068fa32dc1d550afad3
# Writing manifest to image destination
# [02:19:38.605983954] # podman pod create --restart=on-failure --name podZjUV4pXHJG
# [02:19:38.903269323] a3c018df60ce39aae33552f4eb4d0ec3f9027a0c7df682f12edefae90648781d
# [02:19:38.911291383] # podman create --name test-ctr --pod podZjUV4pXHJG quay.io/libpod/testimage:20221018
# [02:19:38.991538534] 996d18b9b15637457b94aa8db85a3326f0587feca8dd8575df1888e26eab126f
# [02:19:39.000063862] # podman container inspect --format {{ .HostConfig.RestartPolicy.Name }} test-ctr
# [02:19:39.055852158] on-failure
# [02:19:39.067963546] # podman create --replace --restart=always --name test-ctr --pod podZjUV4pXHJG quay.io/libpod/testimage:20221018
# [02:19:39.148287490] test-ctr
# f1044b6f604f648ea325a45633cd232900a0271e39ba877f008cbf3cb183bdfe
# [02:19:39.155951951] # podman container inspect --format {{ .HostConfig.RestartPolicy.Name }} test-ctr
# [02:19:39.205315713] on-failure
# #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# #|     FAIL: container overrides restart policy from pod
# #| expected: 'always'
# #|   actual: 'on-failure'
# #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# [02:19:39.221327849] # podman pod rm -f -t 0 -a
# [02:19:39.301889622] a3c018df60ce39aae33552f4eb4d0ec3f9027a0c7df682f12edefae90648781d
# [02:19:39.304074222] # podman rm -f -t 0 -a
# [02:19:39.384389064] # podman rmi --ignore localhost/podman-pause:4.6.1-1692718337
# [02:19:39.425514179] Untagged: localhost/podman-pause:4.6.1-1692718337
# Deleted: 5b5278f021d484ee9bd10d557a0356de40d3797ee20c0c3ae4023babf3a33ff8
# # [teardown]
# [02:19:39.427578803] # podman pod rm -t 0 --all --force --ignore
# [02:19:39.460059191] # podman rm -t 0 --all --force --ignore
# [02:19:39.492537624] # podman network prune --force
# [02:19:39.527637621] # podman volume rm -a -f

Comment 6 Alex Jia 2023-08-23 08:31:51 UTC
This bug has not been verified on podman-4.6.1-3.module+el8.9.0+19731+94cfa27e.

[root@kvm-02-guest12 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.9 Beta (Ootpa)

[root@kvm-02-guest12 ~]# rpm -q podman runc systemd kernel
podman-4.6.1-3.module+el8.9.0+19731+94cfa27e.x86_64
runc-1.1.9-1.module+el8.9.0+19648+0d5ae0ec.x86_64
systemd-239-77.el8.x86_64
kernel-4.18.0-511.el8.x86_64

[root@kvm-02-guest12 ~]# podman pod create --name test-pod
3cd593b1c7e68b5c6bd95ed49f2ef7a4c10f7470fd43bc57c1fc3cf3d41bda8d
[root@kvm-02-guest12 ~]# podman pod ps
POD ID        NAME        STATUS      CREATED        INFRA ID      # OF CONTAINERS
3cd593b1c7e6  test-pod    Created     4 seconds ago  5b1a5018f151  1
[root@kvm-02-guest12 ~]# podman create --restart=always --pod test-pod docker.io/bash exit 0
Trying to pull docker.io/library/bash:latest...
Getting image source signatures
Copying blob 5f1191cc3d45 done
Copying blob 7264a8db6415 done
Copying blob 735bc6fd85d9 done
Copying config 3c04497fad done
Writing manifest to image destination
07aa652510c96673256cf6fac4d5faaaae00c8cc1e10565de3f9aa6f146ea236
[root@kvm-02-guest12 ~]# podman pod ps
POD ID        NAME        STATUS      CREATED         INFRA ID      # OF CONTAINERS
3cd593b1c7e6  test-pod    Created     24 seconds ago  5b1a5018f151  2
[root@kvm-02-guest12 ~]# podman pod start test-pod
3cd593b1c7e68b5c6bd95ed49f2ef7a4c10f7470fd43bc57c1fc3cf3d41bda8d
[root@kvm-02-guest12 ~]# podman pod ps
POD ID        NAME        STATUS      CREATED         INFRA ID      # OF CONTAINERS
3cd593b1c7e6  test-pod    Degraded    42 seconds ago  5b1a5018f151  2
[root@kvm-02-guest12 ~]# podman ps -a
CONTAINER ID  IMAGE                                    COMMAND     CREATED         STATUS                       PORTS       NAMES
5b1a5018f151  localhost/podman-pause:4.6.1-1692718337              54 seconds ago  Up 14 seconds                            3cd593b1c7e6-infra
07aa652510c9  docker.io/library/bash:latest            exit 0      32 seconds ago  Exited (127) 14 seconds ago              ecstatic_banzai

Comment 10 Alex Jia 2023-08-23 11:20:44 UTC
This bug has not been verified on newest podman-4.6.1-3.module+el8.9.0+19731+94cfa27e,
for details, please see Comment 6.

Comment 16 Alex Jia 2023-08-26 02:43:34 UTC
This bug has been verified on podman-4.6.1-4.module+el8.9.0+19761+326da906.

Comment 17 Alex Jia 2023-08-29 03:50:48 UTC
Closing this bug as Verified state per Comment 16.

Comment 19 errata-xmlrpc 2023-11-14 15:30:48 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 and bug fix 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:6939

Comment 20 Red Hat Bugzilla 2024-03-14 04:26:07 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.