pipeline-doctor crashes with 'awk: command not found' (exit 127) in its Nix runtime #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
pipeline-doctortool, when run vianix runin a minimal CI environment (e.g. thenixos/nix:2.24.9image used by Woodpecker), crashes with:and exits 127. All contract checks PASS first — the crash is in the script's own later logic that shells out to
awk/gawk, which is not on PATH in the Nix-built derivation.Impact: any repo wiring pipeline-doctor as a CI step sees the whole workflow abort (downstream build/publish skipped) unless that step is marked
failure: ignore. Observed inoleks/gitea-mcppipeline #16 (build + publish skipped); worked around locally in that repo's.woodpecker.yamlby making the non-blocking doctor step tolerant — but the root cause is here.Root cause: the pipeline-doctor Nix derivation/runtime does not include
gawk(or whatever providesawk) in itsPATH/buildInputs.Fix: add
gawkto the wrapper's runtime inputs (e.g.makeWrapper ... --prefix PATH : ${lib.makeBinPath [ gawk ]}or add it tobuildInputs), or replace theawkcalls with shell/jqequivalents already available.Repro: run
nix run git+https://git.oleks.space/oleks/parity-lib#pipeline-doctoragainst any repo inside thenixos/niximage (no system awk).Fixed in
58f090d— addedgawkto pipeline-doctor'sruntimeInputs.writeShellApplicationrestricts PATH to its declared inputs, which omitted gawk, so the token-leak check's awk-based line-continuation flattening crashed withawk: command not found(exit 127) in minimal Nix runtimes.Verified:
nix build .#pipeline-doctorthen running it against a repo → 9 passed, 0 failed, exit 0 (no awk error).Note:
oleks/gitea-mcpstill keepsfailure: ignoreon its doctor step as defense-in-depth for a read-only non-blocking lint; that can stay or be reverted now that the root cause is gone.