{"record":{"id":"b6ea89f3625f8799","repo":"wavetermdev/waveterm","slug":"error-starting-conn-server-after-install-w","errorCode":null,"errorMessage":"error starting conn server (after install): %w","messagePattern":"error starting conn server \\(after install\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wslconn/wslconn.go","lineNumber":627,"sourceCode":"\t}\n\tneedsInstall, clientVersion, osArchStr, err := conn.StartConnServer(ctx, false)\n\tif err != nil {\n\t\tconn.Infof(ctx, \"ERROR starting conn server: %v\\n\", err)\n\t\terr = fmt.Errorf(\"error starting conn server: %w\", err)\n\t\treturn WshCheckResult{NoWshReason: \"error starting connserver\", WshError: err}\n\t}\n\tif needsInstall {\n\t\tconn.Infof(ctx, \"connserver needs to be (re)installed\\n\")\n\t\terr = conn.InstallWsh(ctx, osArchStr)\n\t\tif err != nil {\n\t\t\tconn.Infof(ctx, \"ERROR installing wsh: %v\\n\", err)\n\t\t\terr = fmt.Errorf(\"error installing wsh: %w\", err)\n\t\t\treturn WshCheckResult{NoWshReason: \"error installing wsh/connserver\", WshError: err}\n\t\t}\n\t\tneedsInstall, clientVersion, _, err = conn.StartConnServer(ctx, true)\n\t\tif err != nil {\n\t\t\tconn.Infof(ctx, \"ERROR starting conn server (after install): %v\\n\", err)\n\t\t\terr = fmt.Errorf(\"error starting conn server (after install): %w\", err)\n\t\t\treturn WshCheckResult{NoWshReason: \"error starting connserver\", WshError: err}\n\t\t}\n\t\tif needsInstall {\n\t\t\tconn.Infof(ctx, \"conn server not installed correctly (after install)\\n\")\n\t\t\terr = fmt.Errorf(\"conn server not installed correctly (after install)\")\n\t\t\treturn WshCheckResult{NoWshReason: \"connserver not installed properly\", WshError: err}\n\t\t}\n\t\treturn WshCheckResult{WshEnabled: true, ClientVersion: clientVersion}\n\t} else {\n\t\treturn WshCheckResult{WshEnabled: true, ClientVersion: clientVersion}\n\t}\n}\n\nfunc (conn *WslConn) getConnectionConfig() (wconfig.ConnKeywords, bool) {\n\tconfig := wconfig.GetWatcher().GetFullConfig()\n\tconnSettings, ok := config.Connections[conn.GetName()]\n\tif !ok {\n\t\treturn wconfig.ConnKeywords{}, false","sourceCodeStart":609,"sourceCodeEnd":645,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wslconn/wslconn.go#L609-L645","documentation":"After a successful InstallWsh, tryEnableWsh retries StartConnServer(ctx, true) and wraps any failure with this error. The freshly installed connserver still failed to start, meaning the install/launch pipeline did not produce a working server despite the install succeeding.","triggerScenarios":"StartConnServer(ctx, true) fails immediately after InstallWsh succeeded — the newly installed binary can't execute (wrong arch, missing exec permission), the domain socket wasn't refreshed, or startup handshake times out.","commonSituations":"Architecture mismatch (e.g. arm64 vs x64 binary), noexec mount on the distro home filesystem, lingering old connserver process holding the socket, very slow distro boot exceeding the startup timeout.","solutions":["Verify the installed binary's architecture matches the distro (osArchStr) and is executable","Kill stale connserver processes inside the distro and clear ~/.wsh sockets, then reconnect","Check for noexec on the home filesystem; relocate WSL's home or remount","Increase patience: restart the distro (wsl --shutdown) and connect once cleanly","Run 'wsh connserver status'/'~/.wsh/bin/wsh --version' inside the distro to debug directly"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// confirm the binary is executable and arch-correct before relying on the install\nout, _ := exec.Command(\"wsl\", \"-d\", distro, \"--\", \"bash\", \"-c\",\n    \"file ~/.wsh/bin/wsh && test -x ~/.wsh/bin/wsh && echo OK\").CombinedOutput()\nif !strings.Contains(string(out), \"OK\") {\n    return fmt.Errorf(\"wsh binary not executable or wrong arch\")\n}","typeGuard":null,"tryCatchPattern":"res, err := tryEnableWsh(ctx, conn)\nif err != nil && strings.Contains(err.Error(), \"after install\") {\n    // one clean restart usually clears stale processes/sockets\n    exec.Command(\"wsl\", \"--shutdown\").Run()\n    time.Sleep(2 * time.Second)\n    res, err = connectAndEnable(ctx, conn)\n}","preventionTips":["Avoid noexec on the distro home filesystem","Kill stale connserver processes before reconnecting","Verify os/arch matches between client and distro","Do a single clean connect after wsl --shutdown instead of rapid retries"],"tags":["go","wsl","wsh","connserver","startup"],"backgroundTag":"connserver-start-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}