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

  1. Re-run inside a live Wave tab (refresh WAVETERM_TABID if the tab was recreated)
  2. Check the view name is one Wave supports (e.g. editor, web, terminal)
  3. Validate --meta key=value pairs against allowed block meta keys
  4. 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

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


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