wavetermdev/waveterm · error
error getting block metadata: %w
Error message
error getting block metadata: %w
What it means
`wsh termescrollback` first fetches the target block's metadata via GetMetaCommand to verify it is a terminal block. If that RPC fails (no Wave app, bad OID, timeout beyond the 2s limit), the CLI wraps the cause with this message.
Source
Thrown at cmd/wsh/cmd/wshcmd-termscrollback.go:62
}
func termScrollbackRun(cmd *cobra.Command, args []string) (rtnErr error) {
defer func() {
sendActivity("termscrollback", rtnErr == nil)
}()
// Resolve the block argument
fullORef, err := resolveBlockArg()
if err != nil {
return err
}
// Get block metadata to verify it's a terminal block
metaData, err := wshclient.GetMetaCommand(RpcClient, wshrpc.CommandGetMetaData{
ORef: *fullORef,
}, &wshrpc.RpcOpts{Timeout: 2000})
if err != nil {
return fmt.Errorf("error getting block metadata: %w", err)
}
// Check if the block is a terminal block
viewType, ok := metaData[waveobj.MetaKey_View].(string)
if !ok || viewType != "term" {
return fmt.Errorf("block %s is not a terminal block (view type: %s)", fullORef.OID, viewType)
}
// Make the RPC call to get scrollback
scrollbackData := wshrpc.CommandTermGetScrollbackLinesData{
LineStart: termScrollbackLineStart,
LineEnd: termScrollbackLineEnd,
LastCommand: termScrollbackLastCmd,
}
result, err := wshclient.TermGetScrollbackLinesCommand(RpcClient, scrollbackData, &wshrpc.RpcOpts{
Route: wshutil.MakeFeBlockRouteId(fullORef.OID),
Timeout: 5000,View on GitHub (pinned to a4447c1563)
Solutions
- Verify the block OID is correct and the block still exists in the Wave app.
- Ensure the Wave app is running and wsh is connected; retry.
- Increase tolerance for slow responses by checking the connection; the 2s timeout may be too short on a busy app.
Defensive patterns
Strategy: validation
Validate before calling
// resolve and sanity-check the OID before the RPC
if !isValidOID(oid) {
return fmt.Errorf("invalid block OID: %s", oid)
} Try / catch
metaData, err := wshclient.GetMetaCommand(RpcClient, wshrpc.CommandGetMetaData{ORef: *fullORef}, &wshrpc.RpcOpts{Timeout: 2000})
if err != nil {
if errors.Is(err, context.DeadlineExceeded) {
// retry once with a longer timeout
}
return fmt.Errorf("error getting block metadata: %w", err)
} Prevention
- Copy block OIDs directly from the Wave UI to avoid typos.
- Confirm the block exists (`wsh getmeta <oid>`) before dependent commands.
- Keep the Wave app running so metadata RPCs don't time out.
When it happens
Trigger: GetMetaCommand returning an error for the resolved block ORef: invalid/unknown OID, RPC timeout (2000ms), or no running Wave app to serve the request.
Common situations: Typing a wrong block OID argument; the referenced block was deleted; network/route issues between wsh and the Wave app.
Related errors
- playing system bell: %v
- watching pid: %v
- getting wsl connection status: %w
- reinstalling connection: %w
- disconnecting %q error: %w
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/7a8f75e87dd69a9f.
Report an issue: GitHub.