jdx/mise · error

exited with non-zero status: {status}

Error message

exited with non-zero status: {status}

What it means

The executed command finished but returned a non-zero exit status, and no timeout was involved. In this hashed-runner path the command's stdout/stderr are consumed internally for hashing, so mise reports only the status string (e.g. `exited with non-zero status: exit status: 1`) rather than replaying captured output.

Source

Thrown at src/cmd.rs:1462

            };
            if let Err(err) = consume(output) {
                #[cfg(unix)]
                signal_process_tree(id, nix::sys::signal::Signal::SIGKILL);
                #[cfg(windows)]
                kill_process_tree(id);
                return Err(err);
            }
        }

        if let Some(guard) = &timeout_guard {
            guard.cancel();
        }
        let status = status.expect("command wait must complete");
        if !status.success() {
            if let Some(timeout) = timeout_guard.as_ref().and_then(|guard| guard.timed_out()) {
                bail!("timed out after {timeout:?}");
            }
            bail!("exited with non-zero status: {status}");
        }
        Ok((
            stdout_hasher.finalize().to_hex().to_string(),
            stderr_hasher.finalize().to_hex().to_string(),
        ))
    }

    /// Run the command and return stdout, even when raw mode is enabled.
    pub(crate) async fn read(mut self) -> Result<String> {
        let _read_lock = RAW_LOCK.read().await;
        debug!("$ {self}");
        self.cmd.kill_on_drop(true);
        #[cfg(unix)]
        if should_use_pgroup() {
            self.cmd.env(TASK_PGID_MANAGED_ENV, "1");
            unsafe {
                self.cmd.as_std_mut().pre_exec(|| {
                    let stdin = std::os::fd::BorrowedFd::borrow_raw(0);

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Run the same command manually in your shell to see its real error output (this path hides it for hashing).
  2. Fix the underlying command failure (missing tool, bad flags, invalid config, network error).
  3. If non-zero is expected/acceptable, guard the call (`cmd || true`) or use a runner variant that tolerates failure.
  4. Check that PATH/env inside mise matches your shell (mise shims vs system tools can resolve differently).
Defensive patterns

Strategy: try-catch

Validate before calling

// Reproduce the probe locally and check its exit status first:
$ mise exec -- sh -c 'cmd args'; echo "exit=$?"

Try / catch

match runner.execute_hashes().await {
    Err(e) if e.to_string().contains("exited with non-zero status") => {
        eprintln!("probe failed; run the command manually for details: {e}");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Raised at src/cmd.rs:1462 in execute_hashes_async_with_drain_timeout whenever `status.success()` is false and `timeout_guard.timed_out()` is None — any failing command executed via execute_hashes_async (non-interactive probes with piped, hashed output).

Common situations: Version-check or probe commands failing because the tool isn't installed correctly, a config file referenced by the command is invalid, network calls inside the command fail, or the script itself exits non-zero by design.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/d42930c911ab679d. Report an issue: GitHub.