e2e: podman system prune --build clean up after terminated build flaky
2026-06-04T19:25:19.1292813Z [It] podman system prune --build clean up after terminated build
2026-06-04T19:25:19.1293114Z /var/tmp/podman/test/e2e/prune_test.go:609
2026-06-04T19:25:19.1293277Z
2026-06-04T19:25:19.1293356Z Timeline >>
2026-06-04T19:25:19.1293707Z > Enter [BeforeEach] TOP-LEVEL - /var/tmp/podman/test/e2e/common_test.go:123 @ 06/04/26 19:25:16.408
2026-06-04T19:25:19.1296057Z Running: /var/tmp/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-3665299284/imagecachedir --root /tmp/podman-e2e-3665299284/subtest-1508744269/p/root --runroot /tmp/podman-e2e-3665299284/subtest-1508744269/p/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --cgroup-manager systemd --tmpdir /tmp/podman-e2e-3665299284/subtest-1508744269/p --events-backend file --storage-driver overlay system service --time 0 unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock
2026-06-04T19:25:19.1298572Z < Exit [BeforeEach] TOP-LEVEL - /var/tmp/podman/test/e2e/common_test.go:123 @ 06/04/26 19:25:16.51 (102ms)
2026-06-04T19:25:19.1299575Z > Enter [It] podman system prune --build clean up after terminated build - /var/tmp/podman/test/e2e/prune_test.go:609 @ 06/04/26 19:25:16.51
2026-06-04T19:25:19.1302154Z Running: /var/tmp/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-3665299284/imagecachedir --root /tmp/podman-e2e-3665299284/subtest-1508744269/p/root --runroot /tmp/podman-e2e-3665299284/subtest-1508744269/p/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /tmp/podman-e2e-3665299284/subtest-1508744269 --cgroup-manager systemd --tmpdir /tmp/podman-e2e-3665299284/subtest-1508744269/p --events-backend file --storage-driver overlay system service --time 0 unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock
2026-06-04T19:25:19.1305176Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock build --pull-never --layers=false --file /tmp/podman-e2e-3665299284/subtest-1508744269/p/Dockerfile-f5bc9e4b09c70839123764a530f339ee00eaa484894f4eeb933ec56c5fbf59c7 -t alpine_notleaker:latest /tmp/podman-e2e-3665299284/subtest-1508744269/p
2026-06-04T19:25:19.1306681Z time="2026-06-04T19:25:16Z" level=warning msg="IdleTracker: StateClosed transition by connection marked un-managed" X-Reference-Id=0x151cf4402010
2026-06-04T19:25:19.1307195Z STEP 1/4: FROM quay.io/libpod/alpine:latest
2026-06-04T19:25:19.1307450Z STEP 2/4: LABEL RUN podman --version
2026-06-04T19:25:19.1307674Z STEP 3/4: RUN echo hello > /hello
2026-06-04T19:25:19.1307896Z STEP 4/4: RUN echo hello2 > /hello2
2026-06-04T19:25:19.1308121Z COMMIT alpine_notleaker:latest
2026-06-04T19:25:19.1308336Z Getting image source signatures
2026-06-04T19:25:19.1308657Z Copying blob sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0
2026-06-04T19:25:19.1309103Z Copying blob sha256:32e3065a56a2bbe5bff90b91a55d69a30f20579afd9c9ae769e9f287c7f26c67
2026-06-04T19:25:19.1309568Z Copying config sha256:8238a267e776a8213555d322af802f40555d1b0dce13cced2c481e0e8c385089
2026-06-04T19:25:19.1310293Z Writing manifest to image destination
2026-06-04T19:25:19.1310654Z --> 8238a267e776
2026-06-04T19:25:19.1311054Z Successfully tagged localhost/alpine_notleaker:latest
2026-06-04T19:25:19.1311629Z 8238a267e776a8213555d322af802f40555d1b0dce13cced2c481e0e8c385089
2026-06-04T19:25:19.1313018Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock create --name test quay.io/libpod/busybox:latest sleep 10000
2026-06-04T19:25:19.1313787Z 8497a7d99e3c4106f85b9f6f4669378823a3403d684cb458923574f2dab910de
2026-06-04T19:25:19.1314685Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock build --network=none -f /tmp/podman-e2e-3665299284/subtest-1508744269/p/ContainerFile-podman-leaker -t podmanleaker
2026-06-04T19:25:19.1315689Z STEP 1/3: FROM quay.io/libpod/alpine:latest
2026-06-04T19:25:19.1316088Z STEP 2/3: RUN echo "Hello, World!"
2026-06-04T19:25:19.1316403Z Hello, World!
2026-06-04T19:25:19.1316639Z --> 557f4e259540
2026-06-04T19:25:19.1317018Z STEP 3/3: RUN RUN echo "Please use signal 9 this will never ends" && sleep 10000s
2026-06-04T19:25:19.1318028Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock images -a
2026-06-04T19:25:19.1319050Z REPOSITORY TAG IMAGE ID CREATED SIZE R/O
2026-06-04T19:25:19.1319872Z localhost/alpine_notleaker latest 8238a267e776 Less than a second ago 5.85 MB false
2026-06-04T19:25:19.1320552Z <none> <none> 557f4e259540 Less than a second ago 5.85 MB false
2026-06-04T19:25:19.1321211Z quay.io/libpod/testimage 20241011 b82e560ed57b 20 months ago 12.2 MB true
2026-06-04T19:25:19.1321921Z quay.io/libpod/systemd-image 20240124 9479ce2eaa2d 2 years ago 149 MB true
2026-06-04T19:25:19.1322847Z quay.io/libpod/registry 2.8.2 0030ba3d620c 2 years ago 24.6 MB true
2026-06-04T19:25:19.1323530Z quay.io/libpod/alpine_nginx latest ecea49d99daa 4 years ago 23.1 MB true
2026-06-04T19:25:19.1324225Z quay.io/libpod/k8s-pause 3.5 ed210e3e4a5b 5 years ago 686 kB true
2026-06-04T19:25:19.1324857Z quay.io/libpod/redis alpine 8835e6aeca99 5 years ago 32.3 MB true
2026-06-04T19:25:19.1325592Z quay.io/libpod/busybox latest f0b02e9d092d 5 years ago 1.45 MB true
2026-06-04T19:25:19.1326252Z quay.io/libpod/alpine latest 961769676411 6 years ago 5.85 MB true
2026-06-04T19:25:19.1326954Z quay.io/libpod/alpine_healthcheck latest c1103abb47d6 7 years ago 10.4 MB true
2026-06-04T19:25:19.1328051Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock ps -aq --external
2026-06-04T19:25:19.1328951Z 8497a7d99e3c
2026-06-04T19:25:19.1329191Z 09e46962ed33
2026-06-04T19:25:19.1329441Z ebafee42df8d
2026-06-04T19:25:19.1330404Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock system prune --build -f
2026-06-04T19:25:19.1331369Z Failed to write to log, the channel is closed for Write
2026-06-04T19:25:19.1331630Z Deleted Containers
2026-06-04T19:25:19.1331853Z Error: identifier is not a container
2026-06-04T19:25:19.1332308Z 09e46962ed33e767fbe767aea493e7b86f06e2bd8f285620dd3a52d002e163da
2026-06-04T19:25:19.1332867Z ebafee42df8da2bbfdeb93096a349c5b6f6bc2c31b56b484074ebacacff24736
2026-06-04T19:25:19.1333406Z 8497a7d99e3c4106f85b9f6f4669378823a3403d684cb458923574f2dab910de
2026-06-04T19:25:19.1333952Z [FAILED] Command failed with exit status 125. See above for error message.
2026-06-04T19:25:19.1334534Z In [It] at: /var/tmp/podman/test/e2e/prune_test.go:655 @ 06/04/26 19:25:19.04
2026-06-04T19:25:19.1334874Z
2026-06-04T19:25:19.1334969Z Full Stack Trace
2026-06-04T19:25:19.1335564Z go.podman.io/podman/v6/test/e2e.init.func72.20()
2026-06-04T19:25:19.1335943Z /var/tmp/podman/test/e2e/prune_test.go:655 +0x943
2026-06-04T19:25:19.1336582Z < Exit [It] podman system prune --build clean up after terminated build - /var/tmp/podman/test/e2e/prune_test.go:609 @ 06/04/26 19:25:19.04 (2.529s)
2026-06-04T19:25:19.1337360Z > Enter [AfterEach] TOP-LEVEL - /var/tmp/podman/test/e2e/common_test.go:136 @ 06/04/26 19:25:19.04
2026-06-04T19:25:19.1338273Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock stop --all -t 0
2026-06-04T19:25:19.1339589Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock pod rm -fa -t 0
2026-06-04T19:25:19.1340643Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-fac397d69d05a4f139eca8b2a709520979f3234e407ccfb963c67c246c69af1a.sock rm -fa -t 0
2026-06-04T19:25:19.1341781Z < Exit [AfterEach] TOP-LEVEL - /var/tmp/podman/test/e2e/common_test.go:136 @ 06/04/26 19:25:19.124 (84ms)
2026-06-04T19:25:19.1342323Z << Timeline
This is not new, it has been flaking for a while but I do see quite often now in the new CI.
There was a "fix" in https://github.com/podman-container-tools/podman/pull/27269 but that only ever addressed the error reporting not the cause of the error.
A friendly reminder that this issue had no activity for 30 days.
I pulled every occurrence of this test from the last 1000 ci runs and they are not all the same failure because see table below
| n | what the log shows |
|---|---|
| 5 | never reaches prune, ps -aq --external returns 1 or 2 at prune_test.go |
| 3 | Error: container not known |
| 2 | Error: identifier is not a container |
| 2 | Error: replacing mount point .../merged: directory not empty |
The first group looks like a different bug to the one you filed. https://github.com/podman-container-tools/podman/actions/runs/28364178590/job/86101315616
2026-07-09T11:06:55.1154017Z STEP 3/3: RUN RUN echo "Please use signal 9 this will never ends" && sleep 10000s
2026-07-09T11:06:55.1154979Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-337b9611c09287712d8bcba601266f1be57413a7649437b91c9e078f3372c063.sock images -a
2026-07-09T11:06:55.1155928Z REPOSITORY TAG IMAGE ID CREATED SIZE R/O
2026-07-09T11:06:55.1156577Z localhost/alpine_notleaker latest c576d3c69504 Less than a second ago 5.85 MB false
2026-07-09T11:06:55.1157222Z <none> <none> c38b26ecd05f Less than a second ago 5.85 MB false
2026-07-09T11:06:55.1164733Z Running: /var/tmp/podman/bin/podman-remote --remote --url unix:///run/podman/podman-337b9611c09287712d8bcba601266f1be57413a7649437b91c9e078f3372c063.sock ps -aq --external
2026-07-09T11:06:55.1165586Z 0b27f5455187
2026-07-09T11:06:55.1165808Z 8a967ed872b0
2026-07-09T11:06:55.1166019Z [FAILED] Expected
2026-07-09T11:06:55.1166336Z <[]string | len:2, cap:2>: ["0b27f5455187", "8a967ed872b0"]
2026-07-09T11:06:55.1166706Z to have length 3
2026-07-09T11:06:55.1167039Z In [It] at: /var/tmp/podman/test/e2e/prune_test.go:651 @ 07/09/26 11:06:55.031
2026-07-09T11:06:55.1167474Z Full Stack Trace
2026-07-09T11:06:55.1167771Z go.podman.io/podman/v6/test/e2e.init.func72.20()
2026-07-09T11:06:55.1168330Z /var/tmp/podman/test/e2e/prune_test.go:651 +0x7ff
and the intermediate image is already there but only two containers are and the count is asserted with no wait and this also fits what you said on #29279 about the SIGKILL only reaching the client.
Did you check that all logged failures are with podman-remote only?
yeah I just checked all 12 are int remote root and no local job and no rootless one
88720453002 int remote root fedora-prior
88658986177 int remote root debian-sid
82990403588 int remote root fedora-prior
82364057112 int remote root debian-sid
79596519993 int remote root debian-sid
85845987196 int remote root debian-sid
84028800583 int remote root debian-sid
86101315616 int remote root debian-sid
82763395896 int remote root debian-sid
80299746607 int remote root debian-sid
84126634338 int remote root fedora-current
82054668620 int remote root fedora-rawhide
Hi everyone, so I went through this issue a bit. I also read through #29279 and buildah#7007. I was just wondering whether we can use Eventually block to wrap around the assertion. If an Eventually block sounds like a good defensive measure, I’d be happy to open a PR for it.
Hi @Luap99, I’d like to investigate this further. I went through the failure samples and the discussion around #29279. From the samples checked in this thread, all 12 failures were in the remote-root jobs, and there appear to be multiple failure modes rather than just the container-count assertion. I also saw the recent suggestion about wrapping that assertion in Eventually(). I’d like to focus on tracing the terminated remote-build cancellation and cleanup path first, including how it interacts with the existing work around #29279, to see whether there is any remaining race or cleanup issue that can be addressed without just masking the flake. I’ll share what I find before proposing a fix.