Bug 36105 - noVNC error when "Globally available" disabled, Failed to connect to server (code: 1006)
noVNC error when "Globally available" disabled, Failed to connect to server (...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - VNC
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 4.0-0-errata
Assigned To: Philipp Hahn
Erik Damrose
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-09 11:51 CEST by Daniel Tröder
Modified: 2015-01-29 11:49 CET (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
patch for /usr/lib/pymodules/python2.6/univention/uvmm/node.py (651 bytes, patch)
2014-10-09 11:51 CEST, Daniel Tröder
Details | Diff
Check for matching host with local VNC (3.82 KB, patch)
2014-12-11 09:34 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder 2014-10-09 11:51:53 CEST
Created attachment 6151 [details]
patch for /usr/lib/pymodules/python2.6/univention/uvmm/node.py

The VNC HTML client cannot connect to noVNC. Web site shows error "Failed to connect to server (code: 1006)".

Reason is an empty tokens file on the UVMM server in /var/cache/univention-virtual-machine-manager-daemon/novnc.tokens/.

In uvmm/node.py write_novnc_tokens() ~ line 786 gfx.listen seems to be "None" for a kvm listening on 127.0.0.1:5900.

The appended patch fixes it for me.
Comment 1 Philipp Hahn univentionstaff 2014-12-11 09:34:10 CET
Created attachment 6524 [details]
Check for matching host with local VNC

1. Thank you for the patch, but

2. The patch is missing the case, where UVMMd/noVNC-proxy and the VM are running on a separate hosts: In that case running VNC on 127.0.0.1 is not enough, as then the port is not reachable for the noVNC proxy.

FYI: With "globally available" disabled the data looks like this:
              'graphics': [{'autoport': True,
                            'keymap': u'de',
                            'listen': None,
                            'passwd': None,
                            'port': 5902,
                            'type': u'vnc'}],
Comment 2 Philipp Hahn univentionstaff 2014-12-11 10:29:29 CET
r56692 | Bug #36105 UVMM: Fix VNC running on localhost only.

Package: univention-virtual-machine-manager-daemon
Version: 4.0.20-8.568.201412111020
Branch: ucs_4.0-0
Scope: errata4.0-0

r56695 | Bug #36105 UVMM: Fix VNC running on localhost only YAML
 2014-11-26-univention-virtual-machine-manager-daemon.yaml
 * Fix noVNC for localhost VMs.
Comment 3 Erik Damrose univentionstaff 2015-01-23 15:31:52 CET
Reopen: As discussed, during QA i saw that the data contains listen=127.0.0.1 for a KVM instance running on the same host as uvmmd. In that case, no token would be written.
Comment 4 Philipp Hahn univentionstaff 2015-01-23 15:49:55 CET
r57526 | Bug #36105 UVMM: Fix VNC running on localhost only.
 Handle listen="127.0.0.1" in newer libvirt
Package: univention-virtual-machine-manager-daemon
Version: 4.0.22-1.575.201501231539
Branch: ucs_4.0-0
Scope: errata4.0-0

r57527 | Bug #36105 UVMM: Fix VNC running on localhost only YAML
 2014-11-26-univention-virtual-machine-manager-daemon.yaml
Comment 5 Erik Damrose univentionstaff 2015-01-26 14:10:09 CET
Reopen: There is still an issue with an instance running on a remote KVM server. If 'globally available' is disabled, the VNC icon is still shown in UVMMd, but when clicking on it the connection fails as expected.

By my understanding, no VNC icon should be shown in this case.

uvmmd works as expected, the token file does not contain an entry for the VM. The domain info for the VM reads 
DATA:
{'qemu://kvmmember.ucs.local/system': [{'cpu_usage': 4.591724381125893,
                                        'description': '',
                                        'mem': 1073741824L,
                                        'name': u'ucs40-64-test',
                                        'node_available': True,
                                        'state': 'RUNNING',
                                        'suspended': 0,
                                        'uuid': u'567ded28-e68e-4f20-9d11-0c5ee3a1db57',
                                        'vnc': False,
                                        'vnc_port': 5900}]}

Notice 'vnc: False', which indicates that no external VNC connection is possible. But the umc module code in uvmm.js checks the wrong field to determine if the VNC icon should be shown:

uvmm.js:88
var canVNC = function(item) {
  return isRunning(item) && item.vnc_port;
};
Comment 6 Philipp Hahn univentionstaff 2015-01-27 14:52:35 CET
r57608 | Bug #36105 UVMM: Fix VNC running on localhost only
 Use the same test for local VNC connections for "domain_list" as for writing the noVNC token file.

Package: univention-virtual-machine-manager-daemon
Version: 4.0.22-2.576.201501271444
Branch: ucs_4.0-0
Scope: errata4.0-0

r57610 | Bug #36105 UVMM: Fix VNC running on localhost only YAML
 2014-11-26-univention-virtual-machine-manager-daemon.yaml
Comment 7 Erik Damrose univentionstaff 2015-01-27 17:13:19 CET
OK: Code Review
OK: If "globally available" is disabled, vnc access is possible from uvmmd on the same host, but not from any other uvmmd hosts in the domain.
OK: YAML
-> Verified
Comment 8 Janek Walkenhorst univentionstaff 2015-01-29 11:49:40 CET
<http://errata.univention.de/ucs/4.0/52.html>