Bug 1367411 - [API] Setting custom compatibility version with bad values produces a general exception
Summary: [API] Setting custom compatibility version with bad values produces a general...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.0.2.6
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ovirt-4.1.0-beta
: 4.1.0.2
Assignee: Sharon Gratch
QA Contact: Petr Matyáš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-16 11:20 UTC by sefi litmanovich
Modified: 2017-02-01 14:34 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-02-01 14:34:49 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: planning_ack+
rule-engine: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1357513 0 high CLOSED [RFE] Support per-VM override for cluster compatibility level 2021-02-22 00:41:40 UTC
oVirt gerrit 69984 0 master MERGED engine: validate custom compatibility version property in add/edit VM 2017-01-16 20:10:39 UTC
oVirt gerrit 70600 0 ovirt-engine-4.1 MERGED engine: validate custom compatibility version property in add/edit VM 2017-01-17 10:00:27 UTC

Internal Links: 1357513

Description sefi litmanovich 2016-08-16 11:20:09 UTC
Description of problem:

When trying to create/edit a vm via API and setting custom compatibility version to unsupported values, we get java.lang.NullPointerException instead of an informative error message.
Example of body for PUT message:

<vm>
<custom_compatibility_version>
<major>7</major>
<minor>4</minor>
</custom_compatibility_version>
</vm>


Version-Release number of selected component (if applicable):
rhevm-4.0.2.6-0.1.el7ev.noarch

How reproducible:
always

Steps to Reproduce:
1. Try to create a vm or edit a vm and set custom_compatibility_version attribute with some values which are no support (see xml above).

Actual results:
<fault>
<detail>java.lang.NullPointerException</detail>
<reason>Operation Failed</reason>
</fault>

In engine.log we get a long trace starting with:

2016-08-16 14:14:07,195 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (default task-8) [] An exception has occured while trying to create a command object for command 'UpdateVm': WELD-000049: Unable to invoke protected final void org.
ovirt.engine.core.bll.CommandBase.postConstruct() on org.ovirt.engine.core.bll.UpdateVmCommand@f5f6dbe
2016-08-16 14:14:07,219 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-8) [] Operation Failed: java.lang.NullPointerException
2016-08-16 14:14:07,219 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-8) [] Exception: javax.ejb.EJBException: java.lang.NullPointerException

Expected results:
Action fails with an informative error message e.g.
"Update failed, custom compatibility version is not supported by hosts in the cluster"

Comment 1 Petr Matyáš 2017-01-31 11:01:54 UTC
Verified on 4.1.0-9


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