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

  1. Confirm the Wave app is running and the tab is still open
  2. Retry; transient network slowness can exceed the 2s timeout
  3. Check connection health (`wsh conn status` or test the SSH host) before retrying
  4. 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

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


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