{"record":{"id":"fa0403144e55848f","repo":"wavetermdev/waveterm","slug":"creating-block-w","errorCode":null,"errorMessage":"creating block: %w","messagePattern":"creating block: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-web.go","lineNumber":137,"sourceCode":"\n\twshCmd := wshrpc.CommandCreateBlockData{\n\t\tTabId: tabId,\n\t\tBlockDef: &waveobj.BlockDef{\n\t\t\tMeta: map[string]any{\n\t\t\t\twaveobj.MetaKey_View: \"web\",\n\t\t\t\twaveobj.MetaKey_Url:  args[0],\n\t\t\t},\n\t\t},\n\t\tMagnified: webOpenMagnified,\n\t\tFocused:   true,\n\t}\n\tif replaceBlockORef != nil {\n\t\twshCmd.TargetBlockId = replaceBlockORef.OID\n\t\twshCmd.TargetAction = wshrpc.CreateBlockAction_Replace\n\t}\n\toref, err := wshclient.CreateBlockCommand(RpcClient, wshCmd, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating block: %w\", err)\n\t}\n\tWriteStdout(\"created block %s\\n\", oref)\n\treturn nil\n}\n","sourceCodeStart":119,"sourceCodeEnd":142,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-web.go#L119-L142","documentation":"After building the CommandCreateBlockData, webOpenRun calls CreateBlockCommand over wsh RPC to create (or replace into) the web block. Any RPC failure — unreachable server, invalid tab id, invalid target block — is wrapped with \"creating block:\".","triggerScenarios":"`wsh web open <url>` where the Wave server rejects CreateBlockCommand: tab no longer exists, replace target block was closed, or the RPC connection dropped.","commonSituations":"Race where the tab or target block closed between resolution and creation; running from a stale wsh session; server-side validation rejecting the BlockDef meta.","solutions":["Re-run the command from a live Wave tab (refresh WAVETERM_TABID)","Verify the --replace target block is still open","Check wsh connectivity (wsh ls succeeds) before retrying"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure connectivity and target validity first\nif _, err := wshclient.BlockInfoCommand(RpcClient, replaceOID, nil); err != nil {\n    return fmt.Errorf(\"replace target unavailable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"oref, err := wshclient.CreateBlockCommand(RpcClient, wshCmd, nil)\nif err != nil {\n    return fmt.Errorf(\"creating block: %w\", err)\n}","preventionTips":["Retry creation with backoff on transient RPC failures","Re-check that the tab and replace-target still exist before creating","Keep wsh sessions short-lived and re-run from a live tab"],"tags":["cli","rpc","wave-terminal"],"backgroundTag":"create-block-rpc-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}