Repository navigation
noVNC console disconnects when Jetty WebSocket reaches idle timeout on CloudStack 4.22.1.1 #14097
Description
Activity
Thanks for opening your first issue here! Be sure to follow the issue template!
Additional timeout configuration evidence
The current CloudStack global setting is:
consoleproxy.session.timeout = 28800000This corresponds to 8 hours:
28800000 ms = 8 hoursHowever, during the reproduced noVNC console failure, the Console Proxy VM
logged:Idle timeout expired: 300001/300000 msThe effective Jetty WebSocket idle timeout was therefore still 300000 ms
(5 minutes), rather than the configured 28800000 ms (8 hours).The affected Console Proxy implementation also appears to contain a separate
hard-coded value:ConsoleProxy.VIEWER_LINGER_SECONDS = 180This creates three different timeout values that may affect the same console
session lifecycle:- Configured
consoleproxy.session.timeout: 28800000 ms (8 hours) - Observed Jetty WebSocket idle timeout: 300000 ms (5 minutes)
ConsoleProxy.VIEWER_LINGER_SECONDS: 180 seconds (3 minutes)
This may explain why the console can disconnect after approximately
2–5 minutes even though the configured session timeout is 8 hours.The console was actively being used when the disconnection occurred. The guest
VM remained Running, the Console Proxy VM remained Running with Agent State Up,
and reopening the console from the CloudStack UI immediately worked with a new
access token.Could you please confirm:
- Whether the Jetty WebSocket idle timeout is expected to use
consoleproxy.session.timeout. - Whether
ConsoleProxy.VIEWER_LINGER_SECONDSis expected to remain
hard-coded at 180 seconds. - Whether PR Honour consoleproxy.session.timeout for noVNC sessions (fixes #12810) #13002 makes both the WebSocket timeout and viewer
garbage-collection timeout honorconsoleproxy.session.timeout. - Whether the fix is included in any released or planned 4.22 package.
- Whether changing
consoleproxy.session.timeoutrequires restarting the
Management Server, restarting the Console Proxy VM, or recreating the
Console Proxy VM.
- Configured
- Addressed by Honour consoleproxy.session.timeout for noVNC sessions (fixes #12810) #13002?
No — closed unmerged. The issue is not solved yet. Backport: Honour consoleproxy.session.timeout for noVNC console sessions #13058 is an attempt to fix, but is not done. - In any released 4.22 package?
No, nothing is released yet - Backport to 4.22 planned?
It is planned to be fixed on 4.20 and ported forwards (in Backport: Honour consoleproxy.session.timeout for noVNC console sessions #13058 which isn't done yet) - Supported workaround for 4.22.1.1?
None that i know of as of now - Should consoleproxy.session.timeout drive both the Jetty idle timeout and the GC thread?
Yes, that's the design but the implementation is buggy and the fix is not finished (Backport: Honour consoleproxy.session.timeout for noVNC console sessions #13058 again) - Applying a changed timeout: per the design, it's read at CPVM (console-proxy JVM) startup, so it needs at minimum a CPVM restart/recreate — but note that's exactly the step that didn't work in Backport: Honour consoleproxy.session.timeout for noVNC console sessions #13058 yet.
- Addressed by Honour consoleproxy.session.timeout for noVNC sessions (fixes #12810) #13002?
problem
The noVNC console disconnects while the guest VM, Console Proxy VM,
CloudStack agent, network connectivity, and KVM VNC backend remain
operational.
The browser displays:
Failed to connect to server / access token has expiredThe console disconnects even while the noVNC session is actively being used
with keyboard input and screen updates. This is not an inactive or abandoned
browser session.
Closing the old console window and opening a new console session from the
CloudStack UI generates a new access token and temporarily restores access.
The newly generated session eventually disconnects again.
Observed CPVM log messages include:
Idle timeout expired: 300001/300000 msAfter the disconnection, or when the previous console session attempts to
reconnect, the CPVM log reports:
External authenticator failedThe browser WebSocket initially completes its handshake with HTTP status 101.
During the failure:
generated token.
The observed traffic path is:
Browser → CPVM public interface TCP 8080 → CPVM private interface →
KVM VNC endpoint → guest VM
versions
novnc.console.default:trueconsoleproxy.session.timeout:300000No reverse proxy or external load balancer is placed between the browser and
the Console Proxy VM.
The steps to reproduce the bug
are Up.
console.
ongoing screen updates.
despite the active session.
Idle timeout expired: 300001/300000 msin the CPVM log.External authenticator failedwhen the previous session attemptsto reconnect, or observe the browser message
Failed to connect to server / access token has expired.CloudStack UI.
temporarily.
What to do about it?
Expected behavior:
An actively used noVNC console should remain connected while the guest VM,
Console Proxy VM, network path, and KVM VNC backend remain healthy.
Active keyboard input, WebSocket traffic, and VNC framebuffer updates should
prevent the connection from being treated as idle.
If
consoleproxy.session.timeoutis intended to apply to noVNC sessions, theconfigured value should be handled consistently by the Jetty WebSocket idle
timeout and the Console Proxy viewer garbage-collection logic.
Please confirm:
consoleproxy.session.timeoutshould control both the JettyWebSocket idle timeout and Console Proxy viewer garbage collection.
Server, restarting the Console Proxy VM, or recreating the Console Proxy VM.
Security note
Console URLs, authentication tokens, API credentials, passwords, SSH keys,
MAC addresses, UUIDs, and sensitive infrastructure identifiers have been
removed from this report.