{"record":{"id":"e685e8fe8d9ddedf","repo":"FuelLabs/fuels-rs","slug":"program-find-not-in-path","errorCode":null,"errorMessage":"Program `find` not in PATH","messagePattern":"Program `find` not in PATH","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/check-docs/src/lib.rs","lineNumber":255,"sourceCode":"        .arg(pattern)\n        .arg(location)\n        .output()\n        .expect(\"failed grep command\");\n\n    if !grep_project.status.success() {\n        bail!(\"Failed running `grep` command for pattern '{}'\", pattern);\n    }\n\n    Ok(String::from_utf8(grep_project.stdout)?)\n}\n\npub fn find_files(pattern: &str, location: &str, exclude: &str) -> anyhow::Result<String> {\n    let find = std::process::Command::new(\"find\")\n        .args([\n            location, \"-type\", \"f\", \"-name\", pattern, \"!\", \"-name\", exclude,\n        ])\n        .output()\n        .expect(\"Program `find` not in PATH\");\n\n    if !find.status.success() {\n        bail!(\"Failed running `find` command for pattern {}\", pattern);\n    }\n\n    Ok(String::from_utf8(find.stdout)?)\n}\n","sourceCodeStart":237,"sourceCodeEnd":263,"githubUrl":"https://github.com/FuelLabs/fuels-rs/blob/d9a250a51818dda64bfeb5ef7cc19cf27bdcd623/scripts/check-docs/src/lib.rs#L237-L263","documentation":"check-docs shells out to the find binary via std::process::Command to enumerate files and expects the spawn to succeed. The expect fires when the find executable is not on PATH or cannot be spawned; a find that runs but fails is reported separately by bail!.","triggerScenarios":"Running check-docs in an environment where findutils is not installed (minimal containers, stripped-down CI images) or where PATH does not include the directory containing find.","commonSituations":"Distroless Docker images; Nix/scratch environments without findutils; CI PATH scrubbing.","solutions":["Install findutils in the image (apt-get install -y findutils / apk add findutils)","Run the script from an environment with standard core utilities on PATH","Verify PATH includes /usr/bin (or wherever find lives)"],"exampleFix":"# before\nRUN cargo run -p scripts/check-docs # panics: Program `find` not in PATH\n\n# after\nRUN apt-get update && apt-get install -y findutils\ncargo run -p scripts/check-docs","handlingStrategy":"fallback","validationCode":"# (shell) availability check before running check-docs\ncommand -v find >/dev/null || { echo 'find (findutils) is required by check-docs'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install findutils in the environment running the docs checks","Or replace the external find call with a pure-Rust walker (walkdir/glob crate) so no system dependency exists","Pin CI images that ship core utilities"],"tags":["docs","ci","shell","dependencies","scripting"],"backgroundTag":null,"analyzedSha":"d9a250a51818dda64bfeb5ef7cc19cf27bdcd623","analyzedAt":"2026-08-16T09:49:30.618Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}