wavetermdev/waveterm · error

failed to list blocks from all %d workspace(s)

Error message

failed to list blocks from all %d workspace(s)

What it means

Aggregated failure from `wsh blocks list` when zero blocks were collected AND at least one queried workspace errored (hadSuccess is false). Because no workspace answered and no blocks exist, the command distinguishes 'no blocks' from 'every query failed' and reports the latter with the number of workspaces attempted.

Source

Thrown at cmd/wsh/cmd/wshcmd-blocks.go:190

					continue
				}
			}

			v := b.Meta.GetString(waveobj.MetaKey_View, "")
			allBlocks = append(allBlocks, BlockDetails{
				BlockId:     b.BlockId,
				WorkspaceId: b.WorkspaceId,
				TabId:       b.TabId,
				View:        v,
				Meta:        b.Meta,
			})
		}
	}

	// No blocks found check
	if len(allBlocks) == 0 {
		if !hadSuccess {
			return fmt.Errorf("failed to list blocks from all %d workspace(s)", len(workspaceIdsToQuery))
		}
		WriteStdout("No blocks found\n")
		return nil
	}

	// Stable ordering for both JSON and table output
	sort.SliceStable(allBlocks, func(i, j int) bool {
		if allBlocks[i].WorkspaceId != allBlocks[j].WorkspaceId {
			return allBlocks[i].WorkspaceId < allBlocks[j].WorkspaceId
		}
		if allBlocks[i].TabId != allBlocks[j].TabId {
			return allBlocks[i].TabId < allBlocks[j].TabId
		}
		return allBlocks[i].BlockId < allBlocks[j].BlockId
	})

	// Output results
	if blocksJSON {

View on GitHub (pinned to a4447c1563)

Solutions

  1. Check connection health (`wsh conn status`) and retry
  2. Increase --timeout to allow workspace block queries to complete
  3. Drop --workspace/--window filters to query all workspaces fresh
  4. Upgrade the remote wsh/Wave if the get-blocks RPC is unsupported

Example fix

// before
wsh blocks list --timeout 2
// after
wsh blocks list --timeout 30
Defensive patterns

Strategy: retry

Validate before calling

// preflight: at least one reachable workspace
if _, err := wshclient.WorkspaceListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 10000}); err != nil {
    return fmt.Errorf("no workspaces reachable, aborting block listing: %w", err)
}

Try / catch

blocks, err := listAllBlocks()
if err != nil {
    // increase timeout / reconnect, then retry once
    blocks, err = listAllBlocksWithTimeout(30 * time.Second)
}

Prevention

When it happens

Trigger: All per-workspace get-blocks RPCs fail (connection down, timeouts, unsupported RPC) so allBlocks stays empty and hadSuccess never becomes true; called with N workspace ids in workspaceIdsToQuery.

Common situations: Network outage while listing a remote connection's blocks; --timeout too small so every workspace query times out; all targeted workspace ids stale/closed.

Related errors


AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01). Data as JSON: /api/errors/ba37e9048f45d8de. Report an issue: GitHub.