Skip to content

fix:save image err because content digest not found - #11996

Closed
ningmingxiao wants to merge 1 commit into
containerd:mainfrom
ningmingxiao:fix_nerdctl_save
Closed

ningmingxiao wants to merge 1 commit into
containerd:mainfrom
ningmingxiao:fix_nerdctl_save

Conversation

@ningmingxiao

@ningmingxiao ningmingxiao commented Jun 18, 2025 •

Copy link
Copy Markdown
Contributor

image 1

"Manifest": {
            "schemaVersion": 2,
            "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
            "config": {
                "mediaType": "application/vnd.docker.container.image.v1+json",
                "digest": "sha256:141ba1659ac87bc83c33fb756ec91e105f5d196672a8f56c99eda2aa50c7f128",
                "size": 5668
            },
            "layers": [
                {
                    "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                    "digest": "sha256:3d0bcbd3ba78828654b1de97afb12337e1f2f01b8fd4e18bb4e0befc0cab35e2",
                    "size": 3756561
                },
                {
                    "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                    "digest": "sha256:5241a4e84f4eb9a11685a4b5e4a1d451512e92d70277ad077224eebb57bf1499",
                    "size": 4743936
                },

            "diff_ids": [
                    "sha256:7c76c8b384d5823f659d49db27f4e880ed1102c76e717160b9085855233135c8",
                    "sha256:bc20b96670742fb3960fa29572bd477bf72892d4ba702fa7943f5c9d74032327",
                ]

image 2

"Manifest": {
            "schemaVersion": 2,
            "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
            "config": {
                "mediaType": "application/vnd.docker.container.image.v1+json",
                "digest": "sha256:9f8f2ee9ddac537d25f24b49936115bf9a4f93ee3d004e7256daae9ace83567e",
                "size": 4124
            },

            "layers": [
                {
                    "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                    "digest": "sha256:f904ad7dc96d0e260d9b0b77f50ae0ba638cbd327d24ead122353d4fe9b0d0a2",
                    "size": 3629086

                },
                {
                    "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
                    "digest": "sha256:2a5f6f535b245c6a1b6046cc44b43b2389fcdb5b35332be58f3f113ecc8e0b4d",
                    "size": 80143

                },
                "diff_ids": [
                    "sha256:7c76c8b384d5823f659d49db27f4e880ed1102c76e717160b9085855233135c8",
                    "sha256:91a32fe855d4fba03c5c811a4758219067ab85b0a27a41e7d37b345adf028cd0",
                ]

image1 blob sha256:3d0bcbd3ba78828654b1de97afb12337e1f2f01b8fd4e18bb4e0befc0cab35e2
and image 2 blob: sha256:f904ad7dc96d0e260d9b0b77f50ae0ba638cbd327d24ead122353d4fe9b0d0a2
have same chainid/diffid 7c76c8b384d5823f659d49db27f4e880ed1102c76e717160b9085855233135c8

if down load image 1 and then down load image 2 blob
sha256:9f8f2ee9ddac537d25f24b49936115bf9a4f93ee3d004e7256daae9ace83567e will skip to be download. we can create container successfully, but save image 2 will show blob is lost.

nerdctl 1.7

./nerdctl  -n k8s.io save  test:v1 -o 123.tar 
FATA[0001] failed to get reader: content digest sha256:f904ad7dc96d0e260d9b0b77f50ae0ba638cbd327d24ead122353d4fe9b0d0a2: not found 

@AkihiroSuda @apostasie

@k8s-ci-robot

Copy link
Copy Markdown

Hi @ningmingxiao. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@dosubot dosubot Bot added the kind/bug label Jun 18, 2025
@ningmingxiao
ningmingxiao force-pushed the fix_nerdctl_save branch 2 times, most recently from 0c90e2b to 89c3985 Compare June 18, 2025 12:41
@ningmingxiao ningmingxiao changed the title fix:save image err content digest not found fix:save image err because content digest not found Jun 18, 2025
@ningmingxiao

Copy link
Copy Markdown
Contributor Author

@dmcgowan @mxpv @mikebrow would you mind taking a look at this PR?

@ChengyuZhu6

Copy link
Copy Markdown
Member

It seems to have the similar logic as shown in the PR #8877

@ningmingxiao

Copy link
Copy Markdown
Contributor Author

Yes! I'm not sure whether it is a bug, at least we should add some log. I create a new pr #12140.
use nerdctl new version commit will auto download it.

@reckless-huang

Copy link
Copy Markdown

Hi everyone, I think this is a very impactful issue on usage. Can we fix it?

@ningmingxiao

ningmingxiao commented Sep 16, 2025 •

Copy link
Copy Markdown
Contributor Author

you can use nerdctl new version to save image @reckless-huang

@reckless-huang

Copy link
Copy Markdown

You can use the new version of nerdctl to save image @reckless-huang

The new version still has the same issue. Most of the time I save an image because it no longer exists in the repository, so I need to export or retag it. But now, whether I do either, it will re-fetch the metadata and then fail

@reckless-huang

Copy link
Copy Markdown

It's strange that Docker does not re-fetch manifest and other information during retag and save operations

@ningmingxiao

Copy link
Copy Markdown
Contributor Author

docker will save all blob info @reckless-huang

@reckless-huang

Copy link
Copy Markdown

Docker will save all blob info @reckless-huang

These strange operations of containerd are actually not that convenient

@reckless-huang

Copy link
Copy Markdown

Additionally, containerd should have pulled all the blobs. The issue is that even though I have all the blobs locally, it still tries to fetch metadata. Can we provide an option to allow retagging and saving when metadata cannot be obtained?

@reckless-huang

Copy link
Copy Markdown

Sorry, we're here in containerd, I should submit an issue in nerdctl

@k8s-ci-robot

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 90 days with no activity. This PR will be closed in 7 days unless new comments are made or the stale label is removed.

@github-actions github-actions Bot added the Stale label Jan 24, 2026
@github-actions

Copy link
Copy Markdown

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this Jan 31, 2026
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Pull Request Review Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants