{"record":{"id":"e229e9622fbe1753","repo":"wavetermdev/waveterm","slug":"conn-server-not-installed-correctly-after-install","errorCode":null,"errorMessage":"conn server not installed correctly (after install)","messagePattern":"conn server not installed correctly \\(after install\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wslconn/wslconn.go","lineNumber":632,"sourceCode":"\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\n\t}\n\treturn connSettings, true\n}\n\nfunc (conn *WslConn) persistWshInstalled(ctx context.Context, result WshCheckResult) {","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wslconn/wslconn.go#L614-L650","documentation":"This error is thrown when, after installing wsh, StartConnServer(ctx, true) STILL returns needsInstall=true — i.e. the installer claimed success but the server is not actually installed correctly (missing or wrong version). It is a self-check failure in the install->verify loop of tryEnableWsh.","triggerScenarios":"InstallWsh reports success but the subsequent verify call finds the connserver binary absent/mismatched — install wrote to a different path than StartConnServer checks, a cached old binary is being probed, or the install silently failed (e.g. partial write).","commonSituations":"Multiple WSL distros with divergent ~/.wsh states, stale binary cache, race where old connserver still running reports wrong version, filesystem sync issues on a full disk.","solutions":["Run wsl --shutdown to stop all distros and stale processes, then reconnect once","Delete ~/.wsh (or ~/.wsh/bin) inside the distro and reconnect to force a clean reinstall","Confirm ~/.wsh/bin/wsh exists and matches the client version inside the exact distro being connected","Check disk space and write errors in the distro logs","File/report if reproducible — indicates an install-path mismatch bug"],"exampleFix":"// clean reinstall path\n// wsl -d Ubuntu -- bash -c 'rm -rf ~/.wsh' && wsl --shutdown\n// then reconnect from Wave so InstallWsh runs from scratch","handlingStrategy":"fallback","validationCode":"// verify install actually landed before trusting the result\nout, _ := exec.Command(\"wsl\", \"-d\", distro, \"--\", \"bash\", \"-c\",\n    \"test -x ~/.wsh/bin/wsh && ~/.wsh/bin/wsh --version\").CombinedOutput()\nif len(out) == 0 {\n    return fmt.Errorf(\"wsh not present after install; wiping ~/.wsh for clean reinstall\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"not installed correctly\") {\n    // fallback: clean reinstall\n    exec.Command(\"wsl\", \"--shutdown\").Run()\n    exec.Command(\"wsl\", \"-d\", distro, \"--\", \"bash\", \"-c\", \"rm -rf ~/.wsh\").Run()\n    return connectAndEnable(ctx, conn) // installer runs from scratch\n}","preventionTips":["Wipe ~/.wsh when version checks mismatch","Run only one Wave client against a distro at a time","Watch disk-full conditions that cause silent partial installs","Confirm install target path matches what StartConnServer probes"],"tags":["go","wsl","wsh","install-verification","connserver"],"backgroundTag":"connserver-not-installed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}