{"record":{"id":"cd36682392c281ea","repo":"jdx/mise","slug":"timed-out-after-duration","errorCode":null,"errorMessage":"timed out after {duration:?}","messagePattern":"timed out after (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd.rs","lineNumber":1038,"sourceCode":"                        // it again would just be a redundant kill.\n                        debug!(\"Received signal {sig}, forwarding to {id}\");\n                        let _ = nix::sys::signal::kill(pid, nix_sig);\n                    }\n                }\n            }\n        }\n        // Removed after rx loop drains (not inside ExitStatus arm) so kill_all\n        // can still reach this PID while output is being processed.\n        RUNNING_PIDS.lock().unwrap().remove(&id);\n        if let Some(g) = &timeout_guard {\n            g.cancel();\n        }\n\n        let status = status.unwrap();\n\n        if !status.success() {\n            if let Some(duration) = timeout_guard.as_ref().and_then(|g| g.timed_out()) {\n                bail!(\"timed out after {duration:?}\");\n            }\n            self.on_error(\n                failure_output.map_or_else(Vec::new, FailureOutputTail::into_output),\n                status,\n            )?;\n        }\n\n        Ok(())\n    }\n\n    pub(crate) async fn execute_async(self) -> Result<()> {\n        self.execute_async_with_cancel_check(|| false).await\n    }\n\n    /// Execute a command while preventing cancellation from being lost between\n    /// the pre-spawn check and PID registration.\n    pub(crate) async fn execute_async_with_cancel_check(\n        mut self,","sourceCodeStart":1020,"sourceCodeEnd":1056,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cmd.rs#L1020-L1056","documentation":"A spawned child process exceeded the configured timeout and was killed; cmd.rs reports `timed out after <duration>` instead of the process's real exit status. The timeout_guard recorded the timeout before on_error ran, so mise replaces the non-zero-exit reporting with the timeout explanation.","triggerScenarios":"Executing any command through mise's Cmd::execute (task run, hooks, postinstall scripts) with a timeout configured (e.g. mise settings timeout / task timeout), where the process runs longer than the limit and fails as a result of being killed.","commonSituations":"Slow network downloads in postinstall scripts behind a proxy; long-running builds with a too-tight task timeout; a process hanging on stdin waiting for input; CI machines slower than dev machines.","solutions":["Increase the timeout: raise the relevant mise timeout setting or task timeout value.","Fix the underlying slowness (network, dependency resolution) so the command finishes in time.","Make the command non-interactive (CI=1, flags like --yes) so it never hangs on prompts.","If the command legitimately needs unbounded time, remove/disable the timeout for it."],"exampleFix":"// before (mise.toml)\n[tools]\nnode = '22'\n[settings]\ntask_timeout = '30s'\n# long build: timed out after 30s\n// after\n[settings]\ntask_timeout = '10m'","handlingStrategy":"try-catch","validationCode":"# estimate worst-case runtime before enabling the timeout\nstart=$(date +%s); command; echo $(( $(date +%s) - start ))s","typeGuard":null,"tryCatchPattern":"if mise run build 2>&1 | grep -q 'timed out after'; then rerun_with_higher_timeout; fi","preventionTips":["Set timeouts with generous headroom (2-3x your slowest environment, e.g. CI).","Make commands non-interactive so they never block on prompts.","Monitor task durations and tune timeouts from real measurements."],"tags":["timeout","process","task-execution"],"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"}