wavetermdev/waveterm · error
create block failed: %v
Error message
create block failed: %v
What it means
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.
Source
Thrown at cmd/wsh/cmd/wshcmd-createblock.go:56
if tabId == "" {
return fmt.Errorf("no WAVETERM_TABID env var set")
}
meta, err := parseMetaSets(metaSetStrs)
if err != nil {
return err
}
meta["view"] = viewName
data := wshrpc.CommandCreateBlockData{
TabId: tabId,
BlockDef: &waveobj.BlockDef{
Meta: meta,
},
Magnified: createBlockMagnified,
Focused: true,
}
oref, err := wshclient.CreateBlockCommand(RpcClient, data, nil)
if err != nil {
return fmt.Errorf("create block failed: %v", err)
}
fmt.Printf("created block %s\n", oref.OID)
return nil
}
View on GitHub (pinned to a4447c1563)
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
Example fix
// before wsh createblock mycustomview --meta foo=bar # unknown view/meta // after wsh createblock preview --meta file=~/.zshrc # valid view + meta
Defensive patterns
Strategy: try-catch
Validate before calling
// pre-check the connection is alive before creating the block:
if err := wshclient.ListBlocksCommand(RpcClient, nil); err != nil {
return fmt.Errorf("wave connection unavailable: %w", err)
}
// and validate view/meta inputs against known-good values Try / catch
oref, err := wshclient.CreateBlockCommand(RpcClient, data, nil)
if err != nil {
return fmt.Errorf("create block failed: %v (check tab is open and view/meta are valid)", err)
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- opening secrets UI: %w
- getting block info: %w
- creating block: %w
- playing system bell: %v
- watching pid: %v
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/e69ec83d6d87aac1.
Report an issue: GitHub.