Skip to content

Retry buildx on transient registry/mirror errors in Docker server image job - #108986

Merged
alexey-milovidov merged 2 commits into
masterfrom
ci-fix-docker-server-image-registry-retries
Jul 1, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
ci-fix-docker-server-image-registry-retries

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jun 30, 2026 •

Copy link
Copy Markdown
Member

Closes: #104152
Related: #108969

The Docker server image (and Docker keeper image) job runs each docker buildx build and docker buildx imagetools create command exactly once. As a result a brief Docker Hub (registry-1.docker.io) hiccup, or a transient apt-get mirror blip during the build, fails the entire Master CI job even though nothing in ClickHouse is broken.

This was seen on master as HTTP 500 Internal Server Error responses from Docker Hub both while resolving the docker/buildkit-syft-scanner helper image (pulled by --sbom=true) and while pushing image layer blobs:

https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=36f0c2d95475aafa597cacebace14f5888908dcd&name_0=MasterCI&name_1=Docker%20server%20image

Both buildx invocations in build_and_push_image pass retries and a retry_errors allow-list of transient registry and package-mirror signatures. Matching is substring-based against the command's stderr and only fires on these signatures, so a genuine build error still fails fast (it is not retried). The retries also cover the Keeper image job, which shares build_and_push_image.

While this was in review, #108969 landed the base retry mechanism on master (the retries wiring plus a smaller BUILDX_RETRY_ERRORS allow-list). This branch has been merged with it: the mechanism is now shared, and the remaining change here broadens that allow-list to also cover the Docker Hub HTTP 5xx / 429 responses, unexpected EOF, and the apt-get mirror failures (Failed to fetch / Connection failed / Connection timed out) — the exact signatures from #104152 that the original list did not match.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

🤖 Generated with Claude Code

Version info

  • Merged into: 26.7.1.318 (included in 26.7 and later)

…ge job

The `Docker server image` Master CI job runs each `docker buildx build` and
`docker buildx imagetools create` command exactly once, so a brief Docker Hub
(`registry-1.docker.io`) hiccup or an `apt-get` mirror blip fails the whole job.

This was observed as HTTP `500 Internal Server Error` responses from Docker Hub
both while resolving the `docker/buildkit-syft-scanner` helper image (pulled by
`--sbom=true`) and while pushing image layer blobs:

  https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=36f0c2d95475aafa597cacebace14f5888908dcd&name_0=MasterCI&name_1=Docker%20server%20image

Add `retries` plus a `retry_errors` allow-list of transient registry and
package-mirror signatures to both `buildx` invocations in `build_and_push_image`,
mirroring the existing retry-on-`manifest unknown` pattern in
`ci/praktika/docker.py`. Matching is substring-based against stderr and only
fires on these signatures, so a genuine build error still fails fast. This also
covers the Keeper image job, which shares `build_and_push_image`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4918be1]

Summary: ✅


AI Review

Summary

This PR broadens the retry allow-list for the Docker server/Keeper image buildx commands so transient Docker Hub, network/TLS, and apt-get mirror failures can be retried by the existing Result.from_commands_run retry path. The cited CI failure contains the newly covered Docker Hub 500 Internal Server Error / unexpected status from HEAD request signatures, and the matcher still stops after the first non-allow-listed stderr failure, so I did not find a correctness or CI reliability issue worth an inline finding.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 30, 2026
…r-image-registry-retries

# Conflicts:
#	ci/jobs/docker_server.py

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds nice.

@alexey-milovidov alexey-milovidov self-assigned this Jul 1, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 1, 2026
Merged via the queue into master with commit 61b644e Jul 1, 2026
174 checks passed
@alexey-milovidov
alexey-milovidov deleted the ci-fix-docker-server-image-registry-retries branch July 1, 2026 03:04
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 1, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…rver-image-registry-retries

Retry buildx on transient registry/mirror errors in Docker server image job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Docker server image' CI check is flaky

2 participants