Bug 1285390

Summary: REST error message suggests description but there is none
Product: [oVirt] ovirt-engine Reporter: jniederm
Component: RestAPIAssignee: Ori Liel <oliel>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.0.0CC: bugs, juan.hernandez
Target Milestone: ovirt-4.0.0-alphaFlags: rule-engine: ovirt-4.0.0+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+
Target Release: 4.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt 4.0.0 alpha1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-01 12:26:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
stack_trace.txt none

Description jniederm 2015-11-25 14:13:47 UTC
Created attachment 1098826 [details]
stack_trace.txt

Description of problem:
Error message generated as response to malformed REST API request suggests some "description". However the response doesn't contain any.

Version-Release number of selected component (if applicable):
4.0 master, commit 5e447e0

How reproducible:
100%

Steps to Reproduce:
1.
POST /ovirt-engine/api/vmpools HTTP/1.1
Host: localhost:8080
Authorization: Basic YWRtaW5AaW50ZXJuYWw6YQ==
Content-Type: application/xml

<vmpool>
    <name>pool1</name>
</vmpool>

Actual results:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<usage_message>
    <message>Request syntactically incorrect. See the description below for the correct usage:</message>
</usage_message>

and error in engine log, see attachement

Expected results:
Some meaningful, descriptive error message

Additional info:

Comment 1 Juan Hernández 2015-11-27 11:00:44 UTC
Note that this is more severe than just not showing the description, what actually happens is that the RSDL document is generated incorrectly, almost empty. The proposed patch fixes the generation of the RSDL, and then the description is shown correctly.

Comment 2 jniederm 2016-02-23 22:19:03 UTC
Hi Juan, I can still reproduce the bug on current 4.0 master (commit 904ab61) using steps to reproduce in comment 0. Is it supposed to be fixed or not yet?

Comment 3 Juan Hernández 2016-02-24 09:38:57 UTC
The original issue was fixed. But then the introduction of the support for multiple versions introduced a new regression, which has the same effect. The following patch fixes it:

  restapi: Ignore version prefix in "UsageFinder"
  https://gerrit.ovirt.org/53957

Comment 4 Red Hat Bugzilla Rules Engine 2016-02-24 09:39:02 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 5 Lukas Svaty 2016-08-01 07:54:08 UTC
verified in ovirt-engine-restapi-4.0.2.1-0.1.el7ev.noarch

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <detail>For correct usage, see: https://*hostname*/ovirt-engine/api/v4/model#services/vms/methods/add</detail>
    <reason>Request syntactically incorrect.</reason>
</fault>