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 2027370 - Resource ocf:pacemaker:Stateful does not comply with the ocf 1.1 standard
Summary: Resource ocf:pacemaker:Stateful does not comply with the ocf 1.1 standard
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pacemaker
Version: 8.5
Hardware: All
OS: All
high
low
Target Milestone: rc
: 8.6
Assignee: Ken Gaillot
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 2032032
TreeView+ depends on / blocked
 
Reported: 2021-11-29 13:40 UTC by Miroslav Lisik
Modified: 2022-06-07 17:41 UTC (History)
3 users (show)

Fixed In Version: pacemaker-2.1.2-3.el8
Doc Type: No Doc Update
Doc Text:
This will be invisible to end users
Clone Of:
: 2032032 (view as bug list)
Environment:
Last Closed: 2022-05-10 14:10:03 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-104157 0 None None None 2021-11-29 13:41:43 UTC
Red Hat Product Errata RHBA-2022:1885 0 None None None 2022-05-10 14:10:10 UTC

Description Miroslav Lisik 2021-11-29 13:40:02 UTC
Description of problem:
Resource ocf:pacemaker:Stateful does not comply with the ocf 1.1 standard

Version-Release number of selected component (if applicable):
pacemaker-cli-2.1.0-11.el9.x86_64

How reproducible:
always

Steps to Reproduce:

# wget https://raw.githubusercontent.com/ClusterLabs/OCF-spec/master/ra/1.1/ra-api.rng -O ocf1.1.rng

# crm_resource --show-metadata=ocf:pacemaker:Stateful | xmllint --relaxng ocf1.1.rng - > /dev/null
-:2: warning: failed to load external entity "ra-api-1.dtd"
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
                                               ^
-:21: element parameter: Relax-NG validity error : Invalid attribute reloadable for element parameter
-:29: element parameter: Relax-NG validity error : Invalid attribute reloadable for element parameter
- fails to validate

# crm_resource --show-metadata=ocf:pacemaker:Stateful | xmllint --xpath //@reloadable -
 reloadable="true"
 reloadable="true"

Actual results:
Resource metadata fails to validate with the rng scheme of the ocf 1.1 standard.

Expected results:
Resource metadata validate with the rng scheme of the ocf 1.1 standard.


Additional info:

Comment 1 Ken Gaillot 2021-11-29 16:37:27 UTC
Thanks for the report! The issue is that the standard's RNG only allows "0" or "1" for boolean parameters, but Stateful sets reloadable to "true".

As an aside, the warning about DOCTYPE is an issue with nearly all existing resource agents. The standard switched from DTD to RNG as of OCF 1.1, but the agents still output a DOCTYPE referencing the DTD. Unfortunately, there is no DOCTYPE syntax for RNG, so we should probably just drop the DOCTYPE (which is optional, and xmllint doesn't complain when it's gone).

This is an issue in RHEL 8 as well, and for ease of tracking, I'm filing this against RHEL 8.6. The fix should get into RHEL 9.0 as well via the rebase bz.

Comment 2 Tomas Jelinek 2021-11-29 16:59:25 UTC
The DOCTYPE is not an issue for pcs.

What we are after is "true" / "false" instead of "1" / "0". Pcs requires OCF 1.1 agents to comply with the RNG and errors out if that is not the case. That simplifies the OCF parser, as we don't need to care about yes/no, true/false, on/off or recovery when non-optional elements / attributes are missing.

(Pcs actually checks OCF 1.0 agents as well and validates both 1.0 and 1.1 against bundled RNG schemas, which are a bit relaxed compared to official standard ones. This allows custom order of elements, attributes "automatic" and "on_target" used by fence agents, etc.)

Comment 4 Ken Gaillot 2021-12-06 17:19:32 UTC
Fixed upstream by commit 70f46912

Comment 8 Markéta Smazová 2022-02-01 17:36:54 UTC
before fix
-----------

see the bug Description (bug2027370#c0)


after fix
----------

[root@virt-556 ~]# rpm -q pacemaker
pacemaker-2.1.2-3.el8.x86_64
[root@virt-557 ~]# rpm -q pacemaker-cli
pacemaker-cli-2.1.2-3.el8.x86_64

[root@virt-557 ~]# curl -s https://raw.githubusercontent.com/ClusterLabs/OCF-spec/main/ra/1.1/ra-api.rng -o ocf1.1.rng

[root@virt-557 ~]# crm_resource --show-metadata=ocf:pacemaker:Stateful | xmllint --noout --relaxng ocf1.1.rng -
- validates

marking verified in pacemaker-2.1.2-3.el8

Comment 10 errata-xmlrpc 2022-05-10 14:10:03 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 (pacemaker 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/RHBA-2022:1885


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