{"record":{"id":"3e302d7fc86d6e08","repo":"jdx/mise","slug":"elevated-bootstrap-helper-failed-with-status","errorCode":null,"errorMessage":"elevated bootstrap helper failed with {status}","messagePattern":"elevated bootstrap helper failed with (.+?)","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/system/sudo.rs","lineNumber":213,"sourceCode":"        .chain(args.iter().cloned())\n        .collect::<Vec<_>>()\n        .join(\" \");\n    ensure_elevation_available(&manual_cmd)?;\n    info!(\"$ {}\", argv.join(\" \"));\n    let mut child = Command::new(&argv[0])\n        .args(&argv[1..])\n        .stdin(Stdio::piped())\n        .stdout(Stdio::inherit())\n        .stderr(Stdio::inherit())\n        .spawn()?;\n    child\n        .stdin\n        .take()\n        .expect(\"piped stdin is available\")\n        .write_all(input)?;\n    let status = child.wait()?;\n    if !status.success() {\n        bail!(\"elevated bootstrap helper failed with {status}\");\n    }\n    Ok(())\n}\n\n/// Run one elevated helper with a private stdin payload and capture stdout.\n/// Stderr remains attached to the terminal for sudo prompts and diagnostics.\npub(crate) fn run_with_input_output(\n    program: &str,\n    args: &[String],\n    input: &[u8],\n) -> Result<Vec<u8>> {\n    let argv = argv(program, args);\n    let manual_cmd = std::iter::once(\"sudo\".to_string())\n        .chain(std::iter::once(program.to_string()))\n        .chain(args.iter().cloned())\n        .collect::<Vec<_>>()\n        .join(\" \");\n    ensure_elevation_available(&manual_cmd)?;","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/sudo.rs#L195-L231","documentation":"Thrown by run_with_input in src/system/sudo.rs after an elevated helper process (spawned through sudo for system-package bootstrap) exits with a non-zero status. stdin carried a private payload while stdout/stderr were inherited from the terminal, so the helper's real diagnostics were already printed above this error. The message embeds the child's ExitStatus, which distinguishes a plain non-zero code from death by signal.","triggerScenarios":"Any mise operation that needs root (e.g. installing declared system packages) invokes run_with_input(program, args, input); the sudo-launched helper returns a failing status - wrong sudo password, package-manager error (unreachable mirror, held dpkg lock), unknown helper subcommand, or the process being killed by a signal.","commonSituations":"Mistyping the sudo password; apt/dnf/pacman failing mid-install; running inside a container or restricted environment where the privileged command is not permitted; OOM killer terminating the helper (status shows 'signal').","solutions":["Read the terminal output directly above the error - the helper's stderr was inherited, so the package manager's actual failure message is already visible","Re-run the printed command manually with the same arguments under sudo to reproduce the underlying failure (mirror outage, dpkg lock, disk full)","In scripts/CI, pre-authenticate with `sudo -v` or configure NOPASSWD so a password prompt cannot fail silently","If the status mentions a signal, check dmesg/journal for OOM kills and free memory or lower parallelism"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-flight: confirm sudo is usable before triggering a bootstrap that elevates\nuse std::process::Command;\nfn sudo_ready() -> bool {\n    Command::new(\"sudo\").args([\"-n\", \"true\"]).status().map(|s| s.success()).unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match mise::system::run_with_input(&prog, &args, &payload) {\n    Ok(()) => {}\n    Err(err) if err.to_string().starts_with(\"elevated bootstrap helper failed\") => {\n        // helper stderr was inherited and already printed; surface manual remediation\n        eprintln!(\"bootstrap helper failed: {err:#}\");\n    }\n    Err(err) => return Err(err),\n}","preventionTips":["In CI, configure NOPASSWD for the package managers mise drives, or run the container as root","Pre-authenticate with `sudo -v` immediately before invoking mise bootstrap","Keep stderr attached (no piping) so the helper's real diagnostics remain visible"],"tags":["sudo","elevation","system-packages","process-exit","privileges"],"backgroundTag":"sudo-command-failed","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}