containers / storage

Container Storage Library
Apache License 2.0
564 stars 244 forks source link

Manifest does not match provided manifest digest SHA #145

Closed mrunalp closed 5 years ago

mrunalp commented 6 years ago

I saw this while testing with busybox:1.24 image in crio:

  Normal   Scheduled              44s               default-scheduler   Successfully assigned myshell-85579c8fc4-fc7n9 to 127.0.0.1                                                                                                                           
  Normal   SuccessfulMountVolume  44s               kubelet, 127.0.0.1  MountVolume.SetUp succeeded for volume "default-token-b9gp9"                                                                                                                          
  Normal   Pulled                 7s (x6 over 43s)  kubelet, 127.0.0.1  Container image "busybox:1.24" already present on machine                                                                                                                             
  Warning  Failed                 7s (x6 over 43s)  kubelet, 127.0.0.1  Error: Manifest does not match provided manifest digest sha256:3181b2fff8cbdefa2302a04b1eb2273251749e9320d0083b807d32e9f0e18961   

cc: @runcom @rhatdan

mrunalp commented 6 years ago

kubectl.sh run myshell -it --rm --image=busybox:1.24 -- sh

nalind commented 6 years ago

Which version of cri-o is it? Which image with digest sha256:3181b2fff8cbdefa2302a04b1eb2273251749e9320d0083b807d32e9f0e18961 is it trying to use?

mrunalp commented 6 years ago

crio is from couple of days ago (close to master). Trying to use busybox:1.24 from docker.io.

nalind commented 6 years ago

That tag corresponds to digest sha256:8ea3273d79b47a8b6d018be398c17590a4b5ec604515f416c5b797db9dde3ad8, so it must be one of the other ones on the system.

nalind commented 6 years ago

If your local copy of the image predates some of the changes we merged in https://github.com/kubernetes-incubator/cri-o/pull/1116, then you may need to delete it and pull it again.

The digest of its v2s1 manifest is not simply the digest of a file that contains it, and when building an ImageRef, we use the value for the manifest's digest that's provided by the storage library. The storage library provides a value that it was given when the image was created, and falls back to digesting the file if it wasn't given a value when the image was initially stored. Before that change to cri-o the storage library wouldn't have even known to record such a value, and the fallback behavior would explain the error message you're getting.

mrunalp commented 6 years ago

okay, I'll try that out. Thanks!

rhatdan commented 5 years ago

@mrunalp Is this still an issue or can we close this?

rhatdan commented 5 years ago

Since no response I will take that as a yes I can close it. @mrunalp Reopen if I was mistaken.