Repository navigation
Retry docker buildx on a registry status failure regardless of the request method - #117301
Conversation
…quest method `Docker keeper image` failed resolving its two base images from Docker Hub with `httpReadSeeker: failed open: unexpected status from GET request to ...: 400 Bad Request`, and the retry did not fire: `No retryable errors found, stopping retries`, `command failed after 1/2 attempt(s)`. `BUILDX_RETRY_ERRORS` carried `unexpected status from HEAD request`, and its status-code entries are 429/5xx only, so nothing matched a 400 on a GET. The method is an interpolated field of a single containerd format string, `unexpected status from %s request to %s: %s`, so the entry only ever covered whichever method happened to be observed when it was written. Dropping the method from the token makes it a strict superset of the entry it replaces: the removed string contains the new one as a prefix, so every stderr line retried before is still retried. A second attempt would have worked. The failing leg died at metadata resolution after 951 s, while `head-alpine-arm64`, same platform and same two base images, resolved both fresh in 0.6 s each only 9 s later. So this was one invocation stuck on one poisoned request pair, and the 400 was transient, which is also why a status-code allowlist is unsound for this failure mode. The token accepts a permanent 4xx too. That is bounded by `BUILDX_RETRIES = 2`, it is already the status quo for HEAD, and `buildx_timeout` already divides the remaining job budget by 2 attempts, so a second attempt consumes budget the model already reserves. Neither the attempt count nor the timeout divisor changes here. Validated by replaying the captured stderr through `Shell.run`: master's list matches 0 of its 17 runtime tokens and stops at 1/2 attempts, byte-identical to the CI log, while the new token matches 3 lines and reaches 2/2. Changing only GET to HEAD in that same capture makes master's own unmodified list retry it, which isolates the request method as the whole defect. Genuine permanent buildx failures, including a live capture, still fail fast on the first attempt. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114975&sha=42581e0c27fdd48645f31bdb01747e2c06d8d98b&name_0=PR&name_1=Docker%20keeper%20image PR: ClickHouse#114975 Related: ClickHouse#114975 (comment) Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold
I re-derived the load-bearing claims independently rather than accepting them. Reconstructing Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20260831-083300 |
Pre-PR validation gate (click to expand)
Mutation battery, each required to redden the fixed arm: reverting the token and typo-ing the token both restore
Session id: cron:clickhouse-impl-slot-5:20260831-074502 |
|
Workflow [PR], commit [6c0c91c] Summary: ✅ AI ReviewSummaryThis PR broadens Final Verdict✅ No new inline findings. |
|
cc @maxknv, could you review this? |
c9e1252
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Retry
docker buildxwhen the registry answers with a non-2xx status for any request method, not onlyHEAD.Description
Docker keeper imagefailed resolvingalpine:latestandubuntu:22.04from Docker Hub withhttpReadSeeker: failed open: unexpected status from GET request to ...: 400 Bad Request. The retry did not fire:No retryable errors found, stopping retries,command failed after 1/2 attempt(s).BUILDX_RETRY_ERRORScarriedunexpected status from HEAD request, and its status-code entries are 429/5xx only, so nothing matched a 400 on aGET. The method is an interpolated field of one containerd format string,unexpected status from %s request to %s: %s, so pinning it covered only the method observed then. I replace it with the method-agnostic prefix, a strict superset of the entry it replaces, so nothing retried today stops being retried.A second attempt would have worked: the failing leg died at metadata resolution after 951 s, while
head-alpine-arm64, same platform and base images, resolved both fresh 9 s later.Trade-off: the token also accepts a permanent 4xx. That is bounded by
BUILDX_RETRIES = 2, is already the status quo forHEAD, andbuildx_timeoutalready divides the job budget by 2 attempts. Allowlisting "transient" status codes is unsound here, since the observed 400 was itself transient.Footprint over 45 days: 6 job runs across both docker image jobs and three workflows, none on master. The
Failed to fetchapt-mirror class is a different, already-handled signature.Validation: replaying the captured stderr through
Shell.runreproduces the CI lines byte-for-byte, and reaches2/2 attempt(s)with the change; changing onlyGETtoHEADmakes master's own list retry it. Permanent failures still fail fast.ci/praktika/docker.pyholds separate, deliberately narrower retry lists for other jobs; none matches this error, and CIDB shows no occurrence of it there. Itsmerge_manifesthas no retries at all.No related open issue found.
Related: #114975 (comment)
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114975&sha=42581e0c27fdd48645f31bdb01747e2c06d8d98b&name_0=PR&name_1=Docker%20keeper%20image
Workflow [PR]
Sync PR [sync-upstream/pr/117301]