{"record":{"id":"d96b367824fb410b","repo":"jdx/mise","slug":"timed-out-after-timeout","errorCode":null,"errorMessage":"timed out after {timeout:?}","messagePattern":"timed out after (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd.rs","lineNumber":1460,"sourceCode":"                    bail!(\"command output pipes did not close within {pipe_drain_timeout:?}\");\n                }\n            };\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_LOCK.read().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 {","sourceCodeStart":1442,"sourceCodeEnd":1478,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cmd.rs#L1442-L1478","documentation":"The command exceeded its configured timeout; the timeout guard killed the process tree, the process then exited unsuccessfully, and mise reports the timeout as the actual cause instead of the generic non-zero exit. It surfaces from execute_hashes_async_with_drain_timeout when hashing stdout/stderr of non-interactive probe commands.","triggerScenarios":"Raised at src/cmd.rs:1460 when `timeout_guard.timed_out()` is Some after the killed process returned a failed status, i.e. a CmdLineRunner with `.timeout(Some(d))` (via execute_hashes_async) whose command ran longer than `d`.","commonSituations":"Slow network probes (registry checks, version listings), tools hanging waiting on a dead socket, or a too-tight timeout configured in mise settings/task env on a machine with slow disk or network.","solutions":["Increase the configured timeout for this command (mise timeout setting / the Duration passed to the runner).","Fix the underlying slowness: check network connectivity, proxies, or the tool being invoked (run it manually and time it).","Remove hangs: ensure the command never blocks on stdin/password prompts — these probe commands run with stdin null.","Cache or skip the command when its target (e.g. remote registry) is known to be unreachable."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Estimate the command's duration before running it under a tight timeout:\ntime (cmd --version >/dev/null 2>&1) || echo \"cmd too slow for current timeout\"","typeGuard":null,"tryCatchPattern":"match CmdLineRunner::new(cmd).with_timeout(d).execute_hashes().await {\n    Err(e) if e.to_string().contains(\"timed out after\") => {\n        // back off and retry once with a larger timeout\n        retry_with_timeout(d * 4).await\n    }\n    other => other,\n}","preventionTips":["Set timeouts generously above worst-case observed runtimes (CI is slower than laptops).","Never let probe commands prompt for input; force non-interactive flags.","Cache slow network lookups so repeated runs stay under the timeout.","Monitor timeout frequency and adjust the configured Duration when infrastructure changes."],"tags":["timeout","subprocess","process"],"backgroundTag":"request-timeout","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}