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
Random "image config verification failed for digest sha256:<sha256>" errors when pulling images #21290
We're running our own distribution registry, version 2.3 backed by a Swift storage backend and with a nginx reverse-proxy on two instances of the registry. (with redis cache)
Steps to reproduce the issue:
docker run
docker commit / docker tag
docker push image:tag
Note: The layers pushed are not very large, maximum 300-400MB
changed the title [-]Random "image config verification failed for digest sha256:<sha256>" errors[/-][+]Random "image config verification failed for digest sha256:<sha256>" errors when pulling images[/+]on Mar 17, 2016
@Soulou: Unfortunately I don't have an answer just yet. I believe this is the first time I've head of this problem.
Let me give you some background on what the error means. Starting in Docker 1.10, images are identified by a SHA256 hash of their configuration JSON. This JSON gets uploaded directly to the registry, and referenced in the manifest by its content hash.
The first step in pulling an image it to download this manifest. If it specifies an image configuration with the hash sha256:9315cd9d987b2ec50be5529c18efaa64ebae17f72ae4b292525ca7ee2ab98318, the engine next requests sha256:9315cd9d987b2ec50be5529c18efaa64ebae17f72ae4b292525ca7ee2ab98318 from the registry, and makes sure what it gets back matches that digest. This is the check that is failing for you.
I don't know offhand what could cause this blob not to match the digest it's stored under, since a fundamental property of Docker images in 1.10+ is that the digest used to reference an image must match the SHA256 hash of its configuration JSON. It is possible that this file is somehow getting corrupted on disk before the Docker engine pushes it. It's also possible that it gets pushed correctly, but somehow gets corrupted during the pull process.
It would be helpful to have a few more data points about this issue.
When you find an image with this problem, does the problem reliably reoccur when you try to pull the same image? Does it happen when you pull from different Engine hosts?
Can you retrieve the affected blob (for example, sha256:9315cd9d987b2ec50be5529c18efaa64ebae17f72ae4b292525ca7ee2ab98318 in the example above) from the Swift storage, and see if running sha256sum on the file matches the hex string it's stored under?
Does the problem persist after pushing an affected image under a different name? i.e.:
docker tag registry:443/myimage registry:443/myimage2
docker push registry:443/myimage2
docker pull registry:443/myimage2 from a different host
~# docker tag registry/image1:latest registry/image2:latest
~# docker push registry/image2:latest
The push refers to a repository [registry/image2:latest]
f4048bb598e2: Mounted from image1
b4ef0d91ce36: Mounted from ..
fecc9a55ecf1: Mounted from ..
9db88c18c8b3: Mounted from ..
4bc454d670e5: Mounted from ..
81af8e57df2a: Mounted from ..
5f70bf18a086: Mounted from ..
e8061ac24ae3: Mounted from ..
3c84ae1bbde2: Mounted from ..
b5f05191d11d: Mounted from ..
latest: digest: sha256:bfe7d2379965bb93f00d53027970ceff803bc6b28bf98864d1119123332e51da size: 2777
So nothing was actually pushed, but a manifest has been created.
Very interesting - thanks for looking into it. That does seem to suggest some kind of problem related to Swift or the Swift storage driver. I don't think it's expected behavior for the registry to have 0 byte blobs named anything other than e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (sha256sum of 0 bytes).
ping @lebauce - Do you have any ideas on how this could be happening?
On the screeshots I've shown you, the data file seems to be 0 byte. That's the same if I run swift list from the command line:
└> swift list <container> -p files/docker/registry/v2/blobs/sha256/fd/fde84f414d7f200c2e5f21474ed6fc07221934c302b44398064401294580bf3c/data -l
0 2016-02-24 20:59:13 application/octet-stream files/docker/registry/v2/blobs/sha256/fd/fde84f414d7f200c2e5f21474ed6fc07221934c302b44398064401294580bf3c/data
But if I download the file, the file is not 0 byte large:
└> ls -l files/docker/registry/v2/blobs/sha256/fd/fde84f414d7f200c2e5f21474ed6fc07221934c302b44398064401294580bf3c/data
-rw-r--r-- 1 leo leo 24412971 Mar 23 15:26 files/docker/registry/v2/blobs/sha256/fd/fde84f414d7f200c2e5f21474ed6fc07221934c302b44398064401294580bf3c/data
So the metadata attached to the object seems wrong, can it be the cause of that?
Can you download one of the affected blobs and see if its sha256 hash matches the blob name?
Earlier this looked like an engine issue to me, but based on the last few comments, this is very likely to be a registry issue or Swift storage issue. I'm going to close this issue and move the discussion back to distribution/distribution#1539.
We are seeing the same problem with a SWIFT backend in SoftLayer. Recently we have seen these sha256 problems coming up and I believe it is the same issue as discussed above -- a 0 length data file.
I have updated our registry to the latest version. We have seen this problem when pushing from both Windows and Linux Docker engines (we do builds on both).
Based on what has changed and what hasn't my suspicion is that there is some error being missed in the Swift driver still that causes this issue. Shall we open a new issue based on zoobab's and my report?
Activity
[-]Random "image config verification failed for digest sha256:<sha256>" errors[/-][+]Random "image config verification failed for digest sha256:<sha256>" errors when pulling images[/+]aaronlehmann commentedon Mar 17, 2016
@Soulou: Unfortunately I don't have an answer just yet. I believe this is the first time I've head of this problem.
Let me give you some background on what the error means. Starting in Docker 1.10, images are identified by a SHA256 hash of their configuration JSON. This JSON gets uploaded directly to the registry, and referenced in the manifest by its content hash.
The first step in pulling an image it to download this manifest. If it specifies an image configuration with the hash
sha256:9315cd9d987b2ec50be5529c18efaa64ebae17f72ae4b292525ca7ee2ab98318, the engine next requestssha256:9315cd9d987b2ec50be5529c18efaa64ebae17f72ae4b292525ca7ee2ab98318from the registry, and makes sure what it gets back matches that digest. This is the check that is failing for you.I don't know offhand what could cause this blob not to match the digest it's stored under, since a fundamental property of Docker images in 1.10+ is that the digest used to reference an image must match the SHA256 hash of its configuration JSON. It is possible that this file is somehow getting corrupted on disk before the Docker engine pushes it. It's also possible that it gets pushed correctly, but somehow gets corrupted during the pull process.
It would be helpful to have a few more data points about this issue.
When you find an image with this problem, does the problem reliably reoccur when you try to pull the same image? Does it happen when you pull from different Engine hosts?
Can you retrieve the affected blob (for example,
sha256:9315cd9d987b2ec50be5529c18efaa64ebae17f72ae4b292525ca7ee2ab98318in the example above) from the Swift storage, and see if runningsha256sumon the file matches the hex string it's stored under?Does the problem persist after pushing an affected image under a different name? i.e.:
Thanks in advance.
Soulou commentedon Mar 20, 2016
Thanks @aaronlehmann for your answer, I'll try to answer your three questions as soon as I can.
Soulou commentedon Mar 20, 2016
Soulou commentedon Mar 20, 2016
3:
So nothing was actually pushed, but a manifest has been created.
As a result, it still doesn't work:
BUT as a result, I went to she the blob with this sha:
Yes 0 byte, so the problem seems to come from the upload of the file.
Soulou commentedon Mar 20, 2016
I've been able to confirm this, there are other blobs with a 0 byte size:
Question is then: is it a problem from the driver, or of swift itself. (We are, in this case using OVH public storage) https://www.ovh.com/us/cloud/storage/object-storage.xml
How to track this?
aaronlehmann commentedon Mar 21, 2016
Very interesting - thanks for looking into it. That does seem to suggest some kind of problem related to Swift or the Swift storage driver. I don't think it's expected behavior for the registry to have 0 byte blobs named anything other than
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(sha256sum of 0 bytes).ping @lebauce - Do you have any ideas on how this could be happening?
Soulou commentedon Mar 23, 2016
I may have something new.
On the screeshots I've shown you, the data file seems to be 0 byte. That's the same if I run
swift listfrom the command line:But if I download the file, the file is not 0 byte large:
So the metadata attached to the object seems wrong, can it be the cause of that?
aaronlehmann commentedon Mar 23, 2016
Can you download one of the affected blobs and see if its sha256 hash matches the blob name?
Earlier this looked like an engine issue to me, but based on the last few comments, this is very likely to be a registry issue or Swift storage issue. I'm going to close this issue and move the discussion back to distribution/distribution#1539.
don't swallow errors in Swift driver's GetContent()
don't swallow errors in Swift driver's GetContent()
zoobab commentedon May 19, 2017
I have this issue with a 2.6 registry with a SWIFT backend at Rackspace, if I do 100 of those steps, I get 2 images pull failures:
Repeat that at least 100 times, if not more, till the error appears.
drnybble commentedon Aug 2, 2017
We are seeing the same problem with a SWIFT backend in SoftLayer. Recently we have seen these sha256 problems coming up and I believe it is the same issue as discussed above -- a 0 length data file.
I have updated our registry to the latest version. We have seen this problem when pushing from both Windows and Linux Docker engines (we do builds on both).
Based on what has changed and what hasn't my suspicion is that there is some error being missed in the Swift driver still that causes this issue. Shall we open a new issue based on zoobab's and my report?
thaJeztah commentedon Aug 2, 2017
Best open an issue in the https://github.com/docker/distribution issue tracker
don't swallow errors in Swift driver's GetContent()
don't swallow errors in Swift driver's GetContent()
don't swallow errors in Swift driver's GetContent()