{"record":{"id":"d42930c911ab679d","repo":"jdx/mise","slug":"exited-with-non-zero-status-status","errorCode":null,"errorMessage":"exited with non-zero status: {status}","messagePattern":"exited with non-zero status: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd.rs","lineNumber":1472,"sourceCode":"            };\n            if let Err(err) = consume(output) {\n                #[cfg(unix)]\n                signal_process_tree(id, nix::sys::signal::Signal::SIGKILL);\n                #[cfg(windows)]\n                kill_process_tree(id);\n                return Err(err);\n            }\n        }\n\n        if let Some(guard) = &timeout_guard {\n            guard.cancel();\n        }\n        let status = status.expect(\"command wait must complete\");\n        if !status.success() {\n            if let Some(timeout) = timeout_guard.as_ref().and_then(|guard| guard.timed_out()) {\n                bail!(\"timed out after {timeout:?}\");\n            }\n            bail!(\"exited with non-zero status: {status}\");\n        }\n        Ok((\n            stdout_hasher.finalize().to_hex().to_string(),\n            stderr_hasher.finalize().to_hex().to_string(),\n        ))\n    }\n\n    /// Run the command and return stdout, even when raw mode is enabled.\n    pub(crate) async fn read(mut self) -> Result<String> {\n        let _read_lock = raw_read_lock().await;\n        debug!(\"$ {self}\");\n        self.cmd.kill_on_drop(true);\n        #[cfg(unix)]\n        if should_use_pgroup() {\n            self.cmd.env(TASK_PGID_MANAGED_ENV, \"1\");\n            unsafe {\n                self.cmd.as_std_mut().pre_exec(|| {\n                    let stdin = std::os::fd::BorrowedFd::borrow_raw(0);","sourceCodeStart":1454,"sourceCodeEnd":1490,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cmd.rs#L1454-L1490","documentation":"The command spawned by execute_hashes_async_with_drain_timeout finished with a non-zero exit status and no timeout fired, so mise reports the raw status. This is the plain \"command failed\" case: the tool ran to completion (or was killed for another reason) and returned failure. Because output is hashed rather than captured here, the message carries only the status, not the program's stderr.","triggerScenarios":"Any command run through execute_hashes_async that exits non-zero — a failing build, a script erroring, a tool writing diagnostics to stderr and exiting 1/2/127.","commonSituations":"Compilation errors, missing arguments to the underlying tool, exit code 127 for a command that itself failed to find a sub-executable, or a script with `set -e` bailing early.","solutions":["Re-run the command manually to see its actual stdout/stderr (this API only returns hashes)","Fix the underlying tool error indicated when run manually","Check that the program and its arguments are correct and any sub-commands exist on PATH"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify the program exists before invoking\nwhich git || echo 'git missing from PATH'","typeGuard":null,"tryCatchPattern":"match cmd.execute_hashes_async(MAX).await {\n    Ok(h) => Ok(h),\n    Err(e) if e.to_string().starts_with(\"exited with non-zero status\") => {\n        eprintln!(\"command failed: {e}; rerun manually to see its output\");\n        Err(e)\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Run new commands manually once to confirm they succeed before wiring them in","Check exit codes and stderr of tools during development","Ensure all sub-executables the command needs are on PATH","Validate arguments passed to the command before execution"],"tags":["process","exit-status","task"],"backgroundTag":"git-command-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}