{"record":{"id":"5d922c61a7a2470c","repo":"wavetermdev/waveterm","slug":"no-window-found-with-workspace-data-workspaceid","errorCode":null,"errorMessage":"no window found with workspace ${data.workspaceid}","messagePattern":"no window found with workspace (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"emain/emain-wsh.ts","lineNumber":24,"sourceCode":"import { RpcApi } from \"@/app/store/wshclientapi\";\nimport { Notification, net, safeStorage, shell } from \"electron\";\nimport { getResolvedUpdateChannel } from \"emain/updater\";\nimport { unamePlatform } from \"./emain-platform\";\nimport { getWebContentsByBlockId, webGetSelector } from \"./emain-web\";\nimport { createBrowserWindow, getWaveWindowById, getWaveWindowByWorkspaceId } from \"./emain-window\";\n\nexport class ElectronWshClientType extends WshClient {\n    constructor() {\n        super(\"electron\");\n    }\n\n    async handle_webselector(rh: RpcResponseHelper, data: CommandWebSelectorData): Promise<string[]> {\n        if (!data.tabid || !data.blockid || !data.workspaceid) {\n            throw new Error(\"tabid and blockid are required\");\n        }\n        const ww = getWaveWindowByWorkspaceId(data.workspaceid);\n        if (ww == null) {\n            throw new Error(`no window found with workspace ${data.workspaceid}`);\n        }\n        const wc = await getWebContentsByBlockId(ww, data.tabid, data.blockid);\n        if (wc == null) {\n            throw new Error(`no webcontents found with blockid ${data.blockid}`);\n        }\n        const rtn = await webGetSelector(wc, data.selector, data.opts);\n        return rtn;\n    }\n\n    async handle_notify(rh: RpcResponseHelper, notificationOptions: WaveNotificationOptions) {\n        new Notification({\n            title: notificationOptions.title,\n            body: notificationOptions.body,\n            silent: notificationOptions.silent,\n        }).show();\n    }\n\n    async handle_getupdatechannel(rh: RpcResponseHelper): Promise<string> {","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/emain/emain-wsh.ts#L6-L42","documentation":"CpWshToRemote copies the local wsh binary to the remote host by piping it through `cat`. Before streaming, it opens the local file at wshLocalPath with os.Open; if that fails, this error wraps the open failure. The copy cannot proceed without a readable local wsh binary.","triggerScenarios":"InstallWsh or UpdateWsh call CpWshToRemote and os.Open fails on wshLocalPath — file missing, path wrong, or permission denied.","commonSituations":"wsh binary was never downloaded to the expected local path; antivirus quarantined the binary; running under a user lacking read permission; partial update deleted the file mid-flight.","solutions":["Check the file exists at wshLocalPath (stat it) and re-download/install wsh if missing","Fix filesystem permissions on the file (`chmod +r`) or run as a user with access","Check antivirus/Defender quarantine logs for the wsh binary","Verify the code that populates wshLocalPath resolved the correct directory (wavebase config dir)"],"exampleFix":"// before\nerr := wslconn.CpWshToRemote(ctx, conn, wshLocalPath, remotePath)\n// after\nif _, err := os.Stat(wshLocalPath); err != nil {\n    return fmt.Errorf(\"local wsh binary missing at %s, reinstall wsh first\", wshLocalPath)\n}\nerr := wslconn.CpWshToRemote(ctx, conn, wshLocalPath, remotePath)","handlingStrategy":"validation","validationCode":"if fi, err := os.Stat(wshLocalPath); err != nil || fi.IsDir() {\n    return fmt.Errorf(\"wsh binary missing at %s: reinstall wsh\", wshLocalPath)\n}","typeGuard":null,"tryCatchPattern":"err := wslconn.CpWshToRemote(ctx, conn, wshLocalPath, remotePath)\nif err != nil && strings.Contains(err.Error(), \"cannot open local file\") {\n    // re-download the wsh binary and retry\n}","preventionTips":["Stat the local wsh binary before every install/update","Exclude the wsh binary directory from antivirus scans","Ensure the install flow always completes the download before starting a copy"],"tags":["wsl","file-io","wsh-install","copy"],"backgroundTag":"file-not-found","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}