{"record":{"id":"3c7573e346c3b68d","repo":"wavetermdev/waveterm","slug":"error-getting-workspace-w-3c7573","errorCode":null,"errorMessage":"error getting workspace: %w","messagePattern":"error getting workspace: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshrpc/wshserver/wshserver.go","lineNumber":956,"sourceCode":"\t\t\t\t\tBlockId:     blkID,\n\t\t\t\t\tMeta:        blk.Meta,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\treturn results, nil\n}\n\nfunc (ws *WshServer) WorkspaceListCommand(ctx context.Context) ([]wshrpc.WorkspaceInfoData, error) {\n\tworkspaceList, err := wcore.ListWorkspaces(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing workspaces: %w\", err)\n\t}\n\tvar rtn []wshrpc.WorkspaceInfoData\n\tfor _, workspaceEntry := range workspaceList {\n\t\tworkspaceData, err := wcore.GetWorkspace(ctx, workspaceEntry.WorkspaceId)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error getting workspace: %w\", err)\n\t\t}\n\t\trtn = append(rtn, wshrpc.WorkspaceInfoData{\n\t\t\tWindowId:      workspaceEntry.WindowId,\n\t\t\tWorkspaceData: workspaceData,\n\t\t})\n\t}\n\treturn rtn, nil\n}\n\nfunc (ws *WshServer) ListAllAppsCommand(ctx context.Context) ([]wshrpc.AppInfo, error) {\n\treturn waveappstore.ListAllApps()\n}\n\nfunc (ws *WshServer) ListAllEditableAppsCommand(ctx context.Context) ([]wshrpc.AppInfo, error) {\n\treturn waveappstore.ListAllEditableApps()\n}\n\nfunc (ws *WshServer) ListAllAppFilesCommand(ctx context.Context, data wshrpc.CommandListAllAppFilesData) (*wshrpc.CommandListAllAppFilesRtnData, error) {","sourceCodeStart":938,"sourceCodeEnd":974,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshrpc/wshserver/wshserver.go#L938-L974","documentation":"Returned when retrieving a specific workspace fails, e.g. it does not exist or the store lookup errored. The underlying error is wrapped with %w.","triggerScenarios":"A workspace ID returned by ListWorkspaces no longer resolves in wstore — e.g. stale/dangling WindowId workspace reference or a deleted workspace entry.","commonSituations":"Dangling references after a workspace was deleted while a window still pointed at it; DB corruption; partial writes during crashes.","solutions":["Inspect the wrapped error to identify which workspace failed to load","Remove/repair the dangling workspace entry in the wave DB","Re-open windows/workspaces so references are rebuilt"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"workspaces, err := client.WorkspaceListCommand(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"error getting workspace\") {\n        // dangling workspace reference; clean up wstore entries\n    }\n    return err\n}","preventionTips":["Clean up workspace entries when deleting windows/workspaces","Avoid force-deleting DB records while windows reference them","Handle partial listing gracefully instead of failing on first bad entry"],"tags":["workspace","wstore","rpc","dangling-reference"],"backgroundTag":"workspace-not-found","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}