{"record":{"id":"c0dbd7ae9267d136","repo":"herdrdev/herdr","slug":"remote-herdr-install-cancelled","errorCode":null,"errorMessage":"remote herdr install cancelled","messagePattern":"remote herdr install cancelled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/remote/attach.rs","lineNumber":1102,"sourceCode":"    let status = match remote_server_status(ssh, remote_herdr) {\n        Ok(status) => status,\n        Err(err) => {\n            if !io::stdin().is_terminal() {\n                return Err(io::Error::other(format!(\n                    \"could not inspect the running remote herdr server on {target} before installing: {err}; run from an interactive terminal to approve updating the remote binary\"\n                )));\n            }\n            eprintln!(\n                \"could not inspect the running remote herdr server on {target} before installing: {err}\"\n            );\n            eprint!(\"continue installing the remote herdr binary? [y/N] \");\n            io::stderr().flush()?;\n\n            let mut answer = String::new();\n            io::stdin().read_line(&mut answer)?;\n            let answer = answer.trim().to_ascii_lowercase();\n            if answer != \"y\" && answer != \"yes\" {\n                return Err(io::Error::new(\n                    io::ErrorKind::Interrupted,\n                    \"remote herdr install cancelled\",\n                ));\n            }\n            return Ok(false);\n        }\n    };\n    let RemoteServerStatus::Running {\n        version,\n        protocol,\n        live_handoff,\n        detached_server_daemon,\n    } = &status\n    else {\n        return Ok(false);\n    };\n    let plan = remote_install_running_server_plan(\n        version.as_deref(),","sourceCodeStart":1084,"sourceCodeEnd":1120,"githubUrl":"https://github.com/herdrdev/herdr/blob/f457cff4f2648eee85d176f8a41861241d4e8428/src/remote/attach.rs#L1084-L1120","documentation":"When the remote herdr binary is missing and interactive install is enabled, herdr prompts on stderr asking whether to install it. If the user answers anything other than 'y' or 'yes', this Interrupted error is returned, aborting the attach flow.","triggerScenarios":"Running herdr remote attach against a host without herdr installed, then answering 'n', pressing Enter on an empty line, or EOF/piped input that yields a non-yes answer at the confirmation prompt.","commonSituations":"Scripts or CI piping stdin so read_line returns empty/EOF, a user declining an unexpected install prompt, or non-interactive shells where the prompt cannot be answered.","solutions":["Answer 'y' or 'yes' at the prompt to proceed with installation","Pre-install herdr on the remote host so no prompt appears","Set the appropriate non-interactive/force flag or env var if available instead of relying on the prompt","Check for a --yes/-y style flag on the attach command"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match attach() {\n    Err(e) if e.kind() == std::io::ErrorKind::Interrupted && e.to_string().contains(\"cancelled\") => {\n        // user declined; exit quietly with a distinct code\n        std::process::exit(130);\n    }\n    other => other,\n}","preventionTips":["Pre-install herdr on remotes used by automation","Provide a TTY when interactive prompts are expected","Detect the Interrupted kind and map it to a 'user cancelled' exit path"],"tags":["user-prompt","interactive","remote-install","rust"],"backgroundTag":"user-confirmation-declined","analyzedSha":"f457cff4f2648eee85d176f8a41861241d4e8428","analyzedAt":"2026-08-28T15:41:09.197Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}