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 1668223 - "resource group add" produces invalid cib when group id is already occupied with non-resource element
Summary: "resource group add" produces invalid cib when group id is already occupied w...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: 8.1
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On: 1682129
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-22 08:50 UTC by Tomas Jelinek
Modified: 2020-11-14 12:19 UTC (History)
7 users (show)

Fixed In Version: pcs-0.10.1-6.el8
Doc Type: Bug Fix
Doc Text:
Cause: In the 'pcs resource group add' command, the user uses an id of an existing non-group element instead of a group id. Consequence: Pcs dumps an invalid cib to the terminal. Fix: Properly validate the group id in pcs. Result: Pcs exits gracefully reporting an error.
Clone Of: 1447349
Environment:
Last Closed: 2019-11-05 20:39:40 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix + tests (191.39 KB, patch)
2019-02-18 11:42 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2019:3311 0 None None None 2019-11-05 20:39:53 UTC

Description Tomas Jelinek 2019-01-22 08:50:50 UTC
+++ This bug was initially created as a clone of Bug #1447349 +++

+++ This bug was initially created as a clone of Bug #1382004 +++

Description of problem:
"pcs resource create" produces invalid cib when group id is already occupied with non-resource element.

How reproducible: always


Steps to Reproduce:
1.
> chose some non-resource element id.
[vm-rhel72-1 ~] $ pcs cluster cib | grep "id=\"cib-bootstrap-options-cluster-name\""
        <nvpair id="cib-bootstrap-options-cluster-name" name="cluster-name" value="devcluster"/>
2.
> try use it as group with "pcs resource create"
[vm-rhel72-1 ~] $ pcs resource create dummy Dummy --group cib-bootstrap-options-cluster-name

Actual results:
Error: Unable to update cib
Call cib_replace failed (-203): Update does not conform to the configured schema
<cib...

Expected results:
Error: 'cib-bootstrap-options-cluster-name' cannot be used as group name (is already used as name for another element)

Additional info:
The same problem is with "pcs resource group add" command, for example:

[vm-rhel72-1 ~] $ pcs resource | grep D1
 D1     (ocf::heartbeat:Dummy): Started vm-rhel72-3
[vm-rhel72-1 ~] $ pcs resource group add cib-bootstrap-options-cluster-name D1
Error: Unable to update cib
Call cib_replace failed (-203): Update does not conform to the configured schema
<cib...

--- Additional comment from Radek Steiger on 2017-05-02 15:37:02 CEST ---

The same bug exists in adding a resource into a group with 'pcs resource group add ...' command:


[root@host-030 ~]# pcs resource group add fence-host-031-instance_attributes-pcmk_host_check dummy2
Error: Unable to update cib
Call cib_replace failed (-203): Update does not conform to the configured schema
<cib crm_feature_set="3.0.12" validate-with="pacemaker-2.6" epoch="1095" num_updates="0" admin_epoch="0" cib-last-written="Sat Apr 29 16:48:30 2017" update-origin="host-030" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="1">
  <configuration>
    <crm_config>


[root@host-030 ~]# pcs resource group add fence-host-031-instance_attributes-pcmk_host_check dummy2 2>&1 | grep fence-host-031-instance_attributes-pcmk_host_check
          <nvpair id="fence-host-031-instance_attributes-pcmk_host_check" name="pcmk_host_check" value="static-list"/>
      <group id="fence-host-031-instance_attributes-pcmk_host_check">

Comment 1 Tomas Jelinek 2019-02-18 11:42:34 UTC
Created attachment 1535888 [details]
proposed fix + tests

Reproducer is in the last part of comment 0.

The whole 'resource group add' command has been overhauled to the new pcs architecture.

Comment 3 Ondrej Mular 2019-05-02 12:06:28 UTC
After fix:
[root@rhel81-node1 ~]# rpm -q pcs
pcs-0.10.1-6.el8.x86_64

[root@rhel81-node1 ~]# pcs resource create dummy1 Stateful
Assumed agent name 'ocf:pacemaker:Stateful' (deduced from 'Stateful')
Warning: changing a monitor operation interval from 10s to 11 to make the operation unique
[root@rhel81-node1 ~]# pcs resource create dummy2 Stateful meta key1=val1
Assumed agent name 'ocf:pacemaker:Stateful' (deduced from 'Stateful')
Warning: changing a monitor operation interval from 10s to 11 to make the operation unique
[root@rhel81-node1 ~]# pcs resource group add dummy2-meta_attributes dummy1
Error: 'dummy2-meta_attributes' is not a group
[root@rhel81-node1 ~]# echo $?
1
[root@rhel81-node1 ~]# pcs resource group add my-new-group dummy1
[root@rhel81-node1 ~]# echo $?
0

Comment 7 errata-xmlrpc 2019-11-05 20:39:40 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, 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/RHEA-2019:3311


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