{"record":{"id":"8cab3f20f6eb1e7f","repo":"wavetermdev/waveterm","slug":"opening-config-file-w","errorCode":null,"errorMessage":"opening config file: %w","messagePattern":"opening config file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-editconfig.go","lineNumber":60,"sourceCode":"\tif tabId == \"\" {\n\t\treturn fmt.Errorf(\"no WAVETERM_TABID env var set\")\n\t}\n\n\twshCmd := &wshrpc.CommandCreateBlockData{\n\t\tTabId: tabId,\n\t\tBlockDef: &waveobj.BlockDef{\n\t\t\tMeta: map[string]interface{}{\n\t\t\t\twaveobj.MetaKey_View: \"waveconfig\",\n\t\t\t\twaveobj.MetaKey_File: configFile,\n\t\t\t},\n\t\t},\n\t\tMagnified: editConfigMagnified,\n\t\tFocused:   true,\n\t}\n\n\t_, err := wshclient.CreateBlockCommand(RpcClient, *wshCmd, &wshrpc.RpcOpts{Timeout: 2000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"opening config file: %w\", err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":42,"sourceCodeEnd":64,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-editconfig.go#L42-L64","documentation":"The CreateBlockCommand RPC used to open the config file editor block in the Wave UI failed; editConfigRun wraps it as \"opening config file\". The connection was established but block creation was rejected or timed out (2000ms).","triggerScenarios":"CreateBlockCommand returning an error: invalid tab id, unknown controller type, server rejecting the blockdef, or RPC timeout/disconnection during creation.","commonSituations":"WAVETERM_TABID referencing a tab that was closed; wsh connected to a stale server after a Wave restart; transient network issue on a remote connection.","solutions":["Verify the tab id is still valid (tab still open)","Retry the command after checking `wsh status`","Inspect the wrapped inner error for the server's rejection reason","Restart the Wave terminal connection if the RPC layer is stale"],"exampleFix":"// before\nwsh editconfig  # tab closed -> error\n// after\n# open/switch to a live tab, then\nwsh editconfig","handlingStrategy":"retry","validationCode":"if os.Getenv(\"WAVETERM_TABID\") == \"\" {\n    return errors.New(\"no tab context; CreateBlock would fail\")\n}","typeGuard":null,"tryCatchPattern":"if err := wsh.EditConfig(); err != nil {\n    if strings.Contains(err.Error(), \"opening config file\") {\n        time.Sleep(1 * time.Second)\n        err = wsh.EditConfig() // retry after transient RPC failure\n    }\n}","preventionTips":["Verify the target tab is still open before creating blocks","Check RPC connectivity with `wsh status`","Retry once on timeout before surfacing the error"],"tags":["rpc","network","block"],"backgroundTag":"rpc-call-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}