Bug 1212205

Summary: Pacemaker CIB - Jing error: conflicting ID-types for attribute "id"
Product: [openSUSE] PUBLIC SUSE Linux Enterprise High Availability Extension 15 SP5 Reporter: Georg Pfuetzenreuter <georg.pfuetzenreuter>
Component: PacemakerAssignee: SUSE Linux Enterprise High Availability Team <ha-bugs>
Status: NEW --- QA Contact:
Severity: Normal    
Priority: P5 - None CC: ygao
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Georg Pfuetzenreuter 2023-06-11 19:36:50 UTC
Hi,

I'm trying to validate a basic CIB XML file using RELAX NG, however Jing complains, even if I use a CIB dump from crm:

```
# crm configure show xml > /tmp/cib.xml

# cat /tmp/cib.xml
<?xml version="1.0" ?>
<cib crm_feature_set="3.11.0" validate-with="pacemaker-3.7" epoch="30" num_updates="2" admin_epoch="0" cib-last-written="Sun Jun 11 19:25:14 2023" update-origin="scullery-minion1" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="2">
  <configuration>
    <crm_config>
      <cluster_property_set id="cib-bootstrap-options">
        <nvpair name="stonith-enabled" value="false" id="cib-bootstrap-options-stonith-enabled"/>
      </cluster_property_set>
    </crm_config>
    <nodes>
      <node id="1" uname="scullery-minion0">
        <utilization id="nodes-1-utilization">
          <nvpair id="nodes-1-utilization-cpu" name="cpu" value="0"/>
          <nvpair id="nodes-1-utilization-host_memory" name="host_memory" value="450"/>
          <nvpair id="nodes-1-utilization-hv_memory" name="hv_memory" value="0"/>
        </utilization>
      </node>
      <node id="2" uname="scullery-minion1">
        <utilization id="nodes-2-utilization">
          <nvpair id="nodes-2-utilization-cpu" name="cpu" value="0"/>
          <nvpair id="nodes-2-utilization-host_memory" name="host_memory" value="450"/>
          <nvpair id="nodes-2-utilization-hv_memory" name="hv_memory" value="0"/>
        </utilization>
      </node>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
</cib>

# jing /usr/share/pacemaker/pacemaker-2.1.rng /tmp/cib.xml
/usr/share/pacemaker/status-1.0.rng:15:18: error: conflicting ID-types for attribute "id" of element "tag"
```

The error is similar, though not always the same, if using other pacemaker-<version>.rng files:

```
# jing /usr/share/pacemaker/pacemaker-3.2.rng /tmp/cib.xml
/usr/share/pacemaker/status-1.0.rng:15:18: error: conflicting ID-types for attribute "id" of element "tag"

# jing /usr/share/pacemaker/pacemaker-3.1.rng /tmp/cib.xml
/usr/share/pacemaker/status-1.0.rng:15:18: error: conflicting ID-types for attribute "id" of element "tag"

# jing /usr/share/pacemaker/pacemaker-1.0.rng /tmp/cib.xml
/usr/share/pacemaker/status-1.0.rng:15:18: error: conflicting ID-types for attribute "id" of element "group"
```

Any ideas? I assume that my input file is valid, as it is read by crm with no complaints:

```
# crm configure load xml update /tmp/cib.xml
#
```
Comment 1 Georg Pfuetzenreuter 2023-06-11 19:38:44 UTC
Forgot the obligatory version details:

```
# rpm -qf /usr/share/pacemaker/pacemaker-1.2.rng
pacemaker-cli-2.1.2+20211124.ada5c3b36-150400.4.9.2.x86_64

# zypper se -iv pacemaker
Loading repository data...
Reading installed packages...

S  | Name          | Type    | Version                               | Arch   | Repository
---+---------------+---------+---------------------------------------+--------+-------------------------------------------------------------
i  | libpacemaker3 | package | 2.1.2+20211124.ada5c3b36-150400.4.9.2 | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: libpacemaker3
i+ | pacemaker     | package | 2.1.2+20211124.ada5c3b36-150400.4.9.2 | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: pacemaker
i  | pacemaker-cli | package | 2.1.2+20211124.ada5c3b36-150400.4.9.2 | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
    name: pacemaker-cli

# zypper se -iv jing
Loading repository data...
Reading installed packages...

S  | Name | Type    | Version                | Arch   | Repository
---+------+---------+------------------------+--------+-------------------------------------------------------------
i+ | jing | package | 20181222-150200.10.4.4 | noarch | Update repository with updates from SUSE Linux Enterprise 15
    name: jing
```
Comment 2 Yan Gao 2023-06-13 14:23:36 UTC
I don't quite understand the constraints that jing by default enforces regarding IDs, but it seems to pass with "-i" option:

jing -i /usr/share/pacemaker/pacemaker-2.1.rng /tmp/cib.xml

BTW, it validates with xmllint by default:

xmllint --relaxng /usr/share/pacemaker/pacemaker-2.1.rng /tmp/cib.xml
Comment 3 Georg Pfuetzenreuter 2023-06-14 13:36:14 UTC
Thank you very much - I'll use one of your suggested variants.