{"record":{"id":"bdd12e042c04264c","repo":"can1357/oh-my-pi","slug":"could-not-run-compress-program","errorCode":null,"errorMessage":"could not run compress program '{}': {}","messagePattern":"could not run compress program '(.+?)': (.+?)","errorType":"exception","errorClass":"SortError","httpStatus":null,"severity":"error","filePath":"crates/pi-builtins/src/sort.rs","lineNumber":2608,"sourceCode":"\t#[error(\"{0}\")]\n\tMessage(String),\n\n\t#[error(\"write failed: {}: {}\", .path.maybe_quote(), strip_errno(.error))]\n\tWriteFailed { path: OsString, error: std::io::Error },\n\n\t#[error(\"{}\", format_disorder(.file, .line_number, .line, .silent))]\n\tDisorder { file: OsString, line_number: usize, line: String, silent: bool },\n\n\t#[error(\"open failed: {}: {}\", .path.maybe_quote(), strip_errno(.error))]\n\tOpenFailed { path: PathBuf, error: std::io::Error },\n\n\t#[error(\"cannot read: {}: {}\", .path.maybe_quote(), strip_errno(.error))]\n\tReadFailed { path: PathBuf, error: std::io::Error },\n\n\t#[error(\"failed to open temporary file: {}\", strip_errno(.error))]\n\tOpenTmpFileFailed { error: std::io::Error },\n\n\t#[error(\"could not run compress program '{}': {}\", .prog, strip_errno(.error))]\n\tCompressProgExecutionFailed { prog: String, error: std::io::Error },\n\n\t#[error(\"{} terminated abnormally\", .prog.quote())]\n\tCompressProgTerminatedAbnormally { prog: String },\n\n\t#[error(\"cannot create temporary file in {}:\", .path.quote())]\n\tTmpFileCreationFailed { path: PathBuf },\n\n\t#[error(\"extra operand {}\\nfile operands cannot be combined with --files0-from\\nTry 'sort --help' for more information.\", .file.quote())]\n\tFileOperandsCombined { file: PathBuf },\n\n\n\t#[error(\"multiple output files specified\")]\n\tMultipleOutputFiles,\n\n\t#[error(\"when reading file names from standard input, no file name of '-' allowed\")]\n\tMinusInStdIn,\n","sourceCodeStart":2590,"sourceCodeEnd":2626,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/crates/pi-builtins/src/sort.rs#L2590-L2626","documentation":"`SortError::CompressProgExecutionFailed` is raised when the sort builtin cannot spawn the user-specified compression program (via `--compress-program`), quoting the program name and the stripped errno. The executable was not found or could not be executed.","triggerScenarios":"Running a memory-bounded sort with `--compress-program <prog>` where the program name is misspelled, not on PATH, or lacks the execute bit.","commonSituations":"Typo'd program name (`gzip` vs `gz`); minimal containers without gzip installed; PATH differences under cron/CI.","solutions":["Verify the program is installed and on PATH (`command -v <prog>`).","Use the fully-qualified binary path in --compress-program.","Install the compressor in the environment (e.g. `apt-get install gzip`).","Confirm the binary has the executable bit (`chmod +x`)."],"exampleFix":"// before\nsort --compress-program=gz big.txt\n\n// after\nsort --compress-program=/usr/bin/gzip big.txt","handlingStrategy":"validation","validationCode":"let prog = \"gzip\";\nlet found = std::env::var_os(\"PATH\")\n    .map(|paths| std::env::split_paths(&paths)\n        .any(|dir| dir.join(prog).is_file()))\n    .unwrap_or(false);\nif !found { eprintln!(\"compress program '{prog}' not found on PATH\"); }","typeGuard":null,"tryCatchPattern":"match sort_result {\n    Err(SortError::CompressProgExecutionFailed { prog, error }) => {\n        eprintln!(\"cannot run '{prog}': {error}; install it or use an absolute path\");\n    }\n    Err(e) => eprintln!(\"sort: {e}\"),\n    Ok(_) => {}\n}","preventionTips":["Verify the compressor exists with `command -v` before passing --compress-program.","Use absolute binary paths to be immune to PATH differences (cron, CI, containers).","Install a standard compressor (gzip/zstd) in deployment images."],"tags":["sort","process-spawn","compress-program","cli"],"backgroundTag":"command-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}