Problem:
Spice console stopped working. As seen in picture:
in web development console is info: must set host and port
In spice.js there is a following function:
export function startSpice() {
const scheme = 'ws://';
const host = window.location.hostname;
const port = $('#spice-area').data('port');
const password = $('#spice-area').data('password');
if (!host || !port) {
// eslint-disable-next-line no-console
console.log(__('must set host and port'));
return;
}
$('#spice-area').data('port')
should resolve to a port where QEMU SPICE console is running on compute host - this is the console page template:
<%= content_tag(:div, :id =>'spice-area', :data => spice_data_attributes(@console)) do %>
Meanwhile, our instance of foreman does not have any additional datafields at all; itās just <div id="spice-area">
- it is probably an issue with webpage template rendering where spice_data_attributes
values cannot be fetched, or maybe they are not being fetched at all?
Also, after manually adding the port data field and running the SPICE console manually via following commands in Javascript console, a āSecurityError: The operation is insecureā error appears:
document.querySelector('#spice-area').dataset.port = '5910'
tfm.spice.startSpice()
This may be caused by a hardcoded const scheme = 'ws://';
in spice.js instead of wss://
- this needs to be verified after template rendering issue is handled.
Expected outcome:
spice console should be running
Foreman and Proxy versions:
dpkg -l | grep foreman | grep ii
ii foreman 2.4.0-1 amd64 Systems management web interface
ii foreman-cli 2.4.0-1 all metapackage providing hammer CLI for Foreman
ii foreman-console 2.4.0-1 all metapackage providing console dependencies for Foreman
ii foreman-debug 2.4.0-1 all provides support utility foreman-debug.
ii foreman-installer 2.4.0-1 all Automated puppet-based installer for The Foreman
ii foreman-libvirt 2.4.0-1 all metapackage providing libvirt dependencies for Foreman
ii foreman-postgresql 2.4.0-1 all metapackage providing PostgreSQL dependencies for Foreman
ii foreman-proxy 2.4.0-1 all RESTful proxies for DNS, DHCP, TFTP, and Puppet
ii ruby-foreman-deface 1.5.3-1 all Foreman Deface Plugin Dependency
ii ruby-foreman-dhcp-browser 0.0.8-1 all Foreman DHCP browser Plugin
ii ruby-foreman-discovery 16.3.4-1 all Foreman Discovery Plugin
ii ruby-foreman-setup 6.0.0-1 all Foreman Setup Plugin
ii ruby-hammer-cli-foreman 2.4.0-1 all Foreman commands for Hammer
ii ruby-hammer-cli-foreman-discovery 1.0.1-1 all Foreman CLI plugin for managing discovery hosts in foreman
Distribution and version:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
Other relevant data:
Nothing relevant info in logs.