Bug 1998454

Summary: nginx resource can't be created
Product: Red Hat Enterprise Linux 8 Reporter: Michal Mazourek <mmazoure>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 8.5CC: cfeist, cluster-maint, idevat, kmalyjur, mlisik, mpospisi, nwahl, omular, sbradley, tojeline
Target Milestone: rcKeywords: Regression, Triaged
Target Release: 8.5Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.10-2.el8 Doc Type: No Doc Update
Doc Text:
The bugged packages were never released, therefore no doc text is needed.
Story Points: ---
Clone Of:
: 2023752 (view as bug list) Environment:
Last Closed: 2021-11-09 17:34:53 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:
Bug Depends On:    
Bug Blocks: 2023752    
Deadline: 2021-08-24   
Attachments:
Description Flags
proposed fix none

Description Michal Mazourek 2021-08-27 09:21:44 UTC
Description of problem:
While creating nginx resource, a cib is dumped with error message:
Error: Unable to update cib
Call cib_apply_diff failed (-203): Update does not conform to the configured schema 


Version-Release number of selected component (if applicable):
pcs-0.10.10-1.el8


How reproducible:
always


Steps to Reproduce:
pcs resource create nginx ocf:heartbeat:nginx


Actual results:
error + cib dump


Expected results:
resource is created


Additional info:

Comment 1 Reid Wahl 2021-08-27 09:50:26 UTC
Looks like the addition of a depth attribute to the <op> element in the CIB diff causes a schema violation. E.g.,

          <op depth="10" id="nginx-monitor-interval-30s" interval="30s" name="monitor" timeout="30s">
            <instance_attributes id="nginx-monitor-interval-30s-instance_attributes">
              <nvpair id="nginx-monitor-interval-30s-instance_attributes-OCF_CHECK_LEVEL" name="OCF_CHECK_LEVEL" value="10"/>
            </instance_attributes>
          </op>


pcs-0.10.8-1's diff looks like this for the same op:

        <op id="nginx-monitor-interval-30s" interval="30s" name="monitor" timeout="30s">
          <instance_attributes id="nginx-monitor-interval-30s-instance_attributes">
            <nvpair id="nginx-monitor-interval-30s-instance_attributes-OCF_CHECK_LEVEL" name="OCF_CHECK_LEVEL" value="10"/>
          </instance_attributes>
        </op>

If I remove depth from the diff on 0.10.10-1, the cib_apply_diff works fine.

Comment 2 Reid Wahl 2021-08-27 10:00:06 UTC
I think this might fix it? In Agent.get_actions():

Before:
                        dc_replace(action, OCF_CHECK_LEVEL=action.depth)

After:
                        dc_replace(action, depth=None, OCF_CHECK_LEVEL=action.depth)

Comment 3 Reid Wahl 2021-08-27 10:02:46 UTC
Never mind :) saw https://github.com/ClusterLabs/pcs/pull/366

Comment 4 Tomas Jelinek 2021-08-27 10:02:59 UTC
Created attachment 1818301 [details]
proposed fix

See comment 0 for a test.

Comment 5 Miroslav Lisik 2021-08-27 16:07:51 UTC
DevTestResults:

[root@r8-node-01 ~]# rpm -q pcs
pcs-0.10.10-2.el8.x86_64

[root@r8-node-01 ~]# pcs resource create nginx ocf:heartbeat:nginx
Warning: changing a monitor operation interval from 60s to 61 to make the operation unique
[root@r8-node-01 ~]# echo $?
0

Comment 9 Michal Mazourek 2021-08-30 12:03:32 UTC
BEFORE:
=======

[root@virt-132 ~]# rpm -q pcs
pcs-0.10.10-1.el8.x86_64

[root@virt-132 ~]# pcs resource create nginx ocf:heartbeat:nginx
Warning: changing a monitor operation interval from 60s to 61 to make the operation unique
Error: Unable to update cib
Call cib_apply_diff failed (-203): Update does not conform to the configured schema
{cib output}
[root@virt-132 ~]# echo $?
1


AFTER:
======

[root@virt-024 ~]# rpm -q pcs
pcs-0.10.10-2.el8.x86_64

[root@virt-024 ~]# pcs resource create nginx ocf:heartbeat:nginx
Warning: changing a monitor operation interval from 60s to 61 to make the operation unique
[root@virt-024 ~]# echo $? 
0
[root@virt-024 ~]# pcs resource
  * nginx	(ocf::heartbeat:nginx):	 Stopped

> OK


Regression tests will be conducted as part of bz1935594. Marking as Verified in pcs-0.10.10-2.el8

Comment 11 errata-xmlrpc 2021-11-09 17:34:53 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 (Low: pcs 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-2021:4142