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 2019836 - pcs should validate resource/stonith agents metadata upon reading
Summary: pcs should validate resource/stonith agents metadata upon reading
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pcs
Version: 9.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: 9.0
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1384485 2018969
TreeView+ depends on / blocked
 
Reported: 2021-11-03 12:51 UTC by Tomas Jelinek
Modified: 2022-05-17 12:22 UTC (History)
8 users (show)

Fixed In Version: pcs-0.11.1-7.el9
Doc Type: Enhancement
Doc Text:
Feature: Pcs now validates resource and stonith agent metadata XML against OCF schemas. Reason: Provide better error messages when metadata do not match the schema. Result: If metadata provided by an agent do not match OCF schema, pcs provides a descriptive error message pointing to a line not complying with the schema.
Clone Of: 1384485
Environment:
Last Closed: 2022-05-17 12:19:34 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-101651 0 None None None 2021-11-03 15:17:27 UTC
Red Hat Product Errata RHBA-2022:2290 0 None None None 2022-05-17 12:19:57 UTC

Description Tomas Jelinek 2021-11-03 12:51:46 UTC
+++ This bug was initially created as a clone of Bug #1384485 +++

Pcs should validate resource, fence and fake pacemaker (stonithd, cib, crmd, pengine) agents' metadata upon reading. This is currently not possible as the metadata do not conform to the schema - see bz1384484.

--- Additional comment from Tomas Jelinek on 2021-10-07 16:31:23 CEST ---

We will use a custom RNG shipped with pcs to validate OCF 1.0 agents to work around bz1384484.

Comment 1 Tomas Jelinek 2021-11-03 14:16:56 UTC
Upstream patch: https://github.com/ClusterLabs/pcs/commit/5eb51289926d5e1e68092db5d1d177fddc31a766
It's the same patch as for bz2018969

Test:
Pcs returns an error when a resource / stonith agent provides metadata not matching to OCF 1.0 / 1.1 schemas shipped with pcs. These schemas are a bit relaxed comparing to official OCF schemas, their purpose is to make sure metadata are parsable by pcs.

Comment 3 Miroslav Lisik 2021-11-19 07:58:16 UTC
DevTestResults:

[root@r90-node-01 ~]# rpm -q pcs
pcs-0.11.1-5.el9.x86_64

Edit metadata for Dummy resource agent
'/usr/lib/ocf/resource.d/pacemaker/Dummy' in way which is not compliant with
'/usr/lib64/pcs/data/ocf-1.0.rng' or '/usr/lib64/pcs/data/ocf-1.1.rng'

Changed value of reloadable atrribute of parameter named 'passwd' from
reloadable="1" to reloadable="true".

[root@r90-node-01 ~]# crm_resource --show-metadata=ocf:pacemaker:Dummy | xmllint --xpath "//parameter[@name='passwd']/@reloadable" -
 reloadable="true"

Try to create a Dummy resource:

[root@r90-node-01 ~]# pcs resource create d-01 ocf:pacemaker:Dummy
Error: Agent 'ocf:pacemaker:Dummy' is not installed or does not provide valid metadata: Invalid attribute reloadable for element parameter, line 23, use --force to override
Error: Errors have occurred, therefore pcs is unable to continue
[root@r90-node-01 ~]# echo $?
1

Comment 9 Miroslav Lisik 2021-12-16 16:22:36 UTC
DevTestResults:

[root@r90-node-01 ~]# rpm -q pcs
pcs-0.11.1-7.el9.x86_64

[root@r90-node-01 ~]# pcs resource create not_installed ocf:pacemaker:not_installed --disabled --force
Warning: Agent 'ocf:pacemaker:not_installed' is not installed or does not provide valid metadata: crm_resource: Metadata query for ocf:pacemaker:not_installed failed: No such device or address, Error performing operation: No such object
[root@r90-node-01 ~]# pcs resource config
 Resource: not_installed (class=ocf provider=pacemaker type=not_installed)
  Meta Attrs: target-role=Stopped
  Operations: monitor interval=60s (not_installed-monitor-interval-60s)


[root@r90-node-01 ~]# pcs resource update not_installed a=b --force
Warning: Agent 'ocf:pacemaker:not_installed' is not installed or does not provide valid metadata: crm_resource: Metadata query for ocf:pacemaker:not_installed failed: No such device or address, Error performing operation: No such object
[root@r90-node-01 ~]# pcs resource config
 Resource: not_installed (class=ocf provider=pacemaker type=not_installed)
  Attributes: a=b
  Meta Attrs: target-role=Stopped
  Operations: monitor interval=60s (not_installed-monitor-interval-60s)

Resource is updated.

Comment 12 errata-xmlrpc 2022-05-17 12:19:34 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 (new packages: pcs), 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-2022:2290


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