This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2136477 - XML output of crm_verify doesn't contain error messages
Summary: XML output of crm_verify doesn't contain error messages
Keywords:
Status: CLOSED MIGRATED
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.4
Assignee: gchin
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks: 2136483
TreeView+ depends on / blocked
 
Reported: 2022-10-20 11:41 UTC by Tomas Jelinek
Modified: 2023-09-22 19:51 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: crm_verify's XML output now includes any schema validation errors. Reason: The previous output, which contained only the final valid or invalid status, did not give enough detail to be usable. Result: Scripts that parse crm_verify's XML output can now use any schema validation error messages.
Clone Of:
Environment:
Last Closed: 2023-09-22 19:51:05 UTC
Type: Story
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-7682 0 None Migrated None 2023-09-22 19:51:02 UTC
Red Hat Issue Tracker RHELPLAN-137151 0 None None None 2022-10-20 12:04:35 UTC

Description Tomas Jelinek 2022-10-20 11:41:22 UTC
Description of problem:
XML output of crm_verify doesn't contain error messages, they only go to stderr as a plaintext. This makes the XML output pretty much useless.


Version-Release number of selected component (if applicable):
pacemaker-2.1.4-5.el9


How reproducible:
always, easily


Steps to Reproduce:
1. create an invalid configuration, e.g. pcs resource create test1 systemd:chronyd promotable
2. run crm_verify output-as=xml


Actual results:
# crm_verify --live-check --output-as=xml -VV
(native_unpack)         error: Resource test1:0 is of type systemd and therefore cannot be used as a promotable clone resource
(pe__create_clone_child)        error: Failed unpacking resource test1
(unpack_resources)      error: Ignoring <clone> resource 'test1-clone' because configuration is invalid
crm_verify: Errors found during check: config not valid
<pacemaker-result api-version="2.22" request="crm_verify --live-check --output-as=xml -VV">
  <status code="78" message="Invalid configuration"/>
</pacemaker-result>


Expected results:
# crm_verify --live-check --output-as=xml
<pacemaker-result api-version="2.22" request="crm_verify --live-check --output-as=xml">
  <status code="78" message="Invalid configuration"/>
  <messages>
    <message severity="error" code="native_unpack">
      Resource test1:0 is of type systemd and therefore cannot be used as a promotable clone resource
    </message>
    <message severity="error" code="pe__create_clone_child">
      Failed unpacking resource test1
    </message>
    <message severity="error" code="unpack_resources">
      Ignoring &lt;clone&gt; resource 'test1-clone' because configuration is invalid
    </message>
  </messages>
</pacemaker-result>

Names of the tags and attributes are not as important as the structure: separate code, severity and message text.
Also, since XML is easy to parse and filter, consider including errors and warnings by default. For plaintext output, crm_verify requires -V to be specified to print them.

Please, avoid splitting one item over several lines / messages like in the following example:
# crm_verify --live-check --output-as=xml -VV
(unpack_resources)      error: Resource start-up disabled since no STONITH resources have been defined
(unpack_resources)      error: Either configure some or disable STONITH with the stonith-enabled option
(unpack_resources)      error: NOTE: Clusters with shared data need STONITH to ensure data integrity
crm_verify: Errors found during check: config not valid


Additional info:
We are planning to run crm_verify from 'pcs status' command and include errors and warnings in the output. This will allow us to provide more error messages which will be more accurate than what pcs provides now with its clunky checks. We are also considering running crm_verify whenever a user makes any changes to CIB. Let us know if these are bad ideas. We'd also appreciate info about corner-cases we may hit, if you know any. Thanks!

Comment 2 RHEL Program Management 2023-09-22 19:49:21 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 3 RHEL Program Management 2023-09-22 19:51:05 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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