{"record":{"id":"6f41e1fe122d896a","repo":"wavetermdev/waveterm","slug":"getting-ssh-connection-status-w","errorCode":null,"errorMessage":"getting ssh connection status: %w","messagePattern":"getting ssh connection status: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-conn.go","lineNumber":93,"sourceCode":"\tconnCmd.AddCommand(connConnectCmd)\n\tconnCmd.AddCommand(connEnsureCmd)\n}\n\nfunc validateConnectionName(name string) error {\n\tif !strings.HasPrefix(name, \"wsl://\") {\n\t\t_, err := remote.ParseOpts(name)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"cannot parse connection name: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc getAllConnStatus() ([]wshrpc.ConnStatus, error) {\n\tvar allResp []wshrpc.ConnStatus\n\tsshResp, err := wshclient.ConnStatusCommand(RpcClient, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting ssh connection status: %w\", err)\n\t}\n\tallResp = append(allResp, sshResp...)\n\twslResp, err := wshclient.WslStatusCommand(RpcClient, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting wsl connection status: %w\", err)\n\t}\n\tallResp = append(allResp, wslResp...)\n\treturn allResp, nil\n}\n\nfunc connStatusRun(cmd *cobra.Command, args []string) error {\n\tallResp, err := getAllConnStatus()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(allResp) == 0 {\n\t\tWriteStdout(\"no connections\\n\")\n\t\treturn nil","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-conn.go#L75-L111","documentation":"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`.","triggerScenarios":"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.","commonSituations":"Wave Terminal not running locally; wsh invoked remotely without an app route; transient IPC failure; version mismatch where the remote lacks ConnStatusCommand.","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"],"exampleFix":"// before\nsshResp, err := wshclient.ConnStatusCommand(RpcClient, nil)\nif err != nil {\n    return nil, fmt.Errorf(\"getting ssh connection status: %w\", err)\n}\n// after\nsshResp, err := wshclient.ConnStatusCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 10000})\nif err != nil {\n    return nil, fmt.Errorf(\"getting ssh connection status (is Wave running?): %w\", err)\n}","handlingStrategy":"retry","validationCode":"// ensure wsh can reach the Wave server first\nif _, err := wshclient.ConnStatusCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 5000}); err != nil {\n    return fmt.Errorf(\"Wave unreachable; start the app before conn status: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"statuses, err := getAllConnStatus()\nif err != nil {\n    time.Sleep(2 * time.Second)\n    statuses, err = getAllConnStatus()\n}","preventionTips":["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"],"tags":["rpc","ssh","wsh","connection"],"backgroundTag":"rpc-call-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}