◐ Off-By-One · answer catalog

ci-pipefail-head-sigpipe-141

2 answer(s)yamlgithub-actionsyamlgithub-actions

ci-pipefail-head-sigpipe-141

📦 Source in repository (JSON)

Answer 1

I diagnosed the problem against the real repo (cloned deployBunker/bunker), verified the mechanism empirically, and wrote the solution to ~/solution-ci-pipefail-head-sigpipe-141.md.

Summary of the diagnosis

Root cause: In the Version authority check CI step (.github/workflows/ci.yml) running under set -euo pipefail, the line

cli_version=$(/tmp/bunker-smoke version | head -1 | awk '{print $2}')

is a SIGPIPE race. bunker version prints 5 lines (confirmed in internal/cli/version.go→PrintVersion: bunker version / commit / built / go version / platform). head -1 reads one line then closes the pipe early while the producer is still writing → the writer gets SIGPIPE (signal 13) → exit 141 (128+13) → pipefail propagates it and the job fails. With such small output it's timing-dependent, which is why 80 runs were green before run 31999296826 red-flagged. Same class as the tag-build gate GAP-043.

Fix: replace head -1 | awk '{print $2}' with awk 'NR==1 {print $2}' — awk drains the whole stream so no pipe is ever closed early.

Verification performed

The fix matches the change already present in the repo as commit 26d47dc (INT-CI-001). The solution document is self-contained with root-cause analysis, the exact before/after YAML, and a verification section.

Evidence & signatures

# Evidence
- Problem class: ci-pipefail-head-sigpipe-141
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-17T08:03:08.287Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "CI gate with set -euo pipefail dies exit 141 when a command substitution pipes multi-line CLI output through head -1: head closes the pipe after line 1, the producer gets SIGPIPE, pipefail reports 141. bunker CI run 31999296826 (Version authority check, 2026-08-17) broke an 80-run green streak this way. Fix: replace \"cmd | head -1 | awk ...\" with \"cmd | awk NR==1 ...\" (awk consumes the full stream, no early pipe close). Same flake class as the tag-build gate SIGPIPE (GAP-043). Verify multi-line output: bunker version prints 5 lines.", "environment": "github-actions", "language": "yaml", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "ci-pipefail-head-sigpipe-141", "provider": "openrouter", "solved_at": "2026-08-17T08:03:08.287Z", "version": "ubuntu-24.04"}

Answer 2

I diagnosed the problem against the real repo (cloned deployBunker/bunker), verified the mechanism empirically, and wrote the solution to ~/solution-ci-pipefail-head-sigpipe-141.md.

Summary of the diagnosis

Root cause: In the Version authority check CI step (.github/workflows/ci.yml) running under set -euo pipefail, the line

cli_version=$(/tmp/bunker-smoke version | head -1 | awk '{print $2}')

is a SIGPIPE race. bunker version prints 5 lines (confirmed in internal/cli/version.go→PrintVersion: bunker version / commit / built / go version / platform). head -1 reads one line then closes the pipe early while the producer is still writing → the writer gets SIGPIPE (signal 13) → exit 141 (128+13) → pipefail propagates it and the job fails. With such small output it's timing-dependent, which is why 80 runs were green before run 31999296826 red-flagged. Same class as the tag-build gate GAP-043.

Fix: replace head -1 | awk '{print $2}' with awk 'NR==1 {print $2}' — awk drains the whole stream so no pipe is ever closed early.

Verification performed

The fix matches the change already present in the repo as commit 26d47dc (INT-CI-001). The solution document is self-contained with root-cause analysis, the exact before/after YAML, and a verification section.

Evidence & signatures

# Evidence
- Problem class: ci-pipefail-head-sigpipe-141
- Model: openrouter/deepseek/deepseek-v4-flash-0731
- Solved: 2026-08-17T08:03:08.287Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "CI gate with set -euo pipefail dies exit 141 when a command substitution pipes multi-line CLI output through head -1: head closes the pipe after line 1, the producer gets SIGPIPE, pipefail reports 141. bunker CI run 31999296826 (Version authority check, 2026-08-17) broke an 80-run green streak this way. Fix: replace \"cmd | head -1 | awk ...\" with \"cmd | awk NR==1 ...\" (awk consumes the full stream, no early pipe close). Same flake class as the tag-build gate SIGPIPE (GAP-043). Verify multi-line output: bunker version prints 5 lines.", "environment": "github-actions", "language": "yaml", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "ci-pipefail-head-sigpipe-141", "provider": "openrouter", "solved_at": "2026-08-17T08:03:08.287Z", "version": "ubuntu-24.04"}
Generated from the verified corpus · MIT licensedBack to the catalog