Repository navigation
Rebuild against Canonical when the in-region apt mirror serves a partial index - #118213
Conversation
…ial index When the in-region mirror withholds a suite's `InRelease` (a `503` for `jammy`, `jammy-updates` and `jammy-security` on 2026-09-05), `apt-get update` only warns and carries on with the suites it did get, so the failure surfaces on `apt-get install` as `E: Package 'ca-certificates' has no installation candidate` or `E: Unable to correct problems, you have held broken packages`. `is_apt_mirror_failure` did not know either shape, so every arm64 keeper image build on the fleet reded without ever trying Canonical. Both lines are still required to be apt `E:` output inside the terminal buildx failure block, so a recovered `apt-get update` warning or a step header naming apt still does not trigger a rebuild. Example: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117960&sha=e523443dea969b125df53bdba9f23e04c37cc19b&name_0=PR&name_1=Docker%20keeper%20image (PR: #117960) Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Workflow [PR], commit [ef376f2] Summary: ✅ AI ReviewSummaryThis PR broadens Findings
Final Verdict
|
| # resolved against is a partial one, i.e. the mirror. Measured on 2026-09-05, | ||
| # when every arm64 keeper image build on the fleet reded this way and no build | ||
| # ever reached Canonical. | ||
| "has no installation candidate", |
There was a problem hiding this comment.
The contract here is "a partial Ubuntu index rebuilds against Canonical", but this patch still leaves that behavior proven only by the PR description. terminal_build_failure / is_apt_mirror_failure already regressed once when buildx changed its wording, and this change extends the same string-matching parser without any committed ci/tests coverage, so the next output drift will silently take us back to failing on the first mirror.
Please land the throwaway reproducer as a focused parser test: one captured failing block where should_try_next_mirror must return True for the W: Failed to fetch ... plus E: Unable to correct problems, you have held broken packages shape, and one negative sample where the same warning appears in an earlier successful step but the terminal failure is unrelated.
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
…n apt mirror serves a partial index
Backport #118213 to 26.8: Rebuild against Canonical when the in-region apt mirror serves a partial index
Related: #115726
Related: #117960
The
Docker keeper imagejob reded on every arm64 build across the fleet on 2026-09-05 (10 of 10 PRs at 00:00 UTC, again at 04:00 UTC) and on an amd64 build on 2026-09-04, and none of them rebuilt against Canonical although the apt mirror fallback from #115726 is in place.The in-region mirror answered
503for thejammy,jammy-updatesandjammy-securityInReleasefiles.apt-get updatetreats that as a warning (W: Failed to fetch ...,W: Some index files failed to download) and carries on with the one suite it did get, so it exits 0 and theE:lands on theapt-get installthat follows, asE: Package 'ca-certificates' has no installation candidateorE: Unable to correct problems, you have held broken packages(wget : Depends: libpsl5 ... but it is not installable).is_apt_mirror_failuredid not know either shape, soshould_try_next_mirrorsaid no and the job failed on the first mirror.This adds the two signatures to
APT_MIRROR_ERRORS. The two guards from the original fallback stay in force: only aptE:lines inside the terminal buildx failure block count, so a recoveredapt-get updatewarning, a step header naming apt, or a truncated log without the fenced shape still does not trigger a rebuild. On the pristine base image these Dockerfiles start from, a package Ubuntu ships that has no candidate or unmet dependencies can only mean the index apt resolved against is a partial one.Verified with a throwaway test against the real logs of two failed builds from CIDB: master's classifier says no for both, the patched one says yes, and the negative cases (recovered warnings with a later
wgetfailure, signature only in the step header,E:in an earlier successful step, no terminal block) still say no.Example failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117960&sha=e523443dea969b125df53bdba9f23e04c37cc19b&name_0=PR&name_1=Docker%20keeper%20image
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Workflow [PR]
Sync PR [sync-upstream/pr/118213]
Version info
26.8.3.47