You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot commit and push container image from Kubernetes pods #827
I'm experiencing a strange behavior while committing a container (from Kubernetes pod) and pushing it to some container registry after. I always get the same error from the push command: content digest sha256:898c46f3b1a1f39827ed135f020c32e2038c87ae0690a8fe73d94e5df9e6a2d6: not found.
I'm filing this issue here but there's a chance the problem is on containerd side because I've already seen it working in an earlier version. I'm trying to find out which version it stopped to work.
I'm still investigating but no idea so far... suggestions are welcome.
Steps to reproduce:
Create an arbitrary Kubernetes pod (for simplicity w/ just one container).
$ kubectl run --image tsuru/go:latest my-app -- sleep Inf
Execute arbitrary commands to generate changes in the container image (to be committed):
$ kubectl exec my-app -- mkdir -p /tmp/foo/bar
Commit the container to a local image:
$ CONTAINER_ID=$(kubectl get pods my-app -o 'jsonpath={ .status.containerStatuses[0].containerID }'| sed -E 's|(.+)://||g')
$ nerdctl --namespace k8s.io commit ${CONTAINER_ID} registry.example.com/my-app:v1
Push to local registry (no credentials needed):
$ nerdctl --namespace k8s.io push registry.example.com/my-app:v1
FATA[0000] failed to create a tmp single-platform image "registry.example.com/my-app:v1-tmp-reduced-platform": content digest sha256:898c46f3b1a1f39827ed135f020c32e2038c87ae0690a8fe73d94e5df9e6a2d6: not found
Reacted by Arthur Coelho, Gustavo Argote, Nadeshiko Manju, 李永仙, HFfleming, Somefive, Kshitij Gupta, Aldira Putra Raharja, Ryan Hartje, iholo and 3 more
I am also getting the same error for large images (mine was 7GB, small images were easily pushed)
FATA[0000] failed to create a tmp single-platform image "registry.example.com/my-app:0086bf16-21cb-477b-952c-13780780f597-tmp-reduced-platform": content digest sha256:5bed26d33875e6da1d9ff9a1054c5fef3bbeb22ee979e14b72acf72528de007b: not found
I have the following config-
[ec2-user@ip]$ sudo /usr/local/bin/nerdctl version
WARN[0000] unable to determine buildctl version: exec: "buildctl": executable file not found in $PATH
Client:
Version: v1.4.0
OS/Arch: linux/amd64
Git commit: 7e8114a
buildctl:
Version:
could you please reopen the issue, @junnplus thanks.
I meet the same problem : I commit the image from a running container, then i need push the new image to my repo.
when i use nerdctl -n k8s.io push xxx ,an error occurs: FATA[0000] failed to create a tmp single-platform image "xxx.com/hjmtest/nginx:hjm-tmp-reduced-platform": content digest sha256:550fe1bea624a5c62551cf09f3aa10886eed133794844af1dfb775118309387e: not found
here is my env info: nerdctl -v nerdctl version 1.4.0 containerd -v containerd github.com/containerd/containerd v1.6.14-42-g21f32b2c3 21f32b2c394bc1ccfbf1744876a0fcdd4ef2390d
could you please open this issue, @junnplus thanks. I meet the same problem : I commit the image from a running container, then i need push the new image to my repo. when i use nerdctl -n k8s.io push xxx ,an error occurs: FATA[0000] failed to create a tmp single-platform image "xxx.com/hjmtest/nginx:hjm-tmp-reduced-platform": content digest sha256:550fe1bea624a5c62551cf09f3aa10886eed133794844af1dfb775118309387e: not found
here is my env info: nerdctl -v nerdctl version 1.4.0containerd -v containerd github.com/containerd/containerd v1.6.14-42-g21f32b2c3 21f32b2c394bc1ccfbf1744876a0fcdd4ef2390d
In addition:
if i pull images from others, not commit a new image, nerdctl push xxx can work.
I got the same issue but with finch.
Solved with --platform arg: finch push xxx.dkr.ecr.us-east-1.amazonaws.com/infra/calico/apiserver:v3.25.1 --platform linux/amd64
Recently, my GKE cluster's worker node upgraded to v1.27.3-gke.100 which also upgraded containerd from 1.6.18 to 1.7.0. After the upgrade, I encountered the exact same issue.
The commit command: nerdctl -n k8s.io commit bbe68406a258 some.registry.com/my-app:0.1
The push command like: nerdctl -n k8s.io push some.registry.com/my-app:0.1
Output: FATA[0000] failed to create a tmp single-platform image "some.registry.com/my-app:0.1-tmp-reduced-platform": content digest sha256:c95ff01263cbbb536e71f8ae823d3e63f15f7a0f1ba9ecb7b3126a63654d2b23: not found.
Work around
Add --all-platforms option.
If I run the push command like: nerdctl -n k8s.io push --all-platforms some.registry.com/my-app:0.1, the image can be pushed if the registry is valid (btw I pushed to JFrog).
The option is added to avoid converter.Convert. Related code:
log.G(ctx).Infof("pushing as a reduced-platform image (%s, %s)", platImg.Target.MediaType, platImg.Target.Digest)
}
Other info
The issue is not registry related. I tried different registries, the same error is thrown, even with random invalid registry.
The container I am committing from is built on an Ubuntu machine with docker build . command, without specifying the platform as linux/amd64.
When it used to work with containerd 1.6.18, I can see the log level=info msg="pushing as a reduced-platform image.... The convert should be good then.
I started a container using the nydus format and then packaged the container into an image. However, I encountered the same problem when I tried to push this image.
Steps to reproduce:
Create a container with nydus image
nerdctl --snapshotter nydus run --cap-add=CAP_SYS_ADMIN --net host -it registry-test.xx.info/library/nydus-image:old
nerdctl push registry-test.xx.info/library/nydus-image:new
FATA[0000] failed to create a tmp single-platform image " registry-test.xx.info/library/nydus-image:new-tmp-reduced-platform": content digest sha256:cfc7393224358fb100dabf40f7d59c2578c0a6a47781b1a6b56406922aeb6e95: not found
env info:
Kernel: 4.9.144
nerdctl version 1.6.2
containerd: v1.5.9
nydusd version: v2.2.3
containerd-nydus-grpc version: v0.13.3
Does the container launched by on-demand loading of images support commit and push operations?
Regarding the issue of saving snapshots into tar files, has it been resolved? Do I use the latest version 2.0.0-rc1, but it still prompts that some levels of sha256 cannot be found. Is it lost due to garbage collection?
Try to push the image using nerdctl, which of course fails
nerdctl push docker.io/lingdie/busybox:dev
FATA[0000] failed to create a tmp single-platform image "docker.io/lingdie/busybox:dev-tmp-reduced-platform": content digest sha256:75e8ca8f509fb8f7ee74430edbdc5b78fd863a4f08e06c53828e9a996a79f642: not found
Activity
junnplus commentedon Mar 20, 2022
I can't reproduce this problem on containerd with latest and 1.5.10 version.
In addition, I can't start the corresponding containerd version through minikube.
PS: containerd v1.4.x reached EOL.
junnplus commentedon Jun 29, 2022
I closed it because containerd v1.4.x reached EOL.
Feel free to open it up if you have any other questions.
Nirmit1995 commentedon May 31, 2023
I am also getting the same error for large images (mine was 7GB, small images were easily pushed)
FATA[0000] failed to create a tmp single-platform image "registry.example.com/my-app:0086bf16-21cb-477b-952c-13780780f597-tmp-reduced-platform": content digest sha256:5bed26d33875e6da1d9ff9a1054c5fef3bbeb22ee979e14b72acf72528de007b: not found
I have the following config-
[ec2-user@ip]$ sudo /usr/local/bin/nerdctl version
WARN[0000] unable to determine buildctl version: exec: "buildctl": executable file not found in $PATH
Client:
Version: v1.4.0
OS/Arch: linux/amd64
Git commit: 7e8114a
buildctl:
Version:
Server:
containerd:
Version: 1.6.19
GitCommit: 1e1ea6e986c6c86565bc33d52e34b81b3e2bc71f
runc:
Version: 1.1.4
GitCommit: 5fd4c4d144137e991c4acebb2146ab1483a97925
Please help in resolving this.
HFfleming commentedon Jun 25, 2023
could you please reopen the issue, @junnplus thanks.
I meet the same problem : I commit the image from a running container, then i need push the new image to my repo.
when i use
nerdctl -n k8s.io push xxx,an error occurs:FATA[0000] failed to create a tmp single-platform image "xxx.com/hjmtest/nginx:hjm-tmp-reduced-platform": content digest sha256:550fe1bea624a5c62551cf09f3aa10886eed133794844af1dfb775118309387e: not foundhere is my env info:
nerdctl -v nerdctl version 1.4.0containerd -v containerd github.com/containerd/containerd v1.6.14-42-g21f32b2c3 21f32b2c394bc1ccfbf1744876a0fcdd4ef2390dHFfleming commentedon Jun 25, 2023
In addition:
if i pull images from others, not commit a new image,
nerdctl push xxxcan work.ggerogery commentedon Jul 8, 2023
I got the same issue but with
finch.Solved with
--platformarg:finch push xxx.dkr.ecr.us-east-1.amazonaws.com/infra/calico/apiserver:v3.25.1 --platform linux/amd64baozaolaoba-top commentedon Sep 9, 2023
In addition:
nerdctl version 1.5.0
containerd -v
containerd github.com/containerd/containerd v1.7.1 1677a17964311325ed1c31e2c0a3589ce6d5c30d
harbor server with port: hub.local:
5443Zheaoli commentedon Sep 18, 2023
could not produce this bug. would you guys mind to give me reproduce step with more detail? like what's registry you use
JCereal commentedon Nov 8, 2023
Recently, my GKE cluster's worker node upgraded to
v1.27.3-gke.100which also upgraded containerd from1.6.18to1.7.0. After the upgrade, I encountered the exact same issue.Reproduce
The commit command:
nerdctl -n k8s.io commit bbe68406a258 some.registry.com/my-app:0.1The push command like:
nerdctl -n k8s.io push some.registry.com/my-app:0.1Output:
FATA[0000] failed to create a tmp single-platform image "some.registry.com/my-app:0.1-tmp-reduced-platform": content digest sha256:c95ff01263cbbb536e71f8ae823d3e63f15f7a0f1ba9ecb7b3126a63654d2b23: not found.Work around
Add
--all-platformsoption.If I run the push command like:
nerdctl -n k8s.io push --all-platforms some.registry.com/my-app:0.1, the image can be pushed if the registry is valid (btw I pushed to JFrog).The option is added to avoid
converter.Convert. Related code:nerdctl/pkg/cmd/image/push.go
Lines 98 to 111 in ce2f63d
Other info
The issue is not registry related. I tried different registries, the same error is thrown, even with random invalid registry.
The container I am committing from is built on an Ubuntu machine with
docker build .command, without specifying the platform aslinux/amd64.When it used to work with containerd 1.6.18, I can see the log
level=info msg="pushing as a reduced-platform image.... The convert should be good then.beyou923 commentedon Dec 7, 2023
I started a container using the nydus format and then packaged the container into an image. However, I encountered the same problem when I tried to push this image.
Steps to reproduce:
nerdctl commit ${CONTAINER_ID} registry-test.xx.info/library/nydus-image:newnerdctl push registry-test.xx.info/library/nydus-image:new FATA[0000] failed to create a tmp single-platform image " registry-test.xx.info/library/nydus-image:new-tmp-reduced-platform": content digest sha256:cfc7393224358fb100dabf40f7d59c2578c0a6a47781b1a6b56406922aeb6e95: not foundenv info:
Does the container launched by on-demand loading of images support commit and push operations?
iholo commentedon Feb 6, 2024
I have the same problem on Azure


env info:
kubernetes: v1.27.7
Kernel: 5.15.0-1053-azure
nerdctl version 1.7.3
containerd: 1.7.1+azure-1
6 remaining items
apostasie commentedon Aug 12, 2024
@lingdie testing on main from today, the issue is still there (as described by OP).
Wondering what we are missing here...
lingdie commentedon Aug 13, 2024
Here is my testing process. Could you please provide your testing?
apostasie commentedon Aug 13, 2024
@lingdie
kind version 0.23.0nerdctl latest mainubuntu 24.04(in lima on a mac M1 with Sonoma 14.5)kind.yaml:
Create the cluster:
Inside the control plane from above:
More info:
@lingdie let me know if I am missing something here, or if you need anything else.
Also, when we get #3296 in we will be able to test for Kube on the CI (in the same conditions, using Kind).
lingdie commentedon Aug 14, 2024
apostasie commentedon Aug 14, 2024
@lingdie there is clearly something wrong going on with this.
This issue keeps cropping up on a variety of operations -
save,commit, with or without kube - #3179I believe these have all the same root issue, but I cannot pinpoint it...
an1day commentedon Aug 20, 2024
Regarding the issue of saving snapshots into tar files, has it been resolved? Do I use the latest version 2.0.0-rc1, but it still prompts that some levels of sha256 cannot be found. Is it lost due to garbage collection?
apostasie commentedon Aug 21, 2024
@ouyangningdong if your issue is the same that is being discussed here, it is not resolved - and the ticket is still open.
If your issue is different, I suggest you open a new ticket.
Also, it does not seem like a garbage collection problem.
apostasie commentedon Aug 21, 2024
@lingdie I did add the scenario as a test (https://github.com/containerd/nerdctl/blob/main/cmd/nerdctl/container_commit_linux_test.go#L28) - right now, the test expectation is to fail (until we fix the problem).
Interestingly, the test failed once on an unrelated PR:
https://github.com/containerd/nerdctl/actions/runs/10497512059/job/29080522608
... meaning the problem might be racy?
lingdie commentedon Aug 23, 2024
The only thing I can think of is that containerd might have garbage collected some essential layers...
Disable flaky containerd#827 test
Disable flaky containerd#827 test
Merge pull request #3374 from apostasie/chore-kube-grrrr
lingdie commentedon Sep 9, 2024
I believe I have found the source of the problem. Below is my reproduction process:
nerdctl push docker.io/lingdie/busybox:dev FATA[0000] failed to create a tmp single-platform image "docker.io/lingdie/busybox:dev-tmp-reduced-platform": content digest sha256:75e8ca8f509fb8f7ee74430edbdc5b78fd863a4f08e06c53828e9a996a79f642: not foundlingdie commentedon Sep 9, 2024
see: containerd/containerd#8973