Bug 1305819

Summary: sign websocket proxy ticket via RESTapi with power off VM cause an engine exception
Product: Red Hat Enterprise Virtualization Manager Reporter: Petr Kubica <pkubica>
Component: ovirt-engineAssignee: Tomas Jelinek <tjelinek>
Status: CLOSED NOTABUG QA Contact: Petr Kubica <pkubica>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.6.3CC: gklein, jbelka, lsurette, michal.skrivanek, oourfali, rbalakri, Rhev-m-bugs, srevivo, tjelinek, ykaul
Target Milestone: ovirt-4.0.0-beta   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-19 07:47:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Kubica 2016-02-09 10:20:37 UTC
Description of problem:
sign websocket proxy ticket via RESTapi with power off VM cause an engine exception

2016-02-09 11:04:52,430 ERROR [org.ovirt.engine.core.bll.GetSignedWebsocketProxyTicketQuery] (ajp-/127.0.0.1:8702-7) [] Query 'GetSignedWebsocketProxyTicketQuery' failed: EngineException: vmid=18c40117-9c2b-4840-a9a0-da07c8682a6e console=SPICE (Failed with error GraphicsConsoleCantBeObtained and code 5062)
2016-02-09 11:04:52,430 ERROR [org.ovirt.engine.core.bll.GetSignedWebsocketProxyTicketQuery] (ajp-/127.0.0.1:8702-7) [] Exception: org.ovirt.engine.core.common.errors.EngineException: EngineException: vmid=18c40117-9c2b-4840-a9a0-da07c8682a6e console=SPICE (Failed with error GraphicsConsoleCantBeObtained and code 5062)
	at org.ovirt.engine.core.bll.GetSignedWebsocketProxyTicketQuery.getGraphicsInfo(GetSignedWebsocketProxyTicketQuery.java:63) [bll.jar:]

Version-Release number of selected component (if applicable):
rhevm-restapi-3.6.3-0.1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create VM
2. Try to sing websocket proxy ticket via RESTapi
POST /vms/{vmid}/graphicsconsoles/{consoleid}/proxyticket
<action> <proxy_ticket> <value>ticket_content</value> </proxy_ticket> </action>
3. 

Actual results:
Failed with exception

Expected results:
Failed without exception (in log)

Additional info:
Attached engine log

Comment 2 Yaniv Kaul 2016-02-10 08:11:00 UTC
Tomas - why do we need to fix this at all? Is this an interesting scenario? Any harm done to the backend? It's a negative, corner-case scenario.

Comment 3 Tomas Jelinek 2016-02-10 08:53:30 UTC
No harm on backend - it is a cosmetic issue that the user will not get the proper message, just an exception on the backend. But considering it is an API call, it may happen.
The fix should be trivial, I don't see a reason why not consider it for 4.0

Comment 4 Michal Skrivanek 2016-03-14 07:01:50 UTC
*** Bug 1311067 has been marked as a duplicate of this bug. ***

Comment 5 Michal Skrivanek 2016-03-14 07:02:49 UTC
don't forget to check the flow in bug 1311067

Comment 6 Yaniv Lavi 2016-05-09 11:05:41 UTC
oVirt 4.0 Alpha has been released, moving to oVirt 4.0 Beta target.

Comment 9 Tomas Jelinek 2016-05-19 07:47:35 UTC
After more investigation I see that the API response is:

<fault>
    <detail>Graphics console can't be obtained. Is vm ready for connecting to console?</detail>
    <reason>Operation Failed</reason>
</fault>

which is a descriptive response. The engine exception is not a mistake - it is implemented intentionally and properly caught and handled.

Closing as not a bug.