Bug 1250046

Summary: internal error when deleting watchdog device from REST api
Product: [Retired] oVirt Reporter: Shira Maximov <mshira>
Component: ovirt-engine-apiAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Shira Maximov <mshira>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6CC: bugs, ecohen, gklein, lsurette, michal.skrivanek, mshira, rbalakri, yeylon
Target Milestone: ---Keywords: Automation
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: 3.6.0-10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-04 11:16:52 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
rhevm logs none

Description Shira Maximov 2015-08-04 12:16:20 UTC
Description of problem:

DELETE request content is --  
url:/api/vms/a4b7e68f-6d91-4bd6-bc12-044a5dae28b5/watchdogs/00000000-0000-0000-0000-000000000000

Failed to delete element NOT as expected:
Status: 500
Reason: Internal Server Error

Version-Release number of selected component (if applicable):
3.6.0-4
vdsm-4.17.0-1201.git7ba0684.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1.DELETE request content is --  
url:/api/vms/a4b7e68f-6d91-4bd6-bc12-044a5dae28b5/watchdogs/00000000-0000-0000-0000-000000000000

2.
3.

Actual results:
Status: 500
Reason: Internal Server Error

Expected results:
the watchdog device should delete

Additional info:

Comment 1 Omer Frenkel 2015-08-05 06:56:58 UTC
please attach engine log

Comment 3 Omer Frenkel 2015-08-05 10:41:29 UTC
can't see anything suspicious in the engine.log, it seems the delete of the watchdog works ok but for some reason the test fails when reading the response

Comment 4 Juan Hernández 2015-08-17 10:40:04 UTC
This happens because the client is sending a request without including the "Accept" content header. In this situation the application server doesn't know how to convert the result to something that the client will understand, resulting in this error message:

  Could not find MessageBodyWriter for response object of type: org.ovirt.engine.api.model.Action of media type: application/octet-stream

The best way to solve this problem is to modify the client so that it explicitly sends the "Accept" header:

  DELETE /vms/{vm:id}/wathdogs/{watchdog:id}
  Accept: application/xml

It is also possible to modify the "BackendWatchdogResource" interface so that it explicitly includes the @Produces annotation with the supported media types. This will make the server consider those media types. For sake of backwards compatibility we will do that.

Comment 5 Shira Maximov 2015-08-24 07:12:12 UTC
verified on 3.6.0-10

Comment 6 Sandro Bonazzola 2015-11-04 11:16:52 UTC
oVirt 3.6.0 has been released on November 4th, 2015 and should fix this issue.
If problems still persist, please open a new BZ and reference this one.