From c062cd502df54a245e53346e03679f1e9f0c98b9 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Sat, 14 Mar 2026 05:53:13 -0400 Subject: [PATCH] debug(rdp): enable guacd debug logging + log all guacd responses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit guacd was dying silently with no error instruction sent back. Enable -L debug -f for verbose FreeRDP diagnostics and log first 5 guacd→browser instructions plus connection parameters. Co-Authored-By: Claude Opus 4.6 --- backend/src/rdp/rdp.gateway.ts | 10 ++++++---- docker-compose.yml | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/src/rdp/rdp.gateway.ts b/backend/src/rdp/rdp.gateway.ts index 9f32eee..b7fd229 100644 --- a/backend/src/rdp/rdp.gateway.ts +++ b/backend/src/rdp/rdp.gateway.ts @@ -70,7 +70,7 @@ export class RdpGateway { : null; this.logger.log( - `Opening RDP tunnel: ${host.hostname}:${host.port} for host "${host.name}"`, + `Opening RDP tunnel: ${host.hostname}:${host.port} for host "${host.name}" (user: ${cred?.username || 'none'}, hasPwd: ${!!cred?.password}, domain: ${cred?.domain || 'none'})`, ); const socket = await this.guacamole.connect({ @@ -90,11 +90,13 @@ export class RdpGateway { this.clientSockets.set(client, socket); // Pipe guacd → browser: wrap raw Guacamole instruction bytes in JSON envelope + let guacMsgCount = 0; socket.on('data', (data: Buffer) => { const instruction = data.toString('utf-8'); - // Log first few instructions or errors for diagnostics - if (instruction.includes('error') || instruction.includes('ready') || instruction.includes('nop')) { - this.logger.log(`[guacd→browser] ${instruction.substring(0, 200)}`); + guacMsgCount++; + // Log first 5 instructions and any errors + if (guacMsgCount <= 5 || instruction.includes('error')) { + this.logger.log(`[guacd→browser #${guacMsgCount}] ${instruction.substring(0, 300)}`); } if (client.readyState === 1 /* WebSocket.OPEN */) { client.send(JSON.stringify({ type: 'guac', instruction })); diff --git a/docker-compose.yml b/docker-compose.yml index 078ff53..f622293 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,6 +20,7 @@ services: guacd: image: guacamole/guacd network_mode: host + command: ["/usr/local/sbin/guacd", "-b", "0.0.0.0", "-L", "debug", "-f"] restart: always postgres: