louislam/dockge · error · ValidationError
Console is not enabled.
Error message
Console is not enabled.
What it means
Thrown as a ValidationError in the mainTerminal handler when server.config.enableConsole is false. The console feature is disabled in the server configuration, so the handler refuses to attach a main terminal. This is an intentional configuration gate, not a bug.
Source
Thrown at backend/agent-socket-handlers/terminal-socket-handler.ts:43
if (terminal instanceof InteractiveTerminal) {
//log.debug("terminalInput", "Terminal found, writing to terminal.");
terminal.write(cmd);
} else {
throw new Error("Terminal not found or it is not a Interactive Terminal.");
}
} catch (e) {
callbackError(e, callback);
}
});
// Main Terminal
agentSocket.on("mainTerminal", async (terminalName : unknown, callback) => {
try {
checkLogin(socket);
// Throw an error if console is not enabled
if (!server.config.enableConsole) {
throw new ValidationError("Console is not enabled.");
}
// TODO: Reset the name here, force one main terminal for now
terminalName = "console";
if (typeof(terminalName) !== "string") {
throw new ValidationError("Terminal name must be a string.");
}
log.debug("mainTerminal", "Terminal name: " + terminalName);
let terminal = Terminal.getTerminal(terminalName);
if (!terminal) {
terminal = new MainTerminal(server, terminalName);
terminal.rows = 50;
log.debug("mainTerminal", "Terminal created");
}View on GitHub (pinned to f809ae192b)
Solutions
- Set enableConsole: true in the server config and restart the server if console access is required.
- If console should stay disabled, stop emitting 'mainTerminal' from the client and hide the console UI.
- Confirm the server actually loaded the config file you edited (check startup logs/config path).
- Ensure clients handle the callback error gracefully and show a 'console disabled' message.
Example fix
// before (server config)
{ "enableConsole": false }
// after
{ "enableConsole": true } Defensive patterns
Strategy: validation
Validate before calling
if (!serverConfig.enableConsole) { disableConsoleUI(); } else { socket.emit("mainTerminal", "console", cb); } Type guard
const consoleAvailable = (cfg) => cfg?.enableConsole === true;
Try / catch
socket.emit("mainTerminal", "console", (res) => { if (res?.error) showConsoleDisabledMessage(res.error); }); Prevention
- Fetch server feature flags before rendering console UI.
- Hide/disable console entry points when enableConsole is false.
- Keep server config in sync across environments; document the flag.
- Handle callback errors so a disabled feature degrades gracefully.
When it happens
Trigger: Emitting the 'mainTerminal' socket event while the server was started with enableConsole set to false (or omitted and defaulting to disabled) in its config file.
Common situations: Deployments that disabled console for security/hardening but still have clients (or old UI sessions) requesting the main terminal; config files copied from environments with different settings.
Related errors
- Terminal name must be a string.
- Command must be a string.
- Terminal not found or it is not a Interactive Terminal.
- Stack name must be a string.
- Service name must be a string.
AI-assisted analysis of louislam/dockge@f809ae192b (2026-08-31).
Data as JSON: /api/errors/431963a9d96d0528.
Report an issue: GitHub.