{"record":{"id":"4df38b2746bc8613","repo":"jdx/mise","slug":"command-exited-with-non-zero-status","errorCode":null,"errorMessage":"command exited with non-zero status: {}","messagePattern":"command exited with non-zero status: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/bounded.rs","lineNumber":14,"sourceCode":"//! Bounded capture for non-interactive vendor generators and host probes.\nuse super::*;\nuse eyre::eyre;\nuse std::sync::atomic::{AtomicUsize, Ordering};\n// `cmd` imports this only for the unix reader, so name it here too.\nuse tokio::io::AsyncRead;\n\nimpl CmdLineRunner<'_> {\n    /// Capture a finite response, with one deadline for the process and pipes.\n    /// This command owns its child tree even when mise itself is nested.\n    pub(crate) async fn read_isolated(self, limit: usize) -> Result<String> {\n        let output = self.output_isolated(limit).await?;\n        if !output.status.success() {\n            bail!(\"command exited with non-zero status: {}\", output.status);\n        }\n        Ok(String::from_utf8(output.stdout)?.trim_end().to_string())\n    }\n\n    /// Return the exit status and bounded output without replaying command output.\n    pub(crate) async fn output_isolated(mut self, limit: usize) -> Result<std::process::Output> {\n        let _read_lock = super::raw_read_lock().await;\n        let timeout = self.timeout.unwrap_or(Duration::from_secs(5));\n        self.cmd.kill_on_drop(true);\n        self.cmd\n            .stdin(Stdio::null())\n            .stdout(Stdio::piped())\n            .stderr(Stdio::piped());\n        #[cfg(unix)]\n        {\n            self.cmd.env(TASK_PGID_MANAGED_ENV, \"1\");\n            self.cmd.process_group(0);\n        }","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cmd/bounded.rs#L1-L32","documentation":"Raised by CmdLineRunner::read_isolated, which captures a command's bounded output with its own deadline and child-tree ownership. If the isolated process exits with a non-zero status, the runner bails with this message instead of returning captured stdout. Unlike the formatted helpers, it only includes the ExitStatus, so details must come from separately captured stderr.","triggerScenarios":"Calling read_isolated (directly or via output_isolated) on a command that finishes unsuccessfully — e.g. reading tool metadata or plugin output where the child returns a failing exit code.","commonSituations":"A plugin or helper script erroring during version listing or metadata reads; commands failing due to a missing interpreter, bad plugin code, or corrupt tool installation.","solutions":["Check the command's stderr (captured by output_isolated) or run the command manually to see the real failure.","Verify the plugin/tool script exists, is executable, and runs under the expected interpreter.","Reinstall or update the affected plugin/tool whose helper is failing.","Inspect mise logs with MISE_DEBUG=1 to see the full command and output around the failure."],"exampleFix":"// debug the failing isolated command\nMISE_DEBUG=1 mise ls-remote <tool>\n// or reinstall the misbehaving tool/plugin\nmise uninstall <tool> && mise install <tool>","handlingStrategy":"try-catch","validationCode":"# Sanity-check the plugin/tool helper works standalone\n<path-to-tool-helper> --version || echo 'helper itself is broken'","typeGuard":null,"tryCatchPattern":"match read_isolated_result {\n    Err(e) if e.to_string().starts_with(\"command exited with non-zero status\") => {\n        // fetch captured stderr via debug logs (MISE_DEBUG=1) and report\n        Err(anyhow!(\"isolated command failed; see mise debug logs\"))\n    }\n    other => other,\n}","preventionTips":["Use MISE_DEBUG=1 to capture the child's stderr since the message omits it","Keep plugins' bin scripts executable and interpreter-compatible","Reinstall tools/plugins whose helpers start failing after upgrades"],"tags":["process","exit-code","subprocess"],"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"}