Uh oh!
There was an error while loading. Please reload this page.
Skip unreadable entries in image list - #2157
Conversation
3edfdd2 to
fbea4e9CompareHi @katiewasnothere, this PR is ready for review.
Could you please approve the pending workflow and review this PR when you have a chance? Thank you! |
481bf16 to
bb235f9CompareHokila
commented
Aug 27, 2026
@egernst |
bb235f9 to
b7be756Compare@Hokila Can you add a reproduction procedure to your description to show how you're triggering the error? That will help us determine whether the changes we merged in apple/containerization#898 resolve this issue for the 1.3.1 release. Once we know how things behave with those changes, let's look at this PR and see what would be the best UX for handling broken resources (images in this case). |
Hokila
commented
Aug 30, 2026
Thanks @jglogan. I’ll update the PR description with the exact reproduction procedure and retest it against a build that includes apple/containerization#898. The current regression test covers per-image error isolation in the CLI, but it does not establish whether #898 already prevents or tolerates the underlying broken image-store state. I’ll document the before/after behavior once I’ve verified it with those changes. After that, I’m happy to revisit whether the CLI-side skip-and-warn behavior is still needed and what the best UX should be for broken image resources. |
Hokila
commented
Aug 30, 2026
Thanks @jglogan. I reproduced the issue using the same image-store fixture across all three versions. Reproduction setupEnvironment:
I used an isolated application root: $ export APP_ROOT=/tmp/container-image-list-repro
$ container system start \ --app-root "$APP_ROOT" \ --disable-kernel-install
$ container image pull docker.io/library/alpine:latest
$ container system stopI then added the following record to {
"example.invalid/broken:latest": {
"digest": "sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"size": 1,
"mediaType": "application/vnd.oci.image.index.v1+json"
}
}The file below was intentionally absent: container 1.3.0, before containerization#898Version: $ container --versioncontainer CLI version 1.3.0 (build: debug, commit: d96dfa3)The default listing fails without rendering the healthy image: $ container image listError: content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
$ echo$?1JSON, YAML, and verbose output fail in the same way: $ container image list --format jsonError: content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
$ echo$?1$ container image list --format yamlError: content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
$ echo$?1$ container image list --verboseError: content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
$ echo$?1Quiet mode succeeds because it does not resolve the image content: $ container image list -qalpine:latestexample.invalid/broken:latest
$ echo$?0container 1.3.1, with containerization#898Version: $ container --versioncontainer CLI version 1.3.1 (build: debug, commit: a9a62e2)The same fixture still causes the complete listing to fail: $ container image listError: content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
$ echo$?1The other detailed formats also fail: $ container image list --format jsonError: content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
$ echo$?1$ container image list --format yamlError: content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
$ echo$?1$ container image list --verboseError: content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
$ echo$?1Quiet mode remains unaffected: $ container image list -qalpine:latestexample.invalid/broken:latest
$ echo$?0This indicates that apple/containerization#898 does not cover this particular case. The state record itself is readable and its descriptor digest is valid; the failure occurs later when the referenced root content blob cannot be found. With this PRVersion: $ container --versioncontainer CLI version 1.3.0-3-gb7be756 (build: debug, commit: b7be756)The broken image is reported, while the healthy image is still rendered: $ container image listskipping unreadable image: ["error": notFound: "content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "image": example.invalid/broken:latest]NAME TAG DIGESTalpine latest 28bd5fe8b56d
$ echo$?0Verbose output also succeeds: $ container image list --verboseskipping unreadable image: ["error": notFound: "content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "image": example.invalid/broken:latest]NAME TAG INDEX DIGEST OS ARCH VARIANT FULL SIZE CREATED MANIFEST DIGESTalpine latest 28bd5fe8b56d linux amd64 3.8 MB 2026-06-16T00:01:29.967161902Z 79ff19e9084aalpine latest 28bd5fe8b56d linux arm v6 3.6 MB 2026-06-16T00:00:25.329026823Z bc301c70d7e7alpine latest 28bd5fe8b56d linux arm v7 3.3 MB 2026-06-16T00:00:26.526765088Z 48bf253520b1alpine latest 28bd5fe8b56d linux arm64 v8 4.2 MB 2026-06-16T00:01:20.474100947Z e7a1a92a5bfealpine latest 28bd5fe8b56d linux 386 3.7 MB 2026-06-16T00:01:19.360099979Z 6f5908cdf811alpine latest 28bd5fe8b56d linux ppc64le 3.8 MB 2026-06-16T00:00:15.017984356Z a30366c2d264alpine latest 28bd5fe8b56d linux riscv64 3.6 MB 2026-06-16T05:59:15.56408535Z 20a26477b54falpine latest 28bd5fe8b56d linux s390x 3.7 MB 2026-06-16T00:00:21.879382071Z 4eea4e45f63f
$ echo$?0I also captured JSON stdout and stderr separately: $ container image list --format json > images.json 2> warning.log
$ echo$?0
$ cat warning.logskipping unreadable image: ["image": example.invalid/broken:latest, "error": notFound: "content with digest sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"]
$ jq length images.json1
$ jq -r '.[0].configuration.name' images.jsondocker.io/library/alpine:latestThis confirms that:
The PR therefore fixes the listing behavior for this failure mode, although it does not repair or remove the underlying broken image resource. |
Type of Change
Motivation and Context
When one image entry has unreadable content, image list currently stops before rendering any entries. Resolve each image independently so readable images are still rendered, and log the skipped image reference and error to stderr so structured stdout remains valid.
Fixes#2149.
Testing
Tested locally
Added/updated tests
Added/updated docs
make test: 760 tests in 83 suites passed
make check: formatting and license checks passed