forge: re-load the Forgejo agent image after every podman prune #247

Merged
founder merged 1 commit from fix/agent-image-after-prune into main 2026-09-08 05:23:12 +00:00
Owner

Incident 2026-09-08: publish-store-uploads run 19914 (TestFlight 179) failed at Gate (Release Uploads) with docker pull key-store-agent:latest … denied — the weekly key-store-podman-image-prune (podman image prune --all --force, PR #176) removes the runner's job image whenever no container references it (between jobs, always), and key-store-agent-container-image.service (RemainAfterExit) only loads it at activation. Manual remediation that worked: systemctl restart key-store-agent-container-image.service.

Fix: both prune units (key-store-podman-image-prune and nixpkgs' daily podman-prune) get After= the loader and ExecStartPost=systemctl restart key-store-agent-container-image.service (blocking, so a failed reload fails the prune and its existing failure notice fires); the loader gains OnFailure=key-store-failure-notice@%n. Exclusion via label filter was rejected because it would also retain every superseded key-store-agent:<sha> image (the disk growth the prune exists to stop). Ordering/deadlock reasoning verified against systemd 260 job.c; loader script audited idempotent. nix-instantiate --parse ok; module-level eval renders the intended unit files (full flake eval skipped: the Mac's root disk is nearly full).

🤖 Generated with Claude Code

Incident 2026-09-08: publish-store-uploads run 19914 (TestFlight 179) failed at `Gate (Release Uploads)` with `docker pull key-store-agent:latest … denied` — the weekly `key-store-podman-image-prune` (`podman image prune --all --force`, PR #176) removes the runner's job image whenever no container references it (between jobs, always), and `key-store-agent-container-image.service` (RemainAfterExit) only loads it at activation. Manual remediation that worked: `systemctl restart key-store-agent-container-image.service`. Fix: both prune units (`key-store-podman-image-prune` and nixpkgs' daily `podman-prune`) get `After=` the loader and `ExecStartPost=systemctl restart key-store-agent-container-image.service` (blocking, so a failed reload fails the prune and its existing failure notice fires); the loader gains `OnFailure=key-store-failure-notice@%n`. Exclusion via label filter was rejected because it would also retain every superseded `key-store-agent:<sha>` image (the disk growth the prune exists to stop). Ordering/deadlock reasoning verified against systemd 260 `job.c`; loader script audited idempotent. `nix-instantiate --parse` ok; module-level eval renders the intended unit files (full flake eval skipped: the Mac's root disk is nearly full). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
forge: re-load the Forgejo agent image after every podman prune
Some checks failed
Build: Apple / Check (SwiftLint) (pull_request) Failing after 19s
Build: Apple / Build (macOS) (pull_request) Has been skipped
Build: Apple / Build (iOS) (pull_request) Has been skipped
Build: Apple / Build (visionOS) (pull_request) Has been skipped
50a4ba619f
The job image key-store-agent:latest (with :amd64, :<sha> and the darling
sibling) is loaded into podman once, at activation, by the RemainAfterExit
oneshot key-store-agent-container-image.service, and nothing references it
between jobs. The weekly `podman image prune --all`
(key-store-podman-image-prune) therefore removed it, and every job on
`container: key-store-agent:latest` failed at start with "denied: requested
access to the resource is denied" until the loader was restarted by hand
(publish-store-uploads run 19914, Gate (Release Uploads), 2026-09-08).

Order both prune services (the weekly image prune and nixpkgs' daily
podman-prune) After= the loader and `systemctl restart` it from
ExecStartPost, so a prune can neither race a load in flight nor leave the
image absent. The loader script is idempotent (`podman load` of a present
archive is a no-op, `podman tag` keeps or re-points names), so restarting
converges on the expected tags; it now carries OnFailure so a failed
(re)load pages. A `--filter label!=` exclusion was rejected: it would keep
every superseded key-store-agent:<sha> image forever, which is the disk
growth the weekly prune exists to stop.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
founder force-pushed fix/agent-image-after-prune from 50a4ba619f
Some checks failed
Build: Apple / Check (SwiftLint) (pull_request) Failing after 19s
Build: Apple / Build (macOS) (pull_request) Has been skipped
Build: Apple / Build (iOS) (pull_request) Has been skipped
Build: Apple / Build (visionOS) (pull_request) Has been skipped
to 83edacce08
Some checks failed
Deploy: API / Deploy (API) (push) Failing after 3s
Namespace: Build Images / Refresh macOS runner lane (push) Successful in 4s
Namespace: Build Images / Refresh macOS Nix snapshot application (push) Successful in 35s
Namespace: Build Images / Refresh Linux runner image (push) Successful in 41s
Deploy: Web / Deploy (Web) (push) Failing after 50s
Release: If Needed / Check (Release Needed) (push) Successful in 6m9s
2026-09-08 05:23:00 +00:00
Compare
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
key-store/key.store!247
No description provided.