backend/Dockerfile: retry apt-get on transient mirror 404s - #757
Merged
Conversation
deb.debian.org is a CDN in front of many mirror origins; a -security point-release rotation can leave one edge's index listing a filename another edge has already purged, producing a 404 an apt-get install can't recover from mid-run. Wrapping update+install in a retry loop lets a fresh apt-get update (which usually lands on a consistent edge) resolve it within the same build, instead of needing a whole CI job rerun. Verified live: this branch's AWS Preview workflow hit this exact failure 3 times in a row on 3 different packages (libtiff, libc-l10n, libperl); reproduced locally against the unmodified Dockerfile (libde265-0, arm64) while testing the fix. Confirmed the retry loop itself works (recovered from the same live mirror flakiness during a local arm64 build) and that the full build succeeds end-to-end on linux/amd64 (the real CI architecture) with the fix applied. No deploy-api.yml failure has ever been caused by this — checked its last ~30 runs; its only 2 failures were unrelated migration-task issues, apt-get succeeded in both. Folding this into #723 rather than a separate PR so the fix gets verified through this branch's own preview deploy, which is already hitting the failure live.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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.
`deb.debian.org` is a CDN in front of many mirror origins. A `-security` point-release rotation can leave one edge's index listing a filename another edge has already purged, producing a 404 mid-`apt-get install` that a single attempt can't recover from.
Fix: wrap `apt-get update && apt-get install` in a retry loop (5 attempts, 10s apart) — a fresh `apt-get update` on retry usually lands on a consistent edge.
Verified