{"record":{"id":"8d3a4324794a0a46","repo":"wavetermdev/waveterm","slug":"reinstalling-connection-w","errorCode":null,"errorMessage":"reinstalling connection: %w","messagePattern":"reinstalling connection: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-conn.go","lineNumber":142,"sourceCode":"\nfunc connReinstallRun(cmd *cobra.Command, args []string) error {\n\tif len(args) != 1 {\n\t\tif RpcContext.Conn == \"\" {\n\t\t\treturn fmt.Errorf(\"no connection specified\")\n\t\t}\n\t\targs = []string{RpcContext.Conn}\n\t}\n\tconnName := args[0]\n\tif err := validateConnectionName(connName); err != nil {\n\t\treturn err\n\t}\n\tdata := wshrpc.ConnExtData{\n\t\tConnName:   connName,\n\t\tLogBlockId: RpcContext.BlockId,\n\t}\n\terr := wshclient.ConnReinstallWshCommand(RpcClient, data, &wshrpc.RpcOpts{Timeout: 60000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reinstalling connection: %w\", err)\n\t}\n\tWriteStdout(\"wsh reinstalled on connection %q\\n\", connName)\n\treturn nil\n}\n\nfunc connDisconnectRun(cmd *cobra.Command, args []string) error {\n\tconnName := args[0]\n\tif err := validateConnectionName(connName); err != nil {\n\t\treturn err\n\t}\n\terr := wshclient.ConnDisconnectCommand(RpcClient, connName, &wshrpc.RpcOpts{Timeout: 10000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"disconnecting %q error: %w\", connName, err)\n\t}\n\tWriteStdout(\"disconnected %q\\n\", connName)\n\treturn nil\n}\n","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-conn.go#L124-L160","documentation":"Returned by connReinstallRun when the ConnReinstallWshCommand RPC fails after being dispatched with a 60-second timeout. It means the server could not reinstall wsh on the target connection. The wrapper preserves the underlying cause via %w.","triggerScenarios":"Running `wsh conn reinstall <conn>` when the connection is not currently connected, the RPC times out (60s), or the server-side reinstall step fails (e.g. remote endpoint errors, permission problems).","commonSituations":"Targeting a disconnected or never-connected host, slow networks exceeding the 60s timeout, stale wsh binaries on the remote, or server-side install errors.","solutions":["Ensure the connection is established first (`wsh conn connect <conn>`), then retry reinstall","Check the wrapped inner error for timeout vs. server-side failure and re-run with the host reachable","Verify network/SSH reachability of the target host","If timeouts persist, investigate the remote host's load and wsh binary permissions"],"exampleFix":"// before\nwsh conn reinstall offline-host\n// error: reinstalling connection: ... not connected\n// after\nwsh conn connect offline-host && wsh conn reinstall offline-host","handlingStrategy":"validation","validationCode":"status, err := wshclient.ConnStatusCommand(RpcClient, nil)\nif err != nil {\n    return fmt.Errorf(\"cannot verify connection before reinstall: %w\", err)\n}\nconnected := slices.ContainsFunc(status, func(c wshrpc.ConnStatusEntry) bool {\n    return c.ConnName == connName && c.Connected\n})\nif !connected {\n    return fmt.Errorf(\"connection %q is not connected; run `wsh conn connect %s` first\", connName, connName)\n}","typeGuard":null,"tryCatchPattern":"err := wshclient.ConnReinstallWshCommand(RpcClient, data, &wshrpc.RpcOpts{Timeout: 60000})\nif err != nil {\n    if ctxErr := context.DeadlineExceeded; errors.Is(err, ctxErr) {\n        // retry with longer timeout\n    }\n    return fmt.Errorf(\"reinstalling connection: %w\", err)\n}","preventionTips":["Connect the host before attempting reinstall","Prefer `wsh conn ensure` over manual reinstall in automation","Keep the 60s timeout in mind on slow links; pre-warm the connection","Check inner error text to distinguish timeout from server-side failure"],"tags":["cli","rpc","timeout","wsh-install"],"backgroundTag":"rpc-call-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}