kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.12k stars 364 forks source link

Spice console not working on Ubuntu 20.04 - ReferenceError: SpiceMainConn is not defined #1346

Open jamesfreeman959 opened 2 years ago

jamesfreeman959 commented 2 years ago

Describe the bug Although I have Kimchi working on Ubuntu 20.04 (built from source yesterday from the latest commit on GitHub), I cannot get the VM console to work. The SPICE web page loads, and then I get a pop up saying "ReferenceError: SpiceMainConn is not defined". I found that all JS files were in a different place to that referenced in spice-auto.html - on my system I found them under /usr/share/spice-html5/src, but it appears this page is looking in /usr/share/spice-html5. I tried moving the files up to the directory they were being called from, and all 404 errors disappeared, but the dialog box still comes up.

To Reproduce Steps to reproduce the behavior:

  1. Build Wokd and Kimchi from source on Ubuntu 20.04 using the instructions provided
  2. Install as per the instructions
  3. Log in, and navigate to the virtualization tab
  4. Click on "View Console" for a SPICE enabled VM
  5. SPICE screen loads, including the frame that should contain the console, then a dialog appears saying "ReferenceError: SpiceMainConn is not defined".

Expected behavior SPICE console should load without error

Desktop (please complete the following information):

Additional context I also see the following in the wok-error.log file:

[14/Dec/2021:09:50:45] HTTP 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/lib/python3/dist-packages/cherrypy/lib/encoding.py", line 220, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cherrypy/_cpdispatch.py", line 60, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python3/dist-packages/cherrypy/_cptools.py", line 182, in handle_func
    handled = self.callable(*args, **self._merged_args(kwargs))
TypeError: staticfile() got multiple values for argument 'filename'
[14/Dec/2021:09:51:37] HTTP 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/lib/python3/dist-packages/cherrypy/lib/encoding.py", line 220, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cherrypy/_cpdispatch.py", line 60, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python3/dist-packages/cherrypy/_cptools.py", line 182, in handle_func
    handled = self.callable(*args, **self._merged_args(kwargs))
TypeError: staticfile() got multiple values for argument 'filename'

Looking at other open issues, I have tested with Websockify 0.9.0 (provided by Ubuntu DEB package) and Websockify 0.7.0 (installed using pip3).

DeadMozay commented 2 years ago

Confirm, openSUSE Tumbleweed 2021-12-21_22-42

DeadMozay commented 2 years ago

The problem is solved by setting websockify == 0.7.0 and moving /etc/nginx/conf.d/wok.conf to /etc/nginx/vhost.d/wok.conf