Bug 1591271

Summary: Get Internal Server Error while trying to get graphic console, while VM suspending
Product: [oVirt] ovirt-engine Reporter: biakymet
Component: RestAPIAssignee: Ori Liel <oliel>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: biakymet, bugs, mperina, pstehlik
Target Milestone: ovirt-4.2.6Flags: rule-engine: ovirt-4.2+
Target Release: 4.2.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.2.6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-03 15:10:07 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
Engine log none

Description biakymet 2018-06-14 12:35:34 UTC
Created attachment 1451344 [details]
Engine log

Description of problem:
I got:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
with empty response body, while trying to get graphic console, while VM is suspending.

Version-Release number of selected component (if applicable):
Version 4.3.0-0.0.master.20180612172344.git9643156.el7


How reproducible:
Every time

Steps to Reproduce:
1. Start VM
2. Suspend http://localhost:3000/api/vms/<vm-id>/suspend
3. And get console http://localhost:3000/api/vms/<vm-id>/graphicsconsoles/<console-id>

Actual results:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Expected results:
Graphic console file

Comment 1 Ori Liel 2018-06-18 10:46:07 UTC
The Engine considers the VM not qualified for a console connection because it is suspended and fails the command on purpose. It issues a clear failure message in the log: "Operation Failed: Vm <vm_name> is not running". 

Seems to me that the fix should be to fail the request gracefully, returning an error with status CONFLICT and displaying the error message.

This is in contrast to what's written under "Expected results", which is that the graphics console should be returned. Could you please address this?

Comment 2 biakymet 2018-06-20 10:14:33 UTC
(In reply to Ori Liel from comment #1)
> The Engine considers the VM not qualified for a console connection because
> it is suspended and fails the command on purpose. It issues a clear failure
> message in the log: "Operation Failed: Vm <vm_name> is not running". 

> Seems to me that the fix should be to fail the request gracefully, returning an > error with status CONFLICT and displaying the error message.

Yes, it would be nice if error would be more clearer then just 500 (Internal Server Error).

Comment 3 Petr Matyáš 2018-08-07 11:21:25 UTC
Verified on ovirt-engine-4.2.6-0.1.el7ev.noarch