Bug 1359885 - [API v3] Adding a vm with payload fails with internal server error
Summary: [API v3] Adding a vm with payload fails with internal server error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.0.2
: 4.0.2.4
Assignee: Juan Hernández
QA Contact: Lucie Leistnerova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-25 15:46 UTC by sefi litmanovich
Modified: 2016-08-12 14:24 UTC (History)
6 users (show)

Fixed In Version: 4.0.2-5
Clone Of:
Environment:
Last Closed: 2016-08-12 14:24:57 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
rule-engine: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)
engine + server logs (2.03 MB, application/x-gzip)
2016-07-25 15:46 UTC, sefi litmanovich
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 61377 0 ovirt-engine-4.0 MERGED restapi: Add V3 payload adapter 2016-07-26 10:46:13 UTC
oVirt gerrit 61390 0 ovirt-engine-4.0 MERGED restapi: Add V3 payload adapter 2016-07-26 12:02:02 UTC
oVirt gerrit 61403 0 ovirt-engine-4.0.2 MERGED restapi: Add V3 payload adapter 2016-07-26 15:03:54 UTC

Description sefi litmanovich 2016-07-25 15:46:44 UTC
Created attachment 1183854 [details]
engine + server logs

Description of problem:

Trying to create a vm with a payload on v3 API fails with internal error.
Failure isn't reflected in engine.log but server.log has a long trace starting with:

2016-07-25 17:57:06,488 ERROR [io.undertow.request] (default task-9) UT005023: Exception handling request to /ovirt-engine/api/v3/vms/: java.lang.RuntimeException: org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Can
't find V3 input adapter of class "org.ovirt.engine.api.v3.adapters.V3PayloadsInAdapter" for object of class "org.ovirt.engine.api.v3.types.V3Payloads"

Re produced on 2 different envs.
Creation of vm with payload works fine with API v4.

Version-Release number of selected component (if applicable):
rhevm-4.0.2-0.2.rc1.el7ev.noarch

How reproducible:
always

Steps to Reproduce:
1. Try to create a vm with payload via api v3 e.g. with the following message body:

<vm>
    <name>CreateVmWithCdromPayload</name>
    <os type="rhel_6x64"/>
    <cluster id="{cluster_id}">
    <display>
        <type>spice</type>
    </display>
    <template id="{template_id}"/>
    <payloads>
        <payload type="cdrom">
            <files>
                <file>
                    <name>payload.cdrom</name>
                    <content>cdrom payload via create</content>
                </file>
            </files>
        </payload>
    </payloads>
</vm>


Actual results:

Response code 500
Internal server error

Expected results:
Vm should be created successfully and if not, some informative message should raise. 

Additional info:

Comment 1 Red Hat Bugzilla Rules Engine 2016-07-26 08:42:51 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 5 Lucie Leistnerova 2016-08-12 09:35:19 UTC
I have substituted in the given XML {cluster_id} and {template_id} with existing IDs

API returned:

HTTP/1.1 400 Bad Request

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<usage_message>
    <message>Request syntactically incorrect. See the description below for the correct usage:</message>
    <detailedLink href="/ovirt-engine/api/vms" rel="add">
...

because of missing end tag </cluster>
with correct cluster element:
<cluster id="{cluster_id}" />

VM was created succesfully

verified in ovirt-engine-restapi-4.0.2.6-0.1.el7ev.noarch


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