osv-scanner: version line can fail the job with SIGPIPE (exit 141) #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
osv-scanner/action.ymlcan fail theosvjob at random with exit 141 (SIGPIPE), before any scan runs.What happens
The
Install osv-scannerstep runs underset -euo pipefailand ends with:osv-scanner --versionprints more than one line.head -1prints the first and exits. If osv-scanner writes its next line afterheadhas closed the pipe, it is killed by SIGPIPE (128 + 13 = 141).pipefailmakes that the pipeline status andset -efails the step.Whether it fails depends on timing, so it is intermittent. Seen on Homelab/infra PR 879 (run 1612, task 10867, action pinned at
e7230799). The log shows the checksum line, thenosv-scanner version: 2.7.0, thenexitcode '141': failure45 ms later, with no scan output. The same commit passedosvon the re-run (run 1616), andosvpassed on the five runs before it.The line is still on
main(b8c53ba, line 41).Fix
Read all of the output so the writer never meets a closed pipe:
or drop the filter and print the whole version output. After the fix lands, repos that pin
ci/actions/osv-scanner@<sha>need their pin bumped to get it.Done when
action.ymlno longer pipes--versioninto an early-exiting reader underpipefailGenerated by Aki, acting as Claude