Bug 1382004 - "resource create" produces invalid cib when group id is already occupied with non-resource element
Summary: "resource create" produces invalid cib when group id is already occupied with...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: ---
Assignee: Ivan Devat
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-05 13:50 UTC by Ivan Devat
Modified: 2017-08-01 18:24 UTC (History)
6 users (show)

Fixed In Version: pcs-0.9.156-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: Pcs validate insufficiently whether is an entered id of a group available (during the run of "pcs resource create"). Consequence: Pcs produces invalid cib and ends with an error message. From such error message it is difficult to identify the cause. Fix: Pcs validate the entered id of group more precisely. Result: Pcs provides an error message with a clear explanation of what is wrong.
Clone Of:
: 1447349 (view as bug list)
Environment:
Last Closed: 2017-08-01 18:24:40 UTC
Target Upstream Version:


Attachments (Terms of Use)
proposed fix (4.04 KB, patch)
2017-02-01 13:57 UTC, Ivan Devat
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1958 normal SHIPPED_LIVE pcs bug fix and enhancement update 2017-08-01 18:09:47 UTC

Description Ivan Devat 2016-10-05 13:50:02 UTC
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...

Comment 2 Ivan Devat 2017-02-01 13:57:08 UTC
Created attachment 1246654 [details]
proposed fix

Tests are in the patch.

Comment 3 Ivan Devat 2017-02-20 07:59:47 UTC
After Fix:

[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.156-1.el7.x86_64

[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"/>

[vm-rhel72-1 ~] $ pcs resource create dummy ocf:heartbeat:Dummy --group cib-bootstrap-options-cluster-name
Error: 'cib-bootstrap-options-cluster-name' is not a group

Comment 7 errata-xmlrpc 2017-08-01 18:24: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/RHBA-2017:1958


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