Bug 1284393 - RELAX NG validation error when job XML has <hostRequires/> with force="" attribute and child elements
RELAX NG validation error when job XML has <hostRequires/> with force="" attr...
Product: Beaker
Classification: Community
Component: scheduler (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: beaker-dev-list
Depends On:
  Show dependency treegraph
Reported: 2015-11-23 03:48 EST by Jan Stancek
Modified: 2015-11-23 23:26 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-23 23:26:36 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Stancek 2015-11-23 03:48:58 EST
Description of problem:
When I clone recipe with following hostrequires:

<hostRequires force="dell-per820-02.khw.lab.eng.bos.redhat.com">
    <arch op="=" value="x86_64"/>
    <cpu_count op="&gt;" value="1"/>
    <hypervisor op="=" value=""/>
  <system_type value="Machine"/>

Beaker complains with this error message:

Job failed schema validation. Please confirm that you want to submit it.
    Line 21, col 0: Invalid attribute force for element hostRequires
    Line 6, col 0: Invalid sequence in interleave
    Line 6, col 0: Element recipe failed to validate content
    Line 5, col 0: Element recipeSet failed to validate content

but according to beaker-job.rng "force" attribute should be allowed:
      <element name="hostRequires">
        <a:documentation xml:lang="en">
          This element is a container for expressing constraints on the
          system which will be selected to run this recipe.
          <attribute name="force">
            <data type="string"/>
            <a:documentation xml:lang="en">
            Select a specific system by FQDN. This bypasses the
            normal filtering mechanisms for selecting a system,
            and always uses the named system regardless of its
            current condition. No other filter criteria can be
            specified when this attribute is used.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. try to clone recipe with hostrequires that has "force" attribute

Actual results:
Beaker validation error

Expected results:
clone should work without errors

Additional info:
Comment 1 Dan Callaghan 2015-11-23 23:24:53 EST
The RELAX NG schema is written to only allow normal <hostRequires>...</hostRequires> *or* <hostRequires force=""/> with no child elements.

So what it's trying to warn you about here is the fact that you have <hostRequires force="">...</hostRequires> with both force="" attribute *and* child elements. The child elements have no effect when force="" is given.

The fact that the RELAX NG validation error is completely inscrutable and gives no hint about the real error, is an old known issue: bug 689338. We can't easily fix that because it comes from libxml2.
Comment 2 Dan Callaghan 2015-11-23 23:26:36 EST
I guess this is either NOTABUG or dupe of 689338 depending on your point of view.

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