{"record":{"id":"54347a7bf8745804","repo":"wavetermdev/waveterm","slug":"failed-to-list-workspaces-v","errorCode":null,"errorMessage":"failed to list workspaces: %v","messagePattern":"failed to list workspaces: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-blocks.go","lineNumber":111,"sourceCode":"\n\tblocksCmd.AddCommand(blocksListCmd)\n\trootCmd.AddCommand(blocksCmd)\n}\n\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 {","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-blocks.go#L93-L129","documentation":"Error from `wsh blocks list` when the WorkspaceListCommand RPC fails. The command cannot enumerate the terminal's workspaces, which is the first step of listing blocks, so it aborts with this wrapper around the underlying RPC error. It indicates a transport or server-side problem rather than an empty result.","triggerScenarios":"Calling WorkspaceListCommand over a connRoute where the Wave server is unreachable, the RPC times out (blocksTimeout too small), the remote does not implement the workspace list RPC, or the wsh client is not attached to a running Wave instance.","commonSituations":"Running wsh remotely without `wsh board`/connected app context; Wave Terminal not running; timeout too aggressive in slow network conditions; version mismatch missing the RPC.","solutions":["Check `wsh conn status` / ensure Wave Terminal is running and reachable","Increase --timeout so the WorkspaceList RPC can complete","Reconnect the SSH/WSL connection and retry","Verify the remote Wave/wsh version supports WorkspaceListCommand"],"exampleFix":"// before\nworkspaces, err := wshclient.WorkspaceListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: int64(blocksTimeout)})\n// after\nworkspaces, err := wshclient.WorkspaceListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: int64(blocksTimeout), NoHandleErr: true})\nif err != nil {\n    return fmt.Errorf(\"failed to list workspaces (is Wave running and connection alive?): %w\", err)\n}","handlingStrategy":"retry","validationCode":"// confirm Wave is reachable before the RPC\nif _, err := wshclient.WorkspaceListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 5000}); err != nil {\n    return fmt.Errorf(\"Wave not reachable, start the app or reconnect: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"var workspaces []wshrpc.WorkspaceInfo\nvar err error\nfor i := 0; i < 3 && err != nil; i++ {\n    workspaces, err = wshclient.WorkspaceListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 10000})\n    time.Sleep(time.Second)\n}","preventionTips":["Start Wave Terminal before running wsh block/workspace commands","Set a generous --timeout on slow/remote connections","Check `wsh conn status` as a preflight"],"tags":["rpc","network","wsh","timeout"],"backgroundTag":"rpc-call-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}