fix: exit non-zero when the asdf download fails - #623
Open
blimmer wants to merge 2 commits into
Open
Conversation
Sometimes GitHub can be having a bad time. `curl` implements a default exponential backoff retry, which should help mitigate any partial failures that GitHub might experience and allow builds to continue.
--retry alone does not stop a failed download from being extracted. curl ran without --fail, so an HTTP error exited 0 and the response body was written to downloadPath. tar then failed on it with "not in gzip format", one step after the download had already reported success. Reproduced against a missing release asset: curl -sSL -o out.tar.gz <404 url> # exit 0, out.tar.gz contains "Not Found" curl -fsSL -o out.tar.gz <404 url> # non-zero exit, no file written --retry-all-errors covers the rest: a non-transient status is not in --retry's set, and a truncated transfer is not retried without it. The download URL comes from release metadata fetched moments earlier, so an error on it is unexpected rather than a caller mistake, which makes retrying every error preferable to failing fast on the first one.
This was referenced Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #622.
curlran without--fail, so an HTTP error exited 0 and the response body got written todownloadPath.tarthen failed on it withnot in gzip format, one step after the download had already reported success.Reproduced against a missing release asset:
The first commit here is @CGA1123's from #608, cherry-picked unchanged.
--retry 5helps but doesn't close the hole on its own: a non-transient status isn't retried, and once retries run out curl still exits 0 and still writes the body.--failis what turns the corrupt file into an error you can actually see.On
--retry-all-errors: a genuine 404 now takes ~30s to fail instead of failing immediately. That seemed like the right trade, since the download URL comes from release metadata fetched moments earlier, so an error on it is unexpected rather than a caller mistake. Happy to drop it if you'd rather fail fast.Tagged this as
v4.0.1-curl-fail.1on my fork if anyone needs it before this merges.