wavetermdev/waveterm · error
running view command: %w
Error message
running view command: %w
What it means
Once the CommandCreateBlockData is built, viewRun issues the CreateBlockCommand RPC to the Wave server with a 2-second timeout. Any RPC failure — server unreachable, connection error, timeout, or server-side rejection — is wrapped and surfaced as 'running view command'.
Source
Thrown at cmd/wsh/cmd/wshcmd-view.go:111
BlockDef: &waveobj.BlockDef{
Meta: map[string]interface{}{
waveobj.MetaKey_View: "preview",
waveobj.MetaKey_File: absFile,
},
},
Magnified: viewMagnified,
Focused: true,
}
if cmdName == "edit" {
wshCmd.BlockDef.Meta[waveobj.MetaKey_Edit] = true
}
if conn != "" {
wshCmd.BlockDef.Meta[waveobj.MetaKey_Connection] = conn
}
}
_, err := wshclient.CreateBlockCommand(RpcClient, *wshCmd, &wshrpc.RpcOpts{Timeout: 2000})
if err != nil {
return fmt.Errorf("running view command: %w", err)
}
return nil
}
View on GitHub (pinned to a4447c1563)
Solutions
- Confirm the Wave app is running and the tab is still open
- Retry; transient network slowness can exceed the 2s timeout
- Check connection health (`wsh conn status` or test the SSH host) before retrying
- Ensure WAVETERM_TABID matches a live tab (open a fresh Wave block and rerun)
Example fix
// before $ wsh view notes.md # Wave app closed -> running view command: ...timeout // after $ # start Wave, open a terminal block, then: $ wsh view notes.md
Defensive patterns
Strategy: try-catch
Try / catch
_, err := wshclient.CreateBlockCommand(RpcClient, *wshCmd, &wshrpc.RpcOpts{Timeout: 2000})
if err != nil {
if errors.Is(err, context.DeadlineExceeded) {
// retry once with a longer timeout
}
return fmt.Errorf("running view command: %w", err)
} Prevention
- Keep the Wave app running while issuing wsh commands
- Verify connection health before --conn invocations
- Retry on timeout; check tab liveness if the create-block is rejected
When it happens
Trigger: The CreateBlockCommand RPC fails: Wave server not running/unreachable, RpcContext connection to a remote host fails, RPC exceeds the 2000ms timeout, or the server rejects the create-block request (bad tab id, invalid block def).
Common situations: Wave app closed while a wsh command runs; stale WAVETERM_TABID pointing at a closed tab; slow remote connection blowing the 2s timeout; `wsh --conn` to an unreachable SSH host.
Related errors
- failed to list workspaces: %v
- failed to list blocks from all %d workspace(s)
- reinstalling connection: %w
- disconnecting %q error: %w
- ensuring connection: %w
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/88004ab38849090b.
Report an issue: GitHub.