Repository navigation
Conversation
Install packages (amd_release) failed on master sha 7039251 with dpkg: error processing archive clickhouse-common-static-dbg_26.8.1.673_amd64.deb cannot copy extracted data for './usr/lib/debug/usr/bin/clickhouse.debug' to '/usr/lib/debug/usr/bin/clickhouse.debug.dpkg-new': failed to write (No space left on device) The runner arrived at 55G used / 3.2G available / 95% full, while apt announces "After this operation, 4413 MB of additional disk space will be used". The first of 18 substeps therefore could not succeed, and the outcome was settled before the job wrote a byte. The job's own footprint is not the variable. It is constant at +3-4 GiB across green and failing runs alike, which is why the three merged fixes in this area (ClickHouse#111960 synchronous per-substep docker rm, ClickHouse#112751 stop installing dbg in most tests, ClickHouse#113032 binary tests last plus a non-interactive docker system prune) did not close it: all three shrink or reorder that constant footprint. All three are ancestors of this failing build. What discriminates green from red is the state the runner starts in: FAIL 7039251 amd i-0969e2fde61d860b0 55G used / 3.2G avail / 95% 1/18 fail GREEN 2251e69 amd i-0b4dbf6ffb28c656e 24G used / 34G avail / 42% 18/18 ok GREEN 2251e69 arm i-08f529e20e7f4090e 18G used / 41G avail / 31% 18/18 ok CIDB shows the same start-state exhaustion in 15 Install packages runs over the last 20 days, 7 on master and 8 on release branches (26.5 four, 26.6 two, 26.3 and 26.4 one each). Only 2 of the 15 carry this dpkg signature; the other 13 raise earlier, in the tgz substep, where docker run cannot allocate and exits 125, in 9 of the 13 while creating a containerd overlayfs snapshot dir and in the other 4 at another daemon-side path under /var/lib/docker or /tmp. All 13 are exit 125 and all 13 are ENOSPC in the same substep, so the start-state class is the same regardless of which allocation happens to be the one that fails. Those 13 abort the job before any test row exists, so CIDB records them with an empty test_name, which is why a breadth query keyed on the test name undercounts the class. One of them, a61e6f1 on 26.3, ran on this same instance i-0969e2fde61d860b0 54 minutes earlier, also one job after a Docker keeper image run: same box, same residue, a different substep happening to be the one that ran out. Install packages runs on the style-checker pool, which also hosts the multi-arch docker image builds. install_check.py pulls exactly two images, and the green runner's post-hook deleted exactly those two; the failing runner's post-hook deleted eight tags, six of which this job never pulled: five clickhouse/clickhouse-keeper:head-* tags, including arm64 ones on an amd runner, plus a stale install-deb-test tag. That residue has an identified producer. Joining on the CIDB instance_id, the job immediately before the failure on the same box is Docker keeper image for BackportPR ClickHouse#112982 (sha 934bc90, branch backport/25.8/108977), 14:33:46 to 14:38:30, with the install job starting at 14:45:21 and nothing in between. It ran in the non-push flavour (EVENT_TYPE='pull_request'), so its six builds used --output=type=docker and tagged every arch in the local image store, whereas a master-flavour run pushes by digest and creates no local arch tag. Its own post-hook removed exactly one of those six tags; the five survivors are the same five keeper tags the install job deleted 15 minutes later, and two of the image IDs it reported as "unable to delete (must be forced) - image is referenced in multiple repositories" before exiting 123 are among the IDs the install job then removed. The reason it left them is a hook version skew. At the producer's sha the cleanup hook has no forced pass at all, only builder prune, container prune and an unforced docker rmi. The forced pass over clickhouse/clickhouse- and clickhouse/install- images was added by ba64179, which is an ancestor of this failing master build but is not on the 25.8 line. Multi-arch head-* images share layers and so are referenced in multiple repositories, which is exactly what an unforced rmi refuses to remove. docker_clean_up_hook was registered only as post_hooks, so on the consumer side it frees that residue after the failure. Register the same hook as a pre_hooks entry as well, on both Install packages configs. That covers 4 parametrized jobs (amd and arm) across the PR, BackportPR, MasterCI and ReleaseBranchCI workflows, 8 job objects in total, each verified pre=1 post=1. Fixing the producer instead would mean backporting the newer hook to every release and backport branch still in flight, whereas defending at the consumer covers residue from any producer running any hook version. Nothing is narrowed or skipped: no glob, no package, no test, no assertion. Re-pulling the two install images costs seconds against a 900 s timeout: the measured deb+rpm totals in the three captured logs are 4 s, 12 s and 9 s. The reclaim is best-effort, deliberately. The hook ignores every Shell.check return and returns True; runner.py builds the pre-hook result but never feeds it into the flag gating the run, and appends it after the parent status was already computed. Adding strict=True was rejected: the hook is shared by four other post_hooks registrations, so failing closed would newly break unrelated checks on a cleanup hiccup, and gating a run on pre-hooks is a praktika-wide contract change. If the reclaim frees nothing the outcome is today's, never worse. Note that pre_hooks is not among the fields dropped from the job digest, so the config digest changes and the first run after merge is uncached instead of served from cache. That is intended: a result cached without the pre-hook should not satisfy the new config. There is no local reproducer, since the trigger is another job's leftover disk state on a shared runner, and a green run on this change proves nothing because it requires drawing a dirty runner. Validation is mechanical: pre_hooks verified non-empty on all four jobs, praktika yaml regenerating no workflow YAML, and the hook exiting 0 both on a clean store and on one seeded with the observed residue, which it removes while leaving unrelated images untouched.
Internal second-model review (click to expand)An independent reviewer read the change cold (without the author's evidence notes), then a
Final Gate B re-review of the frozen contract returned 0 findings, with coverage over Session id: cron:clickhouse-review-slot-48:20260804-082700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-47:20260804-005700 |
|
cc @maxknv, could you review this? |
|
Workflow [PR], commit [47b27da] Summary: ✅ AI ReviewSummaryThis PR extends Findings
Final VerdictChanges needed: digest |
The pre-hook this PR adds makes docker_clean_up_hook.py decide whether the runner has enough free disk before apt unpacks ~4.4 GB, so the script is now part of the job's behaviour rather than post-job hygiene only. The jobs' digest_config did not include it, so a change confined to the hook left is_affected_by() False for all four parametrized Install packages jobs and left the cache key unchanged: the job could be filtered out of a PR, or a cached green result reused, while the reclaim logic had changed. Measured before and after with a positive control on the include_paths half of Digest.calc_job_digest. Without the entry the digest is 5684fd678d80 both with a pristine hook and with the hook edited (3 files in the digest set, hook absent). With the entry the digest is 16be4c33999d pristine and cf0a65c9fea5 with the same edit, returning to 16be4c33999d when the edit is reverted (4 files, hook present). is_affected_by(["ci/jobs/scripts/job_hooks/ docker_clean_up_hook.py"]) flips False to True on all eight job instances across MasterCI, PR, BackportPR and ReleaseBranchCI. Two Job.Config entries are edited (install_check_jobs and install_check_master_jobs), which is four parametrized job objects and eight job instances; the amd_release and arm_release variants of each config share one digest_config object, so no variant is missed. No existing include_paths entry covered the script by prefix: the sets held only ./ci/jobs/ install_check.py and ./ci/docker/install. The repository already digests hook scripts this way for jobs whose hooks are behaviour-bearing: build_profile_hook.py in the build digest config, promql_compliance_hook.py in the integration-tests config, and llvm_coverage_hook.py in the LLVM Coverage config. After this change no job in any workflow names a pre-hook script its own digest does not cover. One consequence is intended: because Digest.calc_job_digest does not drop digest_config from the config half of the key, the first post-merge run of these jobs is uncached.
|
Follow-up to the review on this PR, which asked what keeps eating disk on the
style-checker runners despite the cleanup post hook. Measured over 12 master
`Install packages (amd_release)` runs: the job itself is a net producer of free
space, ending every run with 3.0 to 4.6 GB more available than it started. The
decrease happens between runs, and two co-tenants of that runner pool cause it.
`Compatibility check` shares the pool and had no cleanup hook at all, losing 4
to 5 GB per run over the 5 runs measured. Register the existing hook on it.
The Docker image jobs already run the hook, yet still lose 3 to 7 GB per run and
their hook reports `Total: 0B` with zero images untagged. Two reasons, both
reproduced locally with docker 29.5.1 and buildx v0.34.0:
- The image builds use the `docker-container` buildx driver, whose cache lives
in its own buildkit container. Neither `docker builder prune` on the default
builder nor `docker system prune` can reach it, and the buildkit image does
not match the hook's `clickhouse/` removal pattern. A fixture holding 740.8 MB
survived all four of the hook's commands untouched; pruning per builder
reclaims it. `buildx ls` is parsed rather than `ls --format json` so the
enumeration does not depend on a recent buildx.
- `sort -k3,3M` was applied to `{{.CreatedAt}}`, which is an ISO date, so every
date compared equal and the order fell through to `-k4,4n`, the hour alone.
On the local image list 3 of 4 repositories with more than one tag kept an
older image and deleted the newest, so the next job re-pulls what was just
evicted. `Jan 1 23:00` really does sort after `Dec 31 09:00` under that key.
The selection now names `Repository:Tag`, because `docker rmi <id>` without
`-f` refuses an id that several repositories still tag, which left such an
image and its layers behind.
Finally, `disk status after running a job` was printed inside `_run`, which
returns before the post hooks execute, so the reported numbers never included
the cleanup. In every Docker job log the last `df` precedes the post-hooks
section. Move the print to the end of `run` so it describes the disk the next
job actually inherits; it stays outside `if run_hooks` and ahead of the exit, so
it is reached on success and on failure alike.
The cleanup hook is shared with the Docker server and keeper jobs, so both fixes
reach them as well; that is the intent, since they are the measured consumers.
|
@maxknv thanks. Item 3 turned out to be the interesting one, so I measured it first and the answer changed what items 2 and 4 needed. Pushed as 1. Print after the post hooks. Done. 2. Post hook on the Docker server/keeper configs. Already there since 2026-01-06 ( 3. What eats the disk. Not Two co-tenants of the
Separately, the 4. Enhanced and applied to both. The cleanup is shared, so both fixes reach the Docker jobs automatically; One thing I did not do: |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
Related: #113032
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Install packages (amd_release)failed on master sha7039251dbe2db9b9f59c127ed1ec3ef3b1073183withdpkg: ... No space left on device(report).The job starts on a disk another job filled. The runner arrived 95% full (3.2 GiB free) while
aptneeds 4413 MB, so substep 1 of 18 was doomed. Measured over 12 master runs, the job is a net producer of free space (+3.0 to +4.6 GB each), so #111960, #112751 and #113032, all ancestors here, could not close it. The same exhaustion accounts for 15 runs in 20 days, 7 on master and 8 on release branches.Install packagesshares thestyle-checkerpool with the Docker image builds andCompatibility check. Registeringdocker_clean_up_hookas apre_hooksentry on bothInstall packagesconfigs (4 parametrized jobs across PR, BackportPR, MasterCI, ReleaseBranchCI) reclaims that residue before installing.The review then asked what still eats the disk.
Compatibility checkhad no cleanup hook at all and loses 4 to 5 GB per run, so it gets the post hook. The Docker jobs do run the hook yet still lose 3 to 7 GB, reportingTotal: 0Bwith zero images untagged, for two reasons reproduced locally on docker 29.5.1 / buildx v0.34.0: theirdocker-containerbuildx driver keeps its cache in its own buildkit container, which none of the hook's commands reaches (740.8 MB survived all four); andsort -k3,3Mover an ISO{{.CreatedAt}}compares every date equal, so the keep-the-latest step kept an older image in 3 of 4 local repositories. Both fixes live in the shared hook, so the Docker jobs get them too. The runner also printeddisk status after running a jobbefore the post hooks ran, so those numbers excluded the cleanup.No glob narrowed, no package skipped, no test touched. praktika does not propagate hook exit codes, so this stays best-effort.
Version info
26.8.1.938(included in26.8and later)