wavetermdev/waveterm · error
getting ssh connection status: %w
Error message
getting ssh connection status: %w
What it means
Error from getAllConnStatus when the ConnStatusCommand RPC (SSH connection statuses) fails. The aggregator collects SSH then WSL statuses; failure of the SSH query aborts the whole status listing with this wrapper. Callers are `wsh conn status` and `wsh conn disconnectall`.
Source
Thrown at cmd/wsh/cmd/wshcmd-conn.go:93
connCmd.AddCommand(connConnectCmd)
connCmd.AddCommand(connEnsureCmd)
}
func validateConnectionName(name string) error {
if !strings.HasPrefix(name, "wsl://") {
_, err := remote.ParseOpts(name)
if err != nil {
return fmt.Errorf("cannot parse connection name: %w", err)
}
}
return nil
}
func getAllConnStatus() ([]wshrpc.ConnStatus, error) {
var allResp []wshrpc.ConnStatus
sshResp, err := wshclient.ConnStatusCommand(RpcClient, nil)
if err != nil {
return nil, fmt.Errorf("getting ssh connection status: %w", err)
}
allResp = append(allResp, sshResp...)
wslResp, err := wshclient.WslStatusCommand(RpcClient, nil)
if err != nil {
return nil, fmt.Errorf("getting wsl connection status: %w", err)
}
allResp = append(allResp, wslResp...)
return allResp, nil
}
func connStatusRun(cmd *cobra.Command, args []string) error {
allResp, err := getAllConnStatus()
if err != nil {
return err
}
if len(allResp) == 0 {
WriteStdout("no connections\n")
return nilView on GitHub (pinned to a4447c1563)
Solutions
- Ensure Wave Terminal is running and the wsh client is attached (`wsh conn status` retry)
- Reconnect the SSH/WSL session the command is running through
- Retry — transient IPC failures often resolve on rerun
- Update Wave Terminal/wsh on both ends to matching versions
Example fix
// before
sshResp, err := wshclient.ConnStatusCommand(RpcClient, nil)
if err != nil {
return nil, fmt.Errorf("getting ssh connection status: %w", err)
}
// after
sshResp, err := wshclient.ConnStatusCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 10000})
if err != nil {
return nil, fmt.Errorf("getting ssh connection status (is Wave running?): %w", err)
} Defensive patterns
Strategy: retry
Validate before calling
// ensure wsh can reach the Wave server first
if _, err := wshclient.ConnStatusCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 5000}); err != nil {
return fmt.Errorf("Wave unreachable; start the app before conn status: %w", err)
} Try / catch
statuses, err := getAllConnStatus()
if err != nil {
time.Sleep(2 * time.Second)
statuses, err = getAllConnStatus()
} Prevention
- Run wsh conn status only while Wave Terminal is running
- Keep local and remote wsh versions matched
- Retry transient IPC failures before treating them as fatal
When it happens
Trigger: ConnStatusCommand RPC fails: Wave server unreachable, RPC timeout, wsh not connected to a running Wave instance, or the RPC is unsupported by the remote version.
Common situations: Wave Terminal not running locally; wsh invoked remotely without an app route; transient IPC failure; version mismatch where the remote lacks ConnStatusCommand.
Related errors
- watching pid: %v
- connecting connection: %w
- no route id available
- source cannot be blank
- nil wshrpc passed to wshclient
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/6f41e1fe122d896a.
Report an issue: GitHub.