Bug 1069522 - [REST-API] XSD schema validation error: response for create vm returned with 'type' and 'data' fields instead of with one of these fields
Summary: [REST-API] XSD schema validation error: response for create vm returned with ...
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-api
Version: 3.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 3.4.0
Assignee: Juan Hernández
QA Contact: Ilia Meerovich
Whiteboard: infra
Depends On:
Blocks: 1024889
TreeView+ depends on / blocked
Reported: 2014-02-25 08:10 UTC by Ilanit Stein
Modified: 2016-07-05 00:07 UTC (History)
10 users (show)

Fixed In Version: ovirt-3.4.0-rc
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-03-31 12:30:19 UTC
oVirt Team: ---

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
oVirt gerrit 25066 0 None MERGED restapi: Allow both "type" and "data" Never
oVirt gerrit 25076 0 None MERGED restapi: Allow both "type" and "data" Never

Description Ilanit Stein 2014-02-25 08:10:43 UTC
Description of problem:

We have this QE test failing on Check_xsd_schema_validations: 

kianku's findings: Problem is that VM object is built with both 'type' & 'data' parameters, as follows,
while only one of them should be chosen:
            <data>&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;ovf:Envelop

From api.xsd:

  <xs:element name="configuration" type="Configuration"/>
  <xs:complexType name="Configuration">
            <xs:element name="type" type="xs:string" minOccurs="0" maxOccurs="1"/>
            <xs:element name="data" type="xs:string" minOccurs="0" maxOccurs="1"/>

Version-Release number of selected component (if applicable):
This bug didn't exist on: 
but I can't tell the exact point of time it was introduced.

How reproducible:
100% (On this test)

Comment 1 Ilia Meerovich 2014-02-26 09:50:47 UTC
This failure happens also in regression mixed test that is QE/CI tier 0.
Raising priority to urgent

Comment 2 Juan Hernández 2014-02-26 10:54:09 UTC
Note that this change in the schema was done in 3.3.0, so it should happen there as well.

Comment 3 Juan Hernández 2014-02-26 10:54:48 UTC
The solution is to change the schema so that the presence of both "type" and "data" is allowed, as both are needed.

Comment 4 Ilia Meerovich 2014-02-26 11:42:18 UTC

I rechecked 3.3.1 (rhevm-3.3.1-0.48.el6ev.noarch) regression mixed job (create vm part) and it seems that this change doesn't appear there, maybe this change was only in ovirt and not cherry-picked to rhevm?:

2014-02-25 21:44:13,732 - MainThread - vms - DEBUG - Response body for CREATE request is: 
<vm href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a" id="6c4d770e-7b39-4b8e-896c-67be97a8097a">
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/ticket" rel="ticket"/>
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/cancelmigration" rel="cancelmigration"/>
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/migrate" rel="migrate"/>
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/move" rel="move"/>
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/detach" rel="detach"/>
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/export" rel="export"/>
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/shutdown" rel="shutdown"/>
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/start" rel="start"/>
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/stop" rel="stop"/>
        <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/suspend" rel="suspend"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/applications" rel="applications"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/disks" rel="disks"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/nics" rel="nics"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/cdroms" rel="cdroms"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/snapshots" rel="snapshots"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/tags" rel="tags"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/permissions" rel="permissions"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/statistics" rel="statistics"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/reporteddevices" rel="reporteddevices"/>
    <link href="/api/vms/6c4d770e-7b39-4b8e-896c-67be97a8097a/watchdogs" rel="watchdogs"/>
        <topology sockets="1" cores="1"/>
    <os type="other">
        <boot dev="hd"/>
    <cluster href="/api/clusters/bd3e7d51-009a-4efc-9c92-d1df3b91aa61" id="bd3e7d51-009a-4efc-9c92-d1df3b91aa61"/>
    <template href="/api/templates/00000000-0000-0000-0000-000000000000" id="00000000-0000-0000-0000-000000000000"/>
    <console enabled="false"/>
    <virtio_scsi enabled="true"/>

Comment 5 Juan Hernández 2014-02-26 11:52:50 UTC
The change in the schema should be in 3.3 as well. Please check /api?schema and look for the complex type "Configuration", it will be like in the description of the bug:

  <xs:complexType name="Configuration">
      <xs:element name="type" type="xs:string" minOccurs="0" maxOccurs="1"/>
      <xs:element name="data" type="xs:string" minOccurs="0" maxOccurs="1"/>

It wasn't failing the tests because the functionality that actually uses these elements for output was only added in 3.4.

So the schema was wrong, but nobody noticed because it wasn't used to generate output documents.

Comment 6 Sandro Bonazzola 2014-03-03 14:40:45 UTC
This BZ should be fixed in oVirt 3.4.0 RC

Comment 7 Ilia Meerovich 2014-03-04 15:22:02 UTC
verified with downstream build rhevm-3.4.0-0.3

Comment 8 Sandro Bonazzola 2014-03-31 12:30:19 UTC
this is an automated message: moving to Closed CURRENT RELEASE since oVirt 3.4.0 has been released

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