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.

Bug 1980735

Summary: podman resource agent fails probe operations when a container is not running
Product: Red Hat Enterprise Linux 8 Reporter: Damien Ciabrini <dciabrin>
Component: resource-agentsAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED DUPLICATE QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.4CC: agk, cluster-maint, fdinitto
Target Milestone: betaFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-09 12:47:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Damien Ciabrini 2021-07-09 12:09:05 UTC
Description of problem:
A bundle resource depends on the podman resource agent to start and monitor its associated podman container.

After an unexpected reboot of a pacemaker node, pacemaker will probe the state of the resource if was previously hosting on the node.

Internally, the probe operation performs a "podman exec", which returns an error because no container has been restarted after the reboot. This error is not trapped properly by the podman resource agent, which fails the monitoring action:

  * galera-bundle-podman-2_monitor_0 on rhel3 'error' (1): call=15, status='complete', exitreason='monitor cmd failed (rc=255), output: Error: can only create exec sessions on running containers:
container state improper', last-rc-change='2021-07-09 12:38:27 +01:00', queued=0ms, exec=224ms


Pacemaker recovers automatically from this error, but the error is still logged in the CIB, which is confusing and unnecessary. 


Version-Release number of selected component (if applicable):
pacemaker-2.0.5-9.el8.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create a containerized resource in a cluster. E.g., a galera cluster:
pcs resource bundle create galera-bundle container podman image=rhos-qe-mirror-rdu2.usersys.redhat.com:5002/rh-osbs/rhosp16-openstack-mariadb:16.2_20210309.1 network=host options="--user=root --log-driver=journald" replicas=3 masters=3 run-command="/usr/sbin/pacemaker_remoted" network control-port=3123 storage-map id=map0 source-dir=/dev/log target-dir=/dev/log storage-map
id=map1 source-dir=/dev/zero target-dir=/etc/libqb/force-filesystem-sockets options=ro storage-map id=map2 source-dir=/etc/hosts target-dir=/etc/hosts options=ro storage-map id=map3 source-dir=/etc/localtime target-dir=/etc/localtime options=ro storage-map id=map4 source-dir=/etc/my.cnf.d target-dir=/etc/my.cnf.d options=ro storage-map id=map5 source-dir=/var/lib/mysql target-dir=/var/lib/mysql options=rw storage-map id=map6 source-dir=/var/log/mysql target-dir=/var/log/mysql options=rw storage-map id=pcmk1 source-dir=/var/log/pacemaker target-dir=/var/log/pacemaker options=rw --disabled

pcs resource create galera ocf:heartbeat:galera wsrep_cluster_address='gcomm://rhel1,rhel2,rhel3'  log=/var/log/mysql/mysqld.log op promote timeout=60 on-fail=block meta container-attribute-target=host notify=true bundle galera-bundle

pcs resource enable galera-bundle

2. Crash one node to force a reboot

[root@rhel3 ~]# echo c > /proc/sysrq-trigger
Shared connection to 192.168.222.156 closed.


Actual results:
Once the node rejoins the cluster, an monitoring error is logged in the CIB
Failed Resource Actions:
  * galera-bundle-podman-2_monitor_0 on rhel3 'error' (1): call=15, status='complete', exitreason='monitor cmd failed (rc=255), output: Error: can only create exec sessions on running containers: container state improper', last-rc-change='2021-07-09 12:38:27 +01:00', queued=0ms, exec=224ms


Expected results:
the podman resource agent handle the podman exit code and return the correct OCF status. 

Additional info:

Comment 1 Damien Ciabrini 2021-07-09 12:47:40 UTC

*** This bug has been marked as a duplicate of bug 1920698 ***