Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-7682

XML output of crm_verify doesn't contain error messages

    • pacemaker-2.1.7-1.el9
    • rhel-sst-high-availability
    • ssg_filesystems_storage_and_HA
    • 13
    • 19
    • 3
    • QE ack, Dev ack
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • Hide
      (This does not need a release note because it is intended more for pcs than end users, but here is the equivalent information.)

      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.
      Show
      (This does not need a release note because it is intended more for pcs than end users, but here is the equivalent information.) 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.
    • All
    • All
    • 2.1.7
    • None

      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:

      1. 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:

      1. 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 <clone> 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:

      1. 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!

              rh-ee-jrehova Jana Rehova
              tojeline@redhat.com Tomas Jelinek
              Grace Chin Grace Chin (Inactive)
              Jana Rehova Jana Rehova
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: