{"record":{"id":"5de3309538560020","repo":"wavetermdev/waveterm","slug":"no-workspaces-found","errorCode":null,"errorMessage":"no workspaces found","messagePattern":"no workspaces found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-blocks.go","lineNumber":115,"sourceCode":"\n// blocksListRun implements the 'blocks list' command\n// It retrieves and displays blocks with optional filtering by workspace, window, tab, or view type\nfunc blocksListRun(cmd *cobra.Command, args []string) error {\n\tif v := strings.TrimSpace(blocksView); v != \"\" {\n\t\tif !isKnownViewFilter(v) {\n\t\t\treturn fmt.Errorf(\"unknown --view %q; try one of: term, web, preview, edit, sysinfo, waveai\", v)\n\t\t}\n\t}\n\n\tvar allBlocks []BlockDetails\n\n\tworkspaces, err := wshclient.WorkspaceListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: int64(blocksTimeout)})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to list workspaces: %v\", err)\n\t}\n\n\tif len(workspaces) == 0 {\n\t\treturn fmt.Errorf(\"no workspaces found\")\n\t}\n\n\tvar workspaceIdsToQuery []string\n\n\t// Determine which workspaces to query\n\tif blocksWorkspaceId != \"\" && blocksWindowId != \"\" {\n\t\treturn fmt.Errorf(\"--workspace and --window are mutually exclusive; specify only one\")\n\t}\n\tif blocksWorkspaceId != \"\" {\n\t\tworkspaceIdsToQuery = []string{blocksWorkspaceId}\n\t} else if blocksWindowId != \"\" {\n\t\t// Find workspace ID for this window\n\t\twindowFound := false\n\t\tfor _, ws := range workspaces {\n\t\t\tif ws.WindowId == blocksWindowId {\n\t\t\t\tworkspaceIdsToQuery = []string{ws.WorkspaceData.OID}\n\t\t\t\twindowFound = true\n\t\t\t\tbreak","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-blocks.go#L97-L133","documentation":"Error from `wsh blocks list` when the WorkspaceList RPC succeeded but returned an empty list. Wave normally always has at least one workspace, so this signals a degenerate or broken server state. It is a guarded empty-result condition, not a transport failure.","triggerScenarios":"WorkspaceListCommand returns a zero-length slice: no workspaces exist in the running Wave instance (e.g. fresh/corrupted state where the default workspace was not created).","commonSituations":"Corrupted or freshly initialized Wave config where the default workspace is missing; running against a stubbed/dev server with no workspaces seeded.","solutions":["Restart Wave Terminal so the default workspace is recreated","Create a workspace in the Wave UI and retry","Inspect/reset ~/.waveterm config state if workspaces remain missing after restart"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"workspaces, err := wshclient.WorkspaceListCommand(RpcClient, nil)\nif err == nil && len(workspaces) == 0 {\n    // surface a targeted message or recreate the default workspace instead of proceeding\n}","typeGuard":"func hasWorkspaces(ws []wshrpc.WorkspaceInfo) bool { return len(ws) > 0 }","tryCatchPattern":"workspaces, err := listWorkspaces()\nif err != nil || len(workspaces) == 0 {\n    // restart Wave / recreate workspace\n}","preventionTips":["Keep at least one workspace open in Wave","Restart Wave after config corruption to regenerate the default workspace","Avoid wiping ~/.waveterm state without backing up"],"tags":["wsh","empty-result","state"],"backgroundTag":"empty-result-set","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}