jdx/mise · error
elevated bootstrap helper failed with
Error message
elevated bootstrap helper failed with {} What it means
run_with_input_output pipes a private stdin payload into an elevated helper, waits, and captures stdout. If the helper exits non-zero, mise bails with the ExitStatus formatted in and discards nothing else; stderr was already forwarded to the terminal for sudo prompts and diagnostics. Same meaning as the run_with_input variant but for helpers whose stdout must be captured.
Solutions
- Read the helper's stderr printed on the terminal to find the real failure
- Verify the stdin payload/script is correct for the target platform and package manager
- Check sudoers policy allows the exact command being run without restrictions
- Retry after fixing; if the command genuinely can't be elevated, run it manually as root using the suggested manual command
Example fix
// before
let out = run_with_input_output(&mut cmd, script.as_bytes())?;
// after
let out = run_with_input_output(&mut cmd, script.as_bytes())
.with_context(|| format!("elevated helper for {pkg} failed; check terminal stderr"))?; Defensive patterns
Strategy: try-catch
Validate before calling
// verify the queried entity exists before the elevated call
if !Path::new(&target).exists() { bail!("nothing to query at {target}"); } Type guard
fn status_ok(o: &std::process::Output) -> bool { o.status.success() } Try / catch
let out = run_with_input_output(&mut cmd, input)
.with_context(|| "elevated helper failed; check terminal stderr for sudo/diagnostic output")?; Prevention
- Keep stderr attached to a terminal when running helpers so sudo prompts and errors are visible
- Confirm sudoers policy permits the exact command non-interactively if used in automation
- Validate the stdin payload against the target platform before invoking
When it happens
Trigger: Calling run_with_input_output in src/system/sudo.rs when the elevated subprocess terminates with a non-zero exit code after consuming the piped stdin payload.
Common situations: Elevated query command fails (e.g. dpkg/rpm query for a nonexistent package); script passed via stdin errors mid-run; sudo target command is rejected by policy (e.g. sudoers restrictions on the exact command).
Related errors
- elevated bootstrap helper failed with
- brew-cask: failed to generate
- failed
- not running as root and system_packages.sudo is disabled…
- sudo not found. Run as root
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/5833fd97232bab8e.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/sudo.rs:272
.collect::<Vec<_>>()
.join(" ");
ensure_elevation_available(&manual_cmd)?;
let _progress_pause = pause_progress_for_child();
info!("$ {}", argv.join(" "));
let mut child = Command::new(&argv[0])
.args(&argv[1..])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::inherit())
.spawn()?;
child
.stdin
.take()
.expect("piped stdin is available")
.write_all(input)?;
let output = child.wait_with_output()?;
if !output.status.success() {
bail!("elevated bootstrap helper failed with {}", output.status);
}
Ok(output.stdout)
}
/// Verify that a subprocess which performs its own sudo elevation can do so
/// without violating mise's elevation policy or hanging without a TTY.
pub(crate) fn ensure_elevation_available(manual_cmd: &str) -> Result<()> {
if is_root() {
return Ok(());
}
if !Settings::get().system_packages.sudo {
bail!(
"not running as root and system_packages.sudo is disabled. Run manually:\n {manual_cmd}"
);
}
if crate::file::which("sudo").is_none() {
bail!(
"sudo not found. Run as root:\n {}",View on GitHub (pinned to 533346cc37)