Bug 1113571 - Fail to update VM with any field, on missing domain name.
Summary: Fail to update VM with any field, on missing domain name.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.4.2
Assignee: Juan Hernández
QA Contact: Ilanit Stein
URL:
Whiteboard: virt
Depends On:
Blocks: 1123858
TreeView+ depends on / blocked
 
Reported: 2014-06-26 12:46 UTC by Ilanit Stein
Modified: 2019-04-28 10:50 UTC (History)
13 users (show)

Fixed In Version: av11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-04 15:16:03 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 30548 0 master MERGED restapi: Ignore blank domains Never
oVirt gerrit 30616 0 ovirt-engine-3.5 MERGED restapi: Ignore blank domains Never
oVirt gerrit 30617 0 ovirt-engine-3.4 MERGED restapi: Ignore blank domains Never

Description Ilanit Stein 2014-06-26 12:46:46 UTC
Description of problem:
Update vm description fail on:
"If Domain supplied, Domain name expected to be supplied as well."

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

How reproducible:
100% on automation test:
http://jenkins.qa.lab.tlv.redhat.com:8080/view/Compute/view/3.4-git/view/Virt/job/3.4-git-compute-virt-reg_vms-nfs/

Additional info from test:
2014-06-22 16:29:22,445 - MainThread - vms - DEBUG - UPDATE api content is --  collection :vms element:<vm>
    <description>TEST</description>
</vm>
 
2014-06-22 16:29:22,520 - MainThread - core_api - DEBUG - Request PUT response time: 0.010
2014-06-22 16:29:22,521 - MainThread - vms - ERROR - Failed to update an element, status: 400, reason: Bad Request, details: If Domain supplied, Domain name expected to be supplied as well.

Comment 2 Ilanit Stein 2014-06-29 06:07:59 UTC
It seems the problem is more general, and VM can't be updated with any field,
and not just description.

Comment 3 Juan Hernández 2014-07-11 10:19:01 UTC
I'm checking this with the latest upstream 3.5 master and it works correctly. I'm moving to MODIFIED so that QE can test it with the next downstream release.

Comment 4 Ilanit Stein 2014-07-21 15:16:34 UTC
I have it failing, on latest 3.4.1 (av10.3), all SDK update VM test cases. 
java_sdk_python_version=3.4.1.2.1

http://jenkins.qa.lab.tlv.redhat.com:8080/view/Compute/view/3.4-git/view/multi-apis/job/3.4-git-compute-virt-reg_vms-nfs/15/#showFailuresLink

Comment 5 Juan Hernández 2014-07-21 17:43:07 UTC
This happens because a blank domain name is represented in the RESTAPI as follows:

  <domain>
    <name></name>
  </domain>

But the version of generateDS.py that we use in 3.4 doesn't handle correctly these empty tags, it just removes them, so what it is sending to the server as part of the update is the following:

  <domain/>

And this is rightfully rejected by the server, because when a domain is provided the name has to be provided as well, see bug 1049080.

The SDK problem has been solved in 3.5 updating the version of generateDS.py, see bug 1091688, this could be considered a duplicate.

I think that updating the version of generateDS.py for 3.4 is too risky, as it hasn't been well tested yet.

To solve this particular case we will modify the server so that it ignores blank domains, thus avoiding the issue of the Python SDK for this particular case.

Meanwhile the issue can bet worked around changing in the database the value of the "domain" column of the "vm_init" table, so that if it is empty it will be replaced by null:

  update vm_init set doumain = null where domain=""

Comment 8 Eyal Edri 2014-08-17 07:38:23 UTC
ilanit, this bug is 3.4.2, not 3.5.0, you need to verify it with av11.
av11 != 3.5.0 rc1, please make sure this bug is verifed on engine from av11:
rhevm-3.4.2-0.1.el6ev.noarch.rpm

Comment 9 Ilanit Stein 2014-08-19 12:29:42 UTC
Sorry my mistake, this bug was verified on av11. In comment #11 'ovirt-3.5.0_rc1' is wrong.
Also you can see the verification link is for a test, run on av11.


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