Bug 1506284 - Downloading disk for a running vm fails with: response content type 'text/html;charset=UTF-8' isn't the expected XML
Summary: Downloading disk for a running vm fails with: response content type 'text/htm...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.2.0
: ---
Assignee: Ori Liel
QA Contact: Radim Hrazdil
URL:
Whiteboard:
Depends On:
Blocks: 1477922
TreeView+ depends on / blocked
 
Reported: 2017-10-25 15:09 UTC by Natalie Gavrielov
Modified: 2017-12-20 10:46 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-20 10:46:56 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)
server.log, engine.log (533.71 KB, application/zip)
2017-10-25 15:09 UTC, Natalie Gavrielov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 83469 0 master MERGED Uncatch WebFaultExceptions by Signature Invocation Code 2020-09-10 10:40:51 UTC
oVirt gerrit 83752 0 master MERGED restapi: Update to model 4.2.24 and metamodel 1.2.12 2020-09-10 10:40:51 UTC

Description Natalie Gavrielov 2017-10-25 15:09:47 UTC
Created attachment 1343309 [details]
server.log, engine.log

Description of problem:
When trying to download a disk that is attached to a running VM, operation fails without supplying information about the failure, instead it outputs that the response content type isn't the expected XML.

Version-Release number of selected component (if applicable):
ovirt-engine-4.2.0-0.0.master.20171022103432.gitaf9d8b6.el7.centos.noarch

How reproducible:
100%

Steps to Reproduce:
Try to download a disk that is attached to a running VM, using python sdk (examples/download_disk.py) 

Actual results:
Fails with the following output:
Can't open '/usr/share/abrt/conf.d/plugins/python.conf': No such file or directory
Can't open '/etc/abrt/plugins/python.conf': No such file or directory
Traceback (most recent call last):
  File "./download_disk.py", line 71, in <module>
    direction=types.ImageTransferDirection.DOWNLOAD,
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/services.py", line 10354, in add
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 223, in _internal_add
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 53, in wait
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 220, in callback
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 121, in _check_fault
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 307, in _internal_read_body
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/__init__.py", line 796, in check_xml_content_type
    
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/__init__.py", line 836, in _check_content_type
    
ovirtsdk4.Error: The response content type 'text/html;charset=UTF-8' isn't the expected XML

engine.log:
2017-10-25 17:28:34,539+03 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-26) [] Operation Failed: [Cannot transfer Virtual Disk. The disk disk-2 is plugged to non-Down VMs: golden_env_mixed_virtio_1_0]

server.log:
2017-10-25 17:28:34,539+03 ERROR [io.undertow.request] (default task-26) UT005023: Exception handling request to /ovirt-engine/api/v4/imagetransfers: java.lang.RuntimeException: org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalStateException: Failed to find or invoke API method. The failure is in auto-generated code and indicates a bug in the JAX-RS intrafaces generation process

Expected results:
The following output:
./download_disk.py 
Traceback (most recent call last):
  File "./download_disk.py", line 70, in <module>
    direction=types.ImageTransferDirection.DOWNLOAD,
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line 12362, in add
    self._check_fault(response)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 98, in _check_fault
    Service._raise_error(response, fault)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 71, in _raise_error
    raise Error(msg)
ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot ${action} Storage: The following disks are locked: test-vm-1_Disk1. Please try again in a few minutes.]". HTTP response code is 409.

or something of that sort..

Additional info:
Download disk for a floating disk or a disk that is attached to a vm thats not running works fine.

Comment 1 Juan Hernández 2017-10-25 15:19:24 UTC
The reason for this is that we aren't handling correctly the error in the code that detects API method signatures. This is strictly infra, not storage.

Comment 2 Ori Liel 2017-11-01 11:25:55 UTC
Patch posted: 

  https://gerrit.ovirt.org/#/c/83469/

Comment 3 Radim Hrazdil 2017-11-16 10:09:02 UTC
Verified that attempt to download disk attached to a running VM fails with HTTP response code 404 instead of unexpected XML.

Comment 4 Sandro Bonazzola 2017-12-20 10:46:56 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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