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 1387670 - "pcs resource create" produces invalid cib when the use of an invalid resource agent class is forced
Summary: "pcs resource create" produces invalid cib when the use of an invalid resourc...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
medium
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-21 13:57 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 allows to enter a resource agent name containing invalid parts and puts it into the cib. 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 resource agent name more precisely. Result: Pcs provides an error message with a clear explanation of what is wrong.
Clone Of:
Environment:
Last Closed: 2017-08-01 18:24:40 UTC
Target Upstream Version:
Embargoed:


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


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

Description Ivan Devat 2016-10-21 13:57:10 UTC
Description of problem:
"pcs resource create" allows force the use a resource agent class that is not specified in the schema. Such command produces invalid cib.


Steps to Reproduce:
[vm-rhel72-1 ~pcs] $ pcs resource create R invalid:heartbeat:Dummy --force

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

Expected results:
Error: 'invalid' is not valid resource agent class.

Comment 1 Ivan Devat 2016-10-21 14:14:28 UTC
Note that check only resource agent class is not enough. t is necessary to deal with a RA (resource agent) provider in dependency on value of RA class. The following commands produces invalid cib as well:

[vm-rhel72-1 ~pcs] $ pcs resource create R ocf:Dummy --force
[vm-rhel72-1 ~pcs] $ pcs resource create R2 lsb:heartbeat:Dummy --force

Class ocf requires provider while other class do not.

Comment 3 Ivan Devat 2017-02-01 13:35:58 UTC
Created attachment 1246649 [details]
proposed fix

Tests are in the patch.

Comment 4 Ivan Devat 2017-02-20 08:18:21 UTC
After Fix:

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

[vm-rhel72-1 ~] $ pcs resource create R invalid:Dummy
Error: Invalid resource agent name 'invalid:Dummy'. Use standard:provider:type when standard is 'ocf' or standard:type otherwise. List of standards and providers can be obtained by using commands 'pcs resource standards' and 'pcs resource providers'

[vm-rhel72-1 ~] $ pcs resource create R ocf:Dummy
Error: Invalid resource agent name 'ocf:Dummy'. Use standard:provider:type when standard is 'ocf' or standard:type otherwise. List of standards and providers can be obtained by using commands 'pcs resource standards' and 'pcs resource providers'

[vm-rhel72-1 ~] $ pcs resource create R lsb:provider:Dummy
Error: Invalid resource agent name 'lsb:provider:Dummy'. Use standard:provider:type when standard is 'ocf' or standard:type otherwise. List of standards and providers can be obtained by using commands 'pcs resource standards' and 'pcs resource providers'

Comment 8 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.