wavetermdev/waveterm · error
opening config file: %w
Error message
opening config file: %w
What it means
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).
Source
Thrown at cmd/wsh/cmd/wshcmd-editconfig.go:60
if tabId == "" {
return fmt.Errorf("no WAVETERM_TABID env var set")
}
wshCmd := &wshrpc.CommandCreateBlockData{
TabId: tabId,
BlockDef: &waveobj.BlockDef{
Meta: map[string]interface{}{
waveobj.MetaKey_View: "waveconfig",
waveobj.MetaKey_File: configFile,
},
},
Magnified: editConfigMagnified,
Focused: true,
}
_, err := wshclient.CreateBlockCommand(RpcClient, *wshCmd, &wshrpc.RpcOpts{Timeout: 2000})
if err != nil {
return fmt.Errorf("opening config file: %w", err)
}
return nil
}
View on GitHub (pinned to a4447c1563)
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
Example fix
// before wsh editconfig # tab closed -> error // after # open/switch to a live tab, then wsh editconfig
Defensive patterns
Strategy: retry
Validate before calling
if os.Getenv("WAVETERM_TABID") == "" {
return errors.New("no tab context; CreateBlock would fail")
} Try / catch
if err := wsh.EditConfig(); err != nil {
if strings.Contains(err.Error(), "opening config file") {
time.Sleep(1 * time.Second)
err = wsh.EditConfig() // retry after transient RPC failure
}
} Prevention
- Verify the target tab is still open before creating blocks
- Check RPC connectivity with `wsh status`
- Retry once on timeout before surfacing the error
When it happens
Trigger: CreateBlockCommand returning an error: invalid tab id, unknown controller type, server rejecting the blockdef, or RPC timeout/disconnection during creation.
Common situations: 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.
Related errors
- delete block failed: %v
- failed to list workspaces: %v
- failed to list blocks from all %d workspace(s)
- running view command: %w
- appending chunk to file: %w
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/8cab3f20f6eb1e7f.
Report an issue: GitHub.