{"record":{"id":"91e4579bf974b095","repo":"herdrdev/herdr","slug":"failed-to-start-ssh-install-err","errorCode":null,"errorMessage":"failed to start ssh install: {err}","messagePattern":"failed to start ssh install: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/remote/attach.rs","lineNumber":504,"sourceCode":"        self.command().arg(command).output()\n    }\n\n    fn install_herdr(&self, remote_herdr: &RemoteHerdr, source_path: &Path) -> io::Result<()> {\n        let output = self.sh_output(&remote_install_prepare_script(remote_herdr))?;\n        if !output.status.success() {\n            return Err(command_failed(\"remote install preparation failed\", &output));\n        }\n        let (tmp_path, dest_path) = parse_remote_install_paths(&output.stdout)?;\n\n        let mut child = self\n            .command()\n            .arg(remote_install_stream_command(&tmp_path))\n            .stdin(Stdio::piped())\n            .stdout(Stdio::null())\n            .stderr(Stdio::inherit())\n            .spawn()\n            .map_err(|err| {\n                io::Error::new(err.kind(), format!(\"failed to start ssh install: {err}\"))\n            })?;\n\n        let mut source = File::open(source_path)?;\n        let copy_result = if let Some(mut stdin) = child.stdin.take() {\n            io::copy(&mut source, &mut stdin).map(|_| ())\n        } else {\n            Err(io::Error::new(\n                io::ErrorKind::BrokenPipe,\n                \"ssh install stdin missing\",\n            ))\n        };\n        let status = child.wait()?;\n        copy_result?;\n\n        if status.success() {\n            let output = self.sh_output(&remote_install_commit_script(&tmp_path, &dest_path))?;\n            if output.status.success() {\n                Ok(())","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/herdrdev/herdr/blob/f457cff4f2648eee85d176f8a41861241d4e8428/src/remote/attach.rs#L486-L522","documentation":"install_herdr spawns the remote install command (an ssh invocation streaming the binary into a remote tar/cat pipeline) with stdin piped; if the ssh process cannot be spawned, the os error is wrapped with the context 'failed to start ssh install: {err}' preserving the original ErrorKind. This is the first failure point of remote binary installation.","triggerScenarios":"Calling install_herdr when the ssh binary is missing from PATH (NotFound), lacks execute permission (PermissionDenied), or the Command construction fails at spawn time on the local machine.","commonSituations":"Minimal/container environments without an ssh client installed, PATH misconfiguration in GUI-launched apps, ssh not installed on a fresh machine, or an incorrect ssh binary path override.","solutions":["Verify ssh is installed and on PATH: run `which ssh` in the same environment Herdr runs in","Install an OpenSSH client (e.g. openssh-client package) if missing","If launching from a GUI/service, ensure PATH includes the ssh binary or configure an absolute path","Inspect the wrapped err (kind/message) to distinguish NotFound vs PermissionDenied and fix accordingly"],"exampleFix":"# before\n$ herdr remote attach host\nError: failed to start ssh install: No such file or directory (os error 2)\n\n# after\n$ sudo apt-get install openssh-client\n$ herdr remote attach host","handlingStrategy":"validation","validationCode":"// Before calling prepare_remote_herdr/install_herdr\nif which::which(\"ssh\").is_err() { return Err(\"ssh client not found on PATH\"); }","typeGuard":null,"tryCatchPattern":"match install_herdr(...) {\n    Err(e) if e.to_string().contains(\"failed to start ssh install\") && e.kind() == std::io::ErrorKind::NotFound => { /* install openssh-client and retry */ }\n    other => other?,\n}","preventionTips":["Ensure an OpenSSH client is installed in the environment running Herdr","Check `which ssh` when running from GUI launchers or containers with minimal PATH","Inspect the wrapped error kind to distinguish missing binary from permissions"],"tags":["ssh","remote-install","spawn","environment","not-found"],"backgroundTag":"ssh-executable-not-found","analyzedSha":"f457cff4f2648eee85d176f8a41861241d4e8428","analyzedAt":"2026-08-28T15:41:09.197Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}