{"record":{"id":"521a92827eefab66","repo":"wavetermdev/waveterm","slug":"error-listing-workspaces-w","errorCode":null,"errorMessage":"error listing workspaces: %w","messagePattern":"error listing workspaces: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wshrpc/wshserver/wshserver.go","lineNumber":950,"sourceCode":"\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tresults = append(results, wshrpc.BlocksListEntry{\n\t\t\t\t\tWindowId:    windowId,\n\t\t\t\t\tWorkspaceId: wsID,\n\t\t\t\t\tTabId:       tabID,\n\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}","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wshrpc/wshserver/wshserver.go#L932-L968","documentation":"Returned when listing workspaces from the workspace store fails. The underlying error is wrapped with %w.","triggerScenarios":"wcore.ListWorkspaces fails — e.g. errors reading workspace entries from wstore DB or corrupt workspace records.","commonSituations":"Database (wstore) read failures; corrupted or partially migrated workspace entries; internal state errors during startup.","solutions":["Inspect the wrapped underlying error for the root cause","Verify wstore DB integrity (check the wave database file is readable and not corrupted)","Retry after fixing any transient storage issues"],"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 listing workspaces\") {\n        errors.As(err, &inner) // inspect underlying wstore failure\n    }\n    return err\n}","preventionTips":["Keep the wave DB healthy and backed up","Watch for storage errors at startup","Use errors.As to unwrap the root cause"],"tags":["workspace","wstore","rpc","wrapped-error"],"backgroundTag":"workspace-list-failure","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}