{"record":{"id":"e69ec83d6d87aac1","repo":"wavetermdev/waveterm","slug":"create-block-failed-v","errorCode":null,"errorMessage":"create block failed: %v","messagePattern":"create block failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-createblock.go","lineNumber":56,"sourceCode":"\tif tabId == \"\" {\n\t\treturn fmt.Errorf(\"no WAVETERM_TABID env var set\")\n\t}\n\tmeta, err := parseMetaSets(metaSetStrs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmeta[\"view\"] = viewName\n\tdata := wshrpc.CommandCreateBlockData{\n\t\tTabId: tabId,\n\t\tBlockDef: &waveobj.BlockDef{\n\t\t\tMeta: meta,\n\t\t},\n\t\tMagnified: createBlockMagnified,\n\t\tFocused:   true,\n\t}\n\toref, err := wshclient.CreateBlockCommand(RpcClient, data, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create block failed: %v\", err)\n\t}\n\tfmt.Printf(\"created block %s\\n\", oref.OID)\n\treturn nil\n}\n","sourceCodeStart":38,"sourceCodeEnd":61,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-createblock.go#L38-L61","documentation":"wsh createblock issues a CreateBlockCommand RPC through the connection to Wave and wraps any RPC failure in this error. The failure is in the remote call itself — the block was not created — so the OID is never printed.","triggerScenarios":"CreateBlockCommand returns an error: the RPC client lost connection to the Wave app, the referenced tabId no longer exists, the view name is invalid/rejected server-side, or the backend rejects the block data (bad meta values).","commonSituations":"Stale WAVETERM_TABID after the tab was closed; Wave app restarted so the connection/JWT is stale; invalid --meta syntax producing values the backend rejects; network drop to a remote connection.","solutions":["Re-run inside a live Wave tab (refresh WAVETERM_TABID if the tab was recreated)","Check the view name is one Wave supports (e.g. editor, web, terminal)","Validate --meta key=value pairs against allowed block meta keys","Confirm the wsh connection is healthy (run a simple command like `wsh ls`) and reconnect if stale"],"exampleFix":"// before\nwsh createblock mycustomview --meta foo=bar   # unknown view/meta\n// after\nwsh createblock preview --meta file=~/.zshrc  # valid view + meta","handlingStrategy":"try-catch","validationCode":"// pre-check the connection is alive before creating the block:\nif err := wshclient.ListBlocksCommand(RpcClient, nil); err != nil {\n\treturn fmt.Errorf(\"wave connection unavailable: %w\", err)\n}\n// and validate view/meta inputs against known-good values","typeGuard":null,"tryCatchPattern":"oref, err := wshclient.CreateBlockCommand(RpcClient, data, nil)\nif err != nil {\n\treturn fmt.Errorf(\"create block failed: %v (check tab is open and view/meta are valid)\", err)\n}","preventionTips":["Refresh WAVETERM_TABID if the tab was closed and recreated","Use supported view names (editor, web, preview, terminal, ...)","Validate --meta key=value pairs against allowed block meta keys","Verify connectivity with a cheap RPC before mutating commands","Keep wsh and Wave versions in sync"],"tags":["rpc","cli","wave-terminal","ipc"],"backgroundTag":"rpc-call-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}