Bug 1816777 - Missing key 'path' when connecting to browser console in VM portal
Summary: Missing key 'path' when connecting to browser console in VM portal
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: WebSocket Proxy
Version: 4.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.4.0
: ---
Assignee: Liran Rotenberg
QA Contact: Tamir
URL:
Whiteboard:
Depends On: 1826454
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-24 17:33 UTC by Ivana Saranova
Modified: 2020-08-05 06:10 UTC (History)
5 users (show)

Fixed In Version: ovirt-engine-4.4.0_beta2
Doc Type: Bug Fix
Doc Text:
Previously, when initiating the console from the VM portal to noVNC, the console didn't work due to a missing 'path' parameter when initiating the console. In this release,the 'path' is not mandatory, and the noVNC console can initiate even when 'path' isn't provided.
Clone Of:
Environment:
Last Closed: 2020-08-05 06:10:08 UTC
oVirt Team: Virt
Embargoed:
pm-rhel: ovirt-4.4+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 108090 0 master MERGED packaging: services: websocket handle missing path 2020-07-23 20:12:37 UTC

Description Ivana Saranova 2020-03-24 17:33:27 UTC
Description of problem:
Cannot connect to browser console in VM portal due to missing key 'path' in the ticket with data.

Mar 24 17:15:30 engine1 ovirt-websocket-proxy.py[3747]: ovirt-websocket-proxy[30218] INFO msg:871 handler exception: 'path'

# /usr/libexec/platform-python /usr/share/ovirt-engine/services/ovirt-websocket-proxy/ovirt-websocket-proxy.py start
ovirt-websocket-proxy[31532] INFO daemonContext:470 Using the following ciphers: HIGH:!aNULL
ovirt-websocket-proxy[31532] INFO daemonContext:474 Minimum SSL version requested: TLSv1.2
ovirt-websocket-proxy[31532] WARNING daemonContext:509 websockify does not support minimum SSL version
ovirt-websocket-proxy[31532] INFO msg:871 WebSocket server settings:
ovirt-websocket-proxy[31532] INFO msg:871   - Listen on *:6100
ovirt-websocket-proxy[31532] INFO msg:871   - Flash security policy server
ovirt-websocket-proxy[31532] INFO msg:871   - SSL/TLS support
ovirt-websocket-proxy[31532] INFO msg:871   - Deny non-SSL/TLS connections
ovirt-websocket-proxy[31532] INFO msg:871   - proxying from *:6100 to targets generated by str
{'port': '5902', 'host': 'host1ip', 'ssl_target': False}
ovirt-websocket-proxy[31534] INFO msg:871 handler exception: 'path'

/usr/share/ovirt-engine/services/ovirt-websocket-proxy/ovirt-websocket-proxy.py
    224     def get_target(self, target_cfg, path):
    225         """
    226         Parses the path, extracts a token, and looks for a valid
    227         target for that token in the configuration file(s). Returns
    228         target_host and target_port if successful and sets an ssl_target
    229         flag.
    230         """
    231         connection_data = json.loads(parse.unquote(
    232             self._proxy._ticketDecoder.decode(path[1:])))
    233         target_host = connection_data['host'].encode('utf8')
    234         target_port = connection_data['port'].encode('utf8')
    235         print(conection_data)
    236         path = connection_data['path']

Version-Release number of selected component (if applicable):
ovirt-engine-websocket-proxy-4.4.0-0.0.master.20200317103500.git3e2b0274306.el8.noarch
ovirt-engine-4.4.0-0.0.master.20200317103500.git3e2b0274306.el8.noarch

How reproducible:
Always

Steps to Reproduce:
1. Login to VM portal and go to running VM
2. Click on VNC browser console option
3. Check that console is connected

Actual results:
Console could not be connected, there is exception handler info in the logs of the websocket proxy service.

Expected results:
Console is connected.

Additional info:

Comment 1 Michal Skrivanek 2020-03-27 17:04:45 UTC
"path" is mandatory...I guess. Don't really recall. Ryan, can you pick that up? It could be that the path needs to be passed in the ticket now, in that case flip it back to UX please (though such code change would be tracked on ovirt-web-ui's github)

Comment 2 Ryan Barry 2020-03-27 17:28:57 UTC
Sure, I'll pick it up

Comment 3 Liran Rotenberg 2020-03-31 08:52:39 UTC
The value is missing in VM portal as it seems. From webadmin:
ovirt-websocket-proxy[2822] INFO msg:871 WebSocket server settings:
ovirt-websocket-proxy[2822] INFO msg:871   - Listen on *:6100
ovirt-websocket-proxy[2822] INFO msg:871   - Flash security policy server
ovirt-websocket-proxy[2822] INFO msg:871   - SSL/TLS support
ovirt-websocket-proxy[2822] INFO msg:871   - Deny non-SSL/TLS connections
ovirt-websocket-proxy[2822] INFO msg:871   - proxying from *:6100 to targets generated by str
{'host': '10.46.9.68', 'port': '5900', 'ssl_target': False, 'path': None, 'token': None}
None
ovirt-websocket-proxy[2868] INFO log_message:117 127.0.0.1 - - [31/Mar/2020 11:24:36] 127.0.0.1: SSL/TLS (wss://) WebSocket connection
ovirt-websocket-proxy[2868] INFO log_message:117 127.0.0.1 - - [31/Mar/2020 11:24:36] 127.0.0.1: Version hybi-13, base64: 'False'

And everything went fine.
It might be a problem in the VM Portal (https://github.com/oVirt/ovirt-web-ui/blob/master/src/components/VmConsole/index.js#L129).
But, we can easily fix it in the ovirt-websocket-proxy by setting None when this 'path' key is missing.

Comment 4 Tamir 2020-04-21 15:00:30 UTC
I was trying to verify the bug on RHV 4.4.0-31 RHEL 8.2 (Both engine and hosts)

Steps:

In web admin:
1. I created a Host, Data center, Cluster with Enable VNC Encryption under console disabled, Storage domain and a VM.
2. I run the VM.
3. I set the console to open as VNC and console invocation as noVNC.
4. Added the CA to the browser and launched the console

Everything worked as expected and I successfully launched the noVNC console and it worked.

In the VM portal I couldn't open any sort of a Console because of a bug. I will search if the bug is opened and attach it and if not I will open it.

I don't think we can mark this bug as verified yet until I will be able to verify it in the VM portal.

Comment 5 Tamir 2020-06-18 15:40:01 UTC
I verified it again on RHV-4.4.1-4 and everything works

Comment 8 Sandro Bonazzola 2020-08-05 06:10:08 UTC
This bugzilla is included in oVirt 4.4.0 release, published on May 20th 2020.

Since the problem described in this bug report should be
resolved in oVirt 4.4.0 release, 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.