Repository navigation
Description
Summary
Repeated health-check restart/recreate operations mutate an image's process arguments by appending the image entrypoint again on every cycle. When a later image update failed to start, rollback also failed and Contained deleted the original container, leaving only a missing inventory record and its persistent volumes.
This is a regression of the safety guarantee described in #45 and appears related to the inspect/recreate normalization problems from #74.
Environment
- Contained:
1.0.0-nightly.232+59a03dc(build 232) - macOS:
26.6.2(25G83), Apple silicon - Apple Container CLI:
1.3.0 - Container:
coast - Previous working image:
ghcr.io/tdeverx/coast:sha-4322f5c - Updated image:
ghcr.io/tdeverx/coast:preview(sha256:bf900193fcd3...)
What happened
Contained recorded many healthcheck Restarted container (attempt 1) events, followed by:
Pulled imageUpdated imageRecreating containerRecreate failed after 20.10s: ContainedCore.containerRecreateFailed (phase=restoreOriginal, primaryCode=nonZeroExit, recovery=restoreFailed, recoveryCode=nonZeroExit)- The runtime container no longer existed; the local record was marked
ZISMISSING=1.
The retained recovery document shows that the process command had grown to 17 repeated copies of the image entrypoint:
{
"executable": "/usr/bin/tini",
"arguments": [
"--", "/usr/local/bin/coast-entrypoint",
"--", "/usr/local/bin/coast-entrypoint",
"--", "/usr/local/bin/coast-entrypoint"
// ...repeated 17 times total
]
}The image's actual OCI configuration is only:
{
"Entrypoint": ["/usr/bin/tini", "--", "/usr/local/bin/coast-entrypoint"]
}This strongly indicates that inspect-derived entrypoint arguments are being interpreted as a user command and appended again during each recreation.
Triggering replacement failure
The newly pulled Coast image also added VOLUME ["/data"]. Apple Container 1.3.0 fails to bootstrap that image with:
Error: failed to bootstrap container
(cause: "internalError: ... unknown: internalError: mount")
The failure reproduces directly with the Apple CLI, even with no explicit data mount and /bin/true as the entrypoint:
container run --rm \
--name coast-image-volume-control \
--entrypoint /bin/true \
ghcr.io/tdeverx/coast:previewThe immediately previous image does not declare the OCI volume and starts successfully with the same bind mount and managed PostgreSQL volume. This direct runtime limitation is not itself caused by Contained, but it is a reliable replacement-startup failure that Contained must survive without losing the original container.
Recovery performed
The persistent bind data and managed volumes survived. A fresh container created from sha-4322f5c with no command override started successfully using the original mounts. Its inspected process is clean:
{
"executable": "/usr/bin/tini",
"arguments": ["--", "/usr/local/bin/coast-entrypoint"]
}The application health endpoint returned {"status":"healthy"}.
Expected behavior
- Inspect/recreate must distinguish the image's entrypoint and default command from explicit user overrides and must be idempotent across unlimited recreations.
- Health-check recovery must not grow or otherwise mutate process arguments.
- A failed replacement must leave the old container available, or reliably restore it from an exact, clean recovery recipe.
- If both replacement and rollback fail, Contained should expose an actionable recovery flow/button using the durable recovery document rather than leaving only a missing record.
- Preflight/startup failures should retain the original image reference/digest and surface the underlying runtime stderr.
Suggested regression coverage
- Recreate an entrypoint-only image repeatedly and assert identical executable/arguments after every cycle.
- Force replacement startup failure and assert that the original runtime container remains or is restored with byte-for-byte equivalent process configuration.
- Force both replacement and rollback failure and assert that a usable recovery action is available from the missing-container UI.
- Preserve and present the low-level Apple Container error that caused replacement and rollback failure.
Activity
tdeverx commentedon Oct 3, 2026
Correction to the startup-failure hypothesis in #83: the unchanged preview image is healthy. Its local Apple Container cached ext4 snapshot was corrupt; the primary superblock at offset 1024 was all zeroes and
fileidentified the snapshot as generic data. The working previous-build disk was correctly identified as ext4.Moved only the corrupt cache directory for ARM64 manifest
75baafd05a0be135f3ddcfe413347c8847e388dc5b6ab68e1c8a0a42096edd41aside (retained for diagnosis), then reran/bin/trueusing the exact original index digestbf900193fcd35c3325bc0b903d230707bd80c009af495f38296ddfcf69519412. Apple Container unpacked a new snapshot, and the control succeeded.Coast has now been recreated on its original
previewtag/digest with the same persistent mounts and port 7318. Its health endpoint returns healthy. No image code or metadata was changed. TheVOLUME /dataexplanation was incorrect; the observed cause of the bootstrap failure was the damaged local snapshot. What corrupted that snapshot remains unknown.The duplicated entrypoint arguments and failed rollback/missing-container behavior remain valid findings. Investigate cache validation/regeneration and preserve underlying failures when handling recreate recovery.
feat(storage): add cleanup review and resilient recreation recovery (#84