wavetermdev/waveterm · error
getting path: %w
Error message
getting path: %w
What it means
This wraps any error returned by the wshclient.PathCommand RPC, which asks the Wave server for the requested path. The failure happened server-side or in transport, not in local argument validation; the original error is preserved via %w.
Source
Thrown at cmd/wsh/cmd/wshcmd-wavepath.go:71
return fmt.Errorf("--tail can only be used with the log path type")
}
open, _ := cmd.Flags().GetBool("open")
openExternal, _ := cmd.Flags().GetBool("open-external")
tabId := getTabIdFromEnv()
if tabId == "" {
return fmt.Errorf("no WAVETERM_TABID env var set")
}
path, err := wshclient.PathCommand(RpcClient, wshrpc.PathCommandData{
PathType: pathType,
Open: open,
OpenExternal: openExternal,
TabId: tabId,
}, nil)
if err != nil {
return fmt.Errorf("getting path: %w", err)
}
if tail && pathType == "log" {
err = tailLogFile(path)
if err != nil {
return fmt.Errorf("tailing log file: %w", err)
}
return nil
}
WriteStdout("%s\n", path)
return nil
}
func tailLogFile(path string) error {
file, err := os.Open(path)
if err != nil {
return fmt.Errorf("opening log file: %w", err)View on GitHub (pinned to a4447c1563)
Solutions
- Inspect the wrapped cause in the error output for the root reason (connection vs. path).
- Verify the terminal connection: run another wsh RPC command like `wsh ls` to test connectivity.
- Check that the WAVETERM_TABID refers to an open tab.
- Check OS permissions on the Wave config/data/log directories.
Example fix
// before
tabId := getTabIdFromEnv()
// after
if tabId == "" { return errors.New("WAVETERM_TABID not set") } // catch stale/empty tab ids before RPC Defensive patterns
Strategy: try-catch
Validate before calling
wsh ls >/dev/null 2>&1 || { echo "wsh RPC unavailable" >&2; exit 1; } Try / catch
path, err := wshclient.PathCommand(RpcClient, data, nil)
if err != nil {
var connErr *net.OpError
if errors.As(err, &connErr) { /* reconnect terminal */ }
return fmt.Errorf("getting path: %w", err)
} Prevention
- Test RPC connectivity with a cheap command before scripting against wsh.
- Keep Wave Terminal running and connections fresh.
- Check the wrapped cause with errors.Unwrap/As for the root reason.
When it happens
Trigger: The RPC to the Wave server fails: no connection to the terminal, server rejected the path type or tab id, or the underlying path lookup fails (e.g. wave data dir missing, permission denied).
Common situations: wsh run against an unreachable/stale terminal connection, an invalid TabId pointing to a closed tab, or OS-level permission problems on the Wave config/data/log directories.
Related errors
- failed to list workspaces: %v
- failed to list blocks from all %d workspace(s)
- getting variable: %w
- getting variables: %w
- getting connected job ids: %w
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/afe1af6c2c776d1e.
Report an issue: GitHub.