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 2050259 - Pacemaker does not convert & to & when generating metadata for non-ocf agents
Summary: Pacemaker does not convert & to & when generating metadata for non-ocf ag...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pacemaker
Version: 9.0
Hardware: All
OS: All
medium
low
Target Milestone: rc
: 9.1
Assignee: Chris Lumens
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-03 15:04 UTC by Tomas Jelinek
Modified: 2022-11-15 10:05 UTC (History)
3 users (show)

Fixed In Version: pacemaker-2.1.3-1.el9
Doc Type: Bug Fix
Doc Text:
Cause: Pacemaker used systemd unit descriptions literally in meta-data for systemd resources. Consequence: Descriptions with special characters (such as an amperand) would fail to produce valid meta-data XML. Fix: Pacemaker now escapes characters properly in systemd resource meta-data. Result: Systemd resource meta-data is valid XML even when the systemd unit description contains special characters.
Clone Of:
Environment:
Last Closed: 2022-11-15 09:49:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CLUSTERQE-5824 0 None None None 2022-06-16 18:03:26 UTC
Red Hat Issue Tracker RHELPLAN-111006 0 None None None 2022-02-03 15:19:33 UTC
Red Hat Product Errata RHBA-2022:7937 0 None None None 2022-11-15 09:50:09 UTC

Description Tomas Jelinek 2022-02-03 15:04:31 UTC
Description of problem:
Pacemaker does not convert & to & when generating metadata for non-ocf agents. Not sure if other characters which need to be converted to XML entities are converted properly. This makes the agent metadata not valid.


Version-Release number of selected component (if applicable):
pacemaker-2.1.2-4.el9.x86_64


How reproducible:
always, easily


Steps to Reproduce:
1. curl -s https://raw.githubusercontent.com/ClusterLabs/OCF-spec/main/ra/1.1/ra-api.rng -o ocf1.1.rng
2. crm_resource --show-metadata=systemd:systemd-timedated | xmllint --noout --relaxng ocf1.1.rng -


Actual results:
-:6: parser error : xmlParseEntityRef: no name
    Time & Date Service
          ^

Expected results:
no errors

Comment 1 Chris Lumens 2022-02-11 19:05:52 UTC
Does this require a specific OS version to reproduce?  Locally, testing on RHEL 8, I'm not even getting the full description that would contain the ampersand.  Instead I'm seeing this:

(systemd_unit_metadata)         info: XXX: desc = systemd-timedated.service
(services_action_sync)  trace:  > systemd-timedated_meta-data_0: systemd-dbus = 0
(services_action_sync)  trace:  >  stdout: <?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="systemd-timedated" version="0.1">
  <version>1.1</version>
  <longdesc lang="en">
    systemd-timedated.service
  </longdesc>
  <shortdesc lang="en">systemd unit file for systemd-timedated</shortdesc>
  <parameters/>
  <actions>
    <action name="start"     timeout="100" />
    <action name="stop"      timeout="100" />
    <action name="status"    timeout="100" />
    <acti...

In other words, the description of the service is just systemd-timedated.service.

Regardless, this looks pretty easy to fix blindly.  I'd just love to be able to reproduce it first.

Comment 2 Tomas Jelinek 2022-02-14 08:57:34 UTC
(In reply to Chris Lumens from comment #1)
> Does this require a specific OS version to reproduce?  Locally, testing on RHEL 8, I'm not even getting the full description that would contain the ampersand.

This may be specific to RHEL 9. I'm getting this:

# rpm -q systemd
systemd-249-9.el9.x86_64

# crm_resource --show-metadata=systemd:systemd-timedated
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="systemd-timedated" version="0.1">
  <version>1.1</version>
  <longdesc lang="en">
    Time & Date Service
  </longdesc>
  <shortdesc lang="en">systemd unit file for systemd-timedated</shortdesc>
  <parameters/>
  <actions>
    <action name="start"     timeout="100" />
    <action name="stop"      timeout="100" />
    <action name="status"    timeout="100" />
    <action name="monitor"   timeout="100" interval="60"/>
    <action name="meta-data" timeout="5"   />
  </actions>
  <special tag="systemd"/>
</resource-agent>

Sorry for not providing this info in the initial comment.

Comment 3 Ken Gaillot 2022-02-15 20:59:58 UTC
Fixed upstream by commit 13d00a74

Comment 9 Markéta Smazová 2022-06-16 15:33:29 UTC
[root@virt-527 ~]# rpm -q pacemaker
pacemaker-2.1.3-2.el9.x86_64

[root@virt-527 ~]# crm_resource --show-metadata=systemd:systemd-timedated
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="systemd-timedated" version="0.1">
  <version>1.1</version>
  <longdesc lang="en">
    Time &amp; Date Service
  </longdesc>
  <shortdesc lang="en">systemd unit file for systemd-timedated</shortdesc>
  <parameters/>
  <actions>
    <action name="start"     timeout="100" />
    <action name="stop"      timeout="100" />
    <action name="status"    timeout="100" />
    <action name="monitor"   timeout="100" interval="60"/>
    <action name="meta-data" timeout="5"   />
  </actions>
  <special tag="systemd"/>
</resource-agent>

[root@virt-527 ~]# pcs resource describe systemd:systemd-timedated
systemd:systemd-timedated - systemd unit file for systemd-timedated

Time & Date Service

Default operations:
  start: interval=0s timeout=100
  stop: interval=0s timeout=100
  monitor: interval=60 timeout=100


verified in pacemaker-2.1.3-2.el9

Comment 11 errata-xmlrpc 2022-11-15 09:49:38 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:7937


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