Skip to content

ci: the deploy image check retries transient registry errors instead of failing on them - #632

Merged
scttfrdmn merged 4 commits into
mainfrom
fix/image-check-transient
Oct 19, 2026
Merged

scttfrdmn merged 4 commits into
mainfrom
fix/image-check-transient

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

The image-existence step I added in #619 (for #600) failed Dependabot's #622 with does not resolve on an image that exists. Docker Hub had answered 502 Bad Gateway, and the step treated every error other than a 429 as a missing image. So a registry hiccup failed an unrelated PR, which is the opposite of what the check is for.

Now: three outcomes

Registry answer Verdict
manifest unknown / not found / denied / unauthorized ❌ fails: the image is gone (the #600 defect)
any 5xx, 429, timeout, reset 🔁 retried 3× with backoff, then a visible ⚠️ warning
anything unrecognised ❌ fails, so a new error gets read rather than waved through

Verified

The step's own loop, run against a stubbed docker:

ok   img/ok
ok   img/flaky                     ← 502, then success on retry
::warning::img/down could not be checked after 3 attempts; … 502 Bad Gateway
::error::img/gone does not resolve: no such manifest: …
::error::img/weird gave an unrecognised registry error, read it: …

The real Docker Hub answer for the deleted minio/minio:RELEASE.2025-09-07T16-13-09Z is denied: requested access to the resource is denied … unauthorized, which classifies as missing. The check still catches the #600 case.

🤖 Generated with Claude Code

…of failing on them

The step added for #600 failed Dependabot's #622 with 'does not resolve' on
an image that exists: Docker Hub answered 502 Bad Gateway. It treated every
non-429 error as a missing image.

Now there are three outcomes. Manifest unknown / not found / denied fails,
which is the defect. Any 5xx, 429 or timeout is retried three times with
backoff, then reported as a visible warning: a registry outage says
nothing about whether the image exists. Anything unrecognised still fails,
so a new error is read rather than waved through.

Tested by running the step's own loop against a stubbed docker: a flaky
502 recovers to ok, a persistent 502 warns, a missing image and an unknown
error both fail. The real Docker Hub answer for the deleted
minio/minio:RELEASE.2025-09-07 image is 'denied ... unauthorized', which
classifies as missing.
@scttfrdmn
scttfrdmn enabled auto-merge (squash) October 19, 2026 20:19
@scttfrdmn
scttfrdmn merged commit 8ac2998 into main Oct 19, 2026
56 checks passed
scttfrdmn added a commit that referenced this pull request Oct 21, 2026
…ls (#633) (#635)

Go does not retry a module fetch. A single HTTP/2 stream error from
proxy.golang.org or sum.golang.org failed five correct PRs in October
(#582, #631, #622, #614, #632) before anything compiled. Each module that
failed had just been bumped on main, and the Security Scan failures came
from uncached @latest tool installs.

.github/scripts/go-retry.sh runs a go command and splits failures three
ways. A transient answer (stream INTERNAL_ERROR, 5xx, timeout, reset) is
retried with backoff, and each retry is printed. A missing module, or any
other error, fails on the first attempt. A checksum mismatch / SECURITY
ERROR is checked first and never retried, even beside a transient-looking
line, so a corrupted download can't be retried until a lucky attempt hides
it. Still transient after three attempts is a failure: a build can't
proceed without its modules.

Every job that sets up Go (18 across ci.yml, security.yml, release.yml and
live-aws.yml) fetches modules through it as the step after setup-go.
security.yml's existing bare 'go mod download' is replaced. gosec,
govulncheck and go-licenses are pinned (v2.29.0, v1.9.0, v1.6.0) rather
than @latest and installed through it; govulncheck had already moved from
v1.8.0 under @latest with no commit. The MinIO and substrate installs go
through it too.

Tests:
- TestGoRetryScriptRetriesOnlyTransientModuleServerErrors runs the real
  script against a stub go, asserting the number of attempts as well as
  the exit status. Removing the checksum guard, retrying everything, and
  never retrying each fail the cases they should.
- TestEveryGoJobFetchesModulesThroughTheRetry walks every workflow: a
  retry download after setup-go with no go before it, no bare go install,
  no @latest. Floor of 15 Go jobs. Deleting a job's download step, adding
  @latest back, a bare go install, and a go build before the download each
  fail naming the job and step.

Against real go, with a local proxy that 502s the first two requests into
an empty GOMODCACHE: two visible retries, then success. A nonexistent
version 404s and fails in 2s with no retry. Pinned govulncheck v1.9.0
reports no vulnerabilities, and go-licenses v1.6.0 passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant