{"record":{"id":"88004ab38849090b","repo":"wavetermdev/waveterm","slug":"running-view-command-w-88004a","errorCode":null,"errorMessage":"running view command: %w","messagePattern":"running view command: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-view.go","lineNumber":111,"sourceCode":"\t\t\tBlockDef: &waveobj.BlockDef{\n\t\t\t\tMeta: map[string]interface{}{\n\t\t\t\t\twaveobj.MetaKey_View: \"preview\",\n\t\t\t\t\twaveobj.MetaKey_File: absFile,\n\t\t\t\t},\n\t\t\t},\n\t\t\tMagnified: viewMagnified,\n\t\t\tFocused:   true,\n\t\t}\n\t\tif cmdName == \"edit\" {\n\t\t\twshCmd.BlockDef.Meta[waveobj.MetaKey_Edit] = true\n\t\t}\n\t\tif conn != \"\" {\n\t\t\twshCmd.BlockDef.Meta[waveobj.MetaKey_Connection] = conn\n\t\t}\n\t}\n\t_, err := wshclient.CreateBlockCommand(RpcClient, *wshCmd, &wshrpc.RpcOpts{Timeout: 2000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"running view command: %w\", err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":93,"sourceCodeEnd":115,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-view.go#L93-L115","documentation":"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'.","triggerScenarios":"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).","commonSituations":"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.","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)"],"exampleFix":"// before\n$ wsh view notes.md   # Wave app closed -> running view command: ...timeout\n\n// after\n$ # start Wave, open a terminal block, then:\n$ wsh view notes.md","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"_, err := wshclient.CreateBlockCommand(RpcClient, *wshCmd, &wshrpc.RpcOpts{Timeout: 2000})\nif err != nil {\n  if errors.Is(err, context.DeadlineExceeded) {\n    // retry once with a longer timeout\n  }\n  return fmt.Errorf(\"running view command: %w\", err)\n}","preventionTips":["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"],"tags":["cli","rpc","network","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"}