{"record":{"id":"d34220786acfc267","repo":"windmill-labs/windmill","slug":"no-workspace-selected-d34220","errorCode":null,"errorMessage":"No workspace selected","messagePattern":"No workspace selected","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/debug/MonacoDebugger.svelte","lineNumber":344,"sourceCode":"\t\t\t\tenvVars[v.name] = v.value\n\t\t\t}\n\t\t\tconsole.log('[DAP] Parsed env vars:', Object.keys(envVars))\n\t\t\treturn envVars\n\t\t} catch (error) {\n\t\t\tconsole.error('Failed to fetch contextual variables:', error)\n\t\t\treturn {}\n\t\t}\n\t}\n\n\tasync function signDebugRequest(\n\t\tcodeToSign: string,\n\t\tlang: string\n\t): Promise<{\n\t\ttoken: string\n\t\tcode: string\n\t}> {\n\t\tif (!workspace) {\n\t\t\tthrow new Error('No workspace selected')\n\t\t}\n\n\t\tconst response = await fetch(`/api/w/${workspace}/debug/sign`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify({ code: codeToSign, language: lang })\n\t\t})\n\n\t\tif (!response.ok) {\n\t\t\tconst errorText = await response.text()\n\t\t\t// Parse specific error cases for better user messages\n\t\t\tif (errorText.includes('not initialized')) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Debug signing is not configured on the server. Please contact your administrator.'\n\t\t\t\t)\n\t\t\t}\n\t\t\tthrow new Error(errorText || 'Failed to authorize debug session')\n\t\t}","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/debug/MonacoDebugger.svelte#L326-L362","documentation":"signDebugRequest in MonacoDebugger.svelte signs debugger code via /api/w/{workspace}/debug/sign, but it requires an active workspace context. When the `workspace` variable is empty the request cannot even be built, so it throws 'No workspace selected'.","triggerScenarios":"startDebugging is invoked from the Monaco debugger while no workspace is selected — e.g. the debugger is opened in a context (instance-level page, stale store) where the workspace store has not been populated.","commonSituations":"Opening the debugger before selecting a workspace; workspace store not yet hydrated on first render; deep link into the debugger without a workspace path segment.","solutions":["Select a workspace before starting a debug session","Wait for the workspace store to hydrate (guard the debug button on a non-empty workspace)","Route to a workspace-scoped URL so `workspace` is defined when the debugger mounts"],"exampleFix":"// before\nawait signDebugRequest(code, lang)\n// after\nif (!workspace) {\n  sendUserToast('Select a workspace before debugging', true)\n  return\n}\nawait signDebugRequest(code, lang)","handlingStrategy":"validation","validationCode":"if (!workspace) { sendUserToast('Select a workspace first', true); return }\nawait startDebugging()","typeGuard":"function hasWorkspace(w: string | undefined | null): w is string { return typeof w === 'string' && w.length > 0 }","tryCatchPattern":"try { await startDebugging() } catch (e) { if (e.message === 'No workspace selected') { sendUserToast('Select a workspace first', true) } else { throw e } }","preventionTips":["Disable the debug button until a workspace is selected","Derive workspace from the route and guard on mount","Wait for workspace store hydration before enabling debugger actions"],"tags":["workspace","debugging","state"],"backgroundTag":"missing-workspace-context","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}