{"record":{"id":"196379bf9b267b9c","repo":"jdx/mise","slug":"exited-with-status","errorCode":null,"errorMessage":"exited with {status}","messagePattern":"exited with (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/describe_command.rs","lineNumber":181,"sourceCode":"            // with the last writer of the pipe, so it is not waited for\n            active.0.kill();\n            let _ = child.kill();\n            let _ = child.wait();\n            bail!(\"took longer than {}s\", timeout.as_secs());\n        }\n        std::thread::sleep(Duration::from_millis(100));\n    };\n    // a descendant that outlived the shell and kept the pipe is not the\n    // shell's answer: the output is waited for a moment, not forever\n    let Ok(output) = receiver.recv_timeout(output_grace) else {\n        active.0.kill();\n        bail!(\"a process it started kept its output open\");\n    };\n    if output.len() > DIFF_LIMIT {\n        bail!(\"description output exceeded {} bytes\", DIFF_LIMIT);\n    }\n    if !status.success() {\n        bail!(\"exited with {status}\");\n    }\n    let Some(line) = first_line(&output) else {\n        return Ok(None);\n    };\n    annotate(\n        store,\n        entry,\n        Annotation {\n            description: Some(line.clone()),\n            description_source: Some(DescriptionSource::Command),\n            labels: None,\n            updated_at: store::now_rfc3339(),\n        },\n    )?;\n    Ok(Some(line))\n}\n\n/// The first non-empty line, trimmed, cut at the limit.","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/describe_command.rs#L163-L199","documentation":"Thrown by `run_with_limits` when the description command's shell exits with a non-success status. The library surfaces the raw exit status in the message so the caller knows the underlying command failed rather than the harness.","triggerScenarios":"Any description/annotation command whose shell returns a nonzero exit code — syntax error in the script, failing subcommand, `set -e` aborting mid-script — detected by `if !status.success()` after output collection completes.","commonSituations":"Typos in hook scripts, missing tools referenced by the command (exit 127), permission errors on files the command touches, or scripts that deliberately fail on some hosts.","solutions":["Run the description command manually in a shell and inspect its exit code and output.","Fix the failing command/script so it exits 0 on the expected path.","Guard optional steps so they don't fail the script (`cmd || true`) when failure is acceptable.","Check the message's status value: 127 = command not found, 126 = not executable, 1 = script error."],"exampleFix":"// before\nfetch-remote-state --strict\n// after\nfetch-remote-state --strict || echo \"fetch unavailable\"","handlingStrategy":"try-catch","validationCode":"// my-description-command && echo ok || echo \"exit=$?\"","typeGuard":null,"tryCatchPattern":"// match run_with_limits(...) {\n//     Err(e) if e.message().starts_with(\"exited with\") => {\n//         // surface the status to the user; the command itself failed\n//     }\n//     other => other?,\n// }","preventionTips":["Test every hook/description command manually before enrolling it.","Add `set -e`-safe guards (`|| true`) around optional steps.","Reference tools by absolute path to avoid exit 127."],"tags":["process","exit-status","shell"],"backgroundTag":"command-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}