Repository navigation
Conversation
The "Docker server image" job builds the distroless/alpine/ubuntu images with `docker buildx build`. buildx resolves the SBOM scanner image (docker/buildkit-syft-scanner, pulled because of --sbom=true) and base images from docker.io. When docker.io has a transient outage, the build fails at: ClickHouse#2 resolve image config for docker-image://docker.io/docker/buildkit-syft-scanner:stable-1 ClickHouse#2 ERROR: unexpected status from HEAD request to https://registry-1.docker.io/... and the downstream "docker library image test" then reports "image does not exist!" as a secondary victim. praktika's Shell.run / Result.from_commands_run already support retries with exponential backoff and an error allowlist, but the buildx build and the imagetools merge commands ran with no retries. Wire retries=5 and an allowlist of transient registry/network signatures into both. The allowlist keeps fail-fast behavior for genuine Dockerfile/build errors. This mirrors the existing retry hardening for the in-Dockerfile wget downloads (ClickHouse#105139) and the keeper image S3 artifact fetch (ClickHouse#108675). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-7:20260630-203100 |
|
cc @maxknv — could you review this? It adds retries (praktika's native |
|
Workflow [PR], commit [f0de148] Summary: ✅ AI ReviewSummaryThis PR adds retry handling for transient registry/network failures around the Final VerdictStatus: ✅ Approve Minimum required actions: none. |
AI review on ClickHouse#108969 flagged that BUILDX_RETRY_ERRORS matched progress-only text. buildx emits "resolve image config for docker-image://..." as normal --progress=plain output (--sbom/--provenance pull the syft scanner and base images on every build), and praktika's retry scans every stderr line for any substring. So a later RUN/COPY/package-install/Dockerfile failure that runs after that progress line was retried 5x even though its error was not transient. Drop the progress-only and broad substrings ("resolve image config", "registry-1.docker.io", "error from registry") and keep only actual registry/network failure signatures: "failed to do request", "unexpected status from HEAD request" (the motivating docker.io HEAD-500 outage), "TLS handshake timeout", "i/o timeout", "connection reset by peer", "connection refused". None of these appear in normal progress output, so genuine Dockerfile/build errors fail fast on the first attempt. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Narrowed Removed the progress-only/broad substrings: |
The two signatures added in ClickHouse#118213 were justified by what the base image contains: on a pristine `ubuntu:22.04`, a package Ubuntu ships that has no installation candidate or unmet dependencies can only be resolving against a partial index. That inference holds, but it does not cover the third shape apt produces. Which of the three it picks depends only on what the missing suites were providing: `busybox`, `ca-certificates` and `locales` come out as `has no installation candidate` because `/var/lib/dpkg/status` still names them, a `wget` whose `libpsl5` has gone comes out as `Unable to correct problems, you have held broken packages`, and `wget` and `tzdata` with nothing left to refer to them come out as the one shape that was missing, `Unable to locate package`. Two of the ten image builds that reded on 2026-09-05 after 05:00 UTC were that third shape, so they still did not reach Canonical. `Unable to locate package` is also, unlike the other two, exactly what a misspelled package name in one of these Dockerfiles produces, so adding it to `APT_MIRROR_ERRORS` would have cost the fail-fast property that the narrowed retry allowlist of ClickHouse#108969 exists to keep. There is no need to infer any of this. `apt-get update` says so itself, in the very same step: `W: Some index files failed to download`, printed once it has warned about each suite the mirror withheld. Against a healthy mirror it refreshes every suite silently, so that line is the mirror's own signature, and a genuine packaging error - whose `apt-get update` was clean - carries none of it. `is_apt_index_failure` requires both halves, and both from the step the build stopped on: the resolution error inside the terminal fenced block, and the warning among the same step's `#N `-prefixed output above it, which is the only thing tying the two together once buildx has fenced the tail. All three shapes then move behind that evidence, so this commit widens the coverage and narrows the licence at the same time. Verified with a throwaway test against the real logs of all twelve failed builds from CIDB: master says yes for ten of them and this commit for all twelve. Eight negative cases still say no - a misspelled package in each of the three shapes, an index warning belonging to an earlier successful step, the signature only in the fenced step header, a truncated log with no terminal block, a non-apt failure, and a recovered warning followed by a genuine `dpkg` error in the same step. Example failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=dab9efce85ab16d6811013d2e2d03ad8245f398f&name_0=MasterCI&name_1=Docker%20server%20image
AI review on ClickHouse#108969 flagged that BUILDX_RETRY_ERRORS matched progress-only text. buildx emits "resolve image config for docker-image://..." as normal --progress=plain output (--sbom/--provenance pull the syft scanner and base images on every build), and praktika's retry scans every stderr line for any substring. So a later RUN/COPY/package-install/Dockerfile failure that runs after that progress line was retried 5x even though its error was not transient. Drop the progress-only and broad substrings ("resolve image config", "registry-1.docker.io", "error from registry") and keep only actual registry/network failure signatures: "failed to do request", "unexpected status from HEAD request" (the motivating docker.io HEAD-500 outage), "TLS handshake timeout", "i/o timeout", "connection reset by peer", "connection refused". None of these appear in normal progress output, so genuine Dockerfile/build errors fail fast on the first attempt. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…image-buildx-registry-retry Retry docker buildx on transient docker.io registry errors
Related: #105139
Related: #108675
Changelog category (leave one):
Description
The
Docker server imagejob builds the distroless/alpine/ubuntu images withdocker buildx build. buildx resolves the SBOM scanner image (docker/buildkit-syft-scanner, pulled because of--sbom=true) and the base images from docker.io. A transient docker.io outage fails the build at the resolve step, e.g.:and the downstream
docker library image testthen reportsimage does not exist!as a secondary victim.praktika's
Shell.run/Result.from_commands_runalready support retries with exponential backoff plus an error allowlist, but the buildx build and the imagetools merge ran with no retries. This wiresretries=5and an allowlist of transient registry/network signatures into both calls. The allowlist keeps fail-fast behavior for genuine Dockerfile/build errors. Mirrors the existing retry hardening for in-Dockerfile wget downloads (#105139) and the keeper image S3 artifact fetch (#108675).Observed on master and PRs during a ~6 min docker.io blip on 2026-06-30 15:00-15:06 UTC (recovered on its own). Report (master): https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=36f0c2d95475aafa597cacebace14f5888908dcd&name_0=MasterCI&name_1=Docker%20server%20image
Version info
26.7.1.307(included in26.7and later)