{"record":{"id":"7a8f75e87dd69a9f","repo":"wavetermdev/waveterm","slug":"error-getting-block-metadata-w","errorCode":null,"errorMessage":"error getting block metadata: %w","messagePattern":"error getting block metadata: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-termscrollback.go","lineNumber":62,"sourceCode":"}\n\nfunc termScrollbackRun(cmd *cobra.Command, args []string) (rtnErr error) {\n\tdefer func() {\n\t\tsendActivity(\"termscrollback\", rtnErr == nil)\n\t}()\n\n\t// Resolve the block argument\n\tfullORef, err := resolveBlockArg()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get block metadata to verify it's a terminal block\n\tmetaData, err := wshclient.GetMetaCommand(RpcClient, wshrpc.CommandGetMetaData{\n\t\tORef: *fullORef,\n\t}, &wshrpc.RpcOpts{Timeout: 2000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error getting block metadata: %w\", err)\n\t}\n\n\t// Check if the block is a terminal block\n\tviewType, ok := metaData[waveobj.MetaKey_View].(string)\n\tif !ok || viewType != \"term\" {\n\t\treturn fmt.Errorf(\"block %s is not a terminal block (view type: %s)\", fullORef.OID, viewType)\n\t}\n\n\t// Make the RPC call to get scrollback\n\tscrollbackData := wshrpc.CommandTermGetScrollbackLinesData{\n\t\tLineStart:   termScrollbackLineStart,\n\t\tLineEnd:     termScrollbackLineEnd,\n\t\tLastCommand: termScrollbackLastCmd,\n\t}\n\n\tresult, err := wshclient.TermGetScrollbackLinesCommand(RpcClient, scrollbackData, &wshrpc.RpcOpts{\n\t\tRoute:   wshutil.MakeFeBlockRouteId(fullORef.OID),\n\t\tTimeout: 5000,","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-termscrollback.go#L44-L80","documentation":"`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.","triggerScenarios":"GetMetaCommand returning an error for the resolved block ORef: invalid/unknown OID, RPC timeout (2000ms), or no running Wave app to serve the request.","commonSituations":"Typing a wrong block OID argument; the referenced block was deleted; network/route issues between wsh and the Wave app.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// resolve and sanity-check the OID before the RPC\nif !isValidOID(oid) {\n\treturn fmt.Errorf(\"invalid block OID: %s\", oid)\n}","typeGuard":null,"tryCatchPattern":"metaData, err := wshclient.GetMetaCommand(RpcClient, wshrpc.CommandGetMetaData{ORef: *fullORef}, &wshrpc.RpcOpts{Timeout: 2000})\nif err != nil {\n\tif errors.Is(err, context.DeadlineExceeded) {\n\t\t// retry once with a longer timeout\n\t}\n\treturn fmt.Errorf(\"error getting block metadata: %w\", err)\n}","preventionTips":["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."],"tags":["rpc","cli","metadata"],"backgroundTag":"rpc-call-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}