Skip to content

Random "image config verification failed for digest sha256:<sha256>" errors when pulling images #21290

Closed

Description

@Soulou

Output of docker version:

Client:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 15:54:52 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 15:54:52 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 165
 Running: 147
 Paused: 0
 Stopped: 18
Images: 293
Server Version: 1.10.3
Storage Driver: btrfs
Execution Driver: native-0.2
Logging Driver: json-file
Plugins: 
 Volume: local
 Network: null host bridge
Kernel Version: 4.2.0-34-generic
Operating System: Ubuntu 14.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 6
Total Memory: 31.42 GiB
Name: <edited>
ID: AZNH:RYE6:EPU2:OM3H:RQGL:E6GL:3PCA:BJJP:JVQO:ILYS:G7B4:TWOZ
Username: <edited>
Registry: https://index.docker.io/v1/

Additional environment details (AWS, VirtualBox, physical, etc.):

VPS

** Registry setup **

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:

  1. docker run
  2. docker commit / docker tag
  3. docker push image:tag

Note: The layers pushed are not very large, maximum 300-400MB

On another host

  1. docker pull image:tag

Describe the results you received:

└> sudo docker pull repo:e88527622a7d52a
[sudo] password for leo: 
 e88527622a7d52a: Pulling from repo

a3ed95caeb02: Already exists 
4546a4a8a29d: Already exists 
a898f8c7f6ba: Already exists 
706514fbad74: Already exists 
979168d7ceb7: Already exists 
6a953df111c8: Already exists 
39cb19057166: Already exists 
0d268101d605: Already exists 
517ff1a63fec: Already exists 
cc017fff06a9: Pulling fs layer 
image config verification failed for digest sha256:9315cd9d987b2ec50be5529c18efaa64ebae17f72ae4b292525ca7ee2ab98318

Describe the results you expected:

No error

** Notes **

It happens one image among hundreds, more or less, it happens almost everyday in our production infrastructure but I can't reproduce it willingly.

What can be the cause of that ?

Activity

  1. 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
  2. aaronlehmann commented on Mar 17, 2016

    @aaronlehmann

    @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.

    1. 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?

    2. 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?

    3. 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
      

    Thanks in advance.

  3. Soulou commented on Mar 20, 2016

    @Soulou
    ContributorAuthor

    Thanks @aaronlehmann for your answer, I'll try to answer your three questions as soon as I can.

  4. Soulou commented on Mar 20, 2016

    @Soulou
    ContributorAuthor
    1. Yes definitely, no Docker Engine succeeded to pull the image, it fails all the time with this error, whatever is the host.
  5. Soulou commented on Mar 20, 2016

    @Soulou
    ContributorAuthor

    3:

    ~# 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.

    As a result, it still doesn't work:

    ~# docker pull registry/image2:latest
    latest: Pulling from image2:latest
    
    a3ed95caeb02: Already exists 
    4546a4a8a29d: Already exists 
    a898f8c7f6ba: Already exists 
    706514fbad74: Already exists 
    979168d7ceb7: Already exists 
    6a953df111c8: Already exists 
    39cb19057166: Already exists 
    0d268101d605: Already exists 
    517ff1a63fec: Already exists 
    566bbc062867: Verifying Checksum 
    filesystem layer verification failed for digest sha256:566bbc06286711798f8c2fbbb6488ddc7890c1e1de314fa0b0c227b110623c79
    

    BUT as a result, I went to she the blob with this sha:

    screenshot from 2016-03-21 00-23-21

    Yes 0 byte, so the problem seems to come from the upload of the file.

  6. Soulou commented on Mar 20, 2016

    @Soulou
    ContributorAuthor

    I've been able to confirm this, there are other blobs with a 0 byte size:

    screenshot from 2016-03-21 00-25-36

    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?

  7. aaronlehmann commented on Mar 21, 2016

    @aaronlehmann

    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?

  8. Soulou commented on Mar 23, 2016

    @Soulou
    ContributorAuthor

    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 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?

  9. aaronlehmann commented on Mar 23, 2016

    @aaronlehmann

    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.

  10. zoobab commented on May 19, 2017

    @zoobab

    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:

    1. create a random docker image with this Dockerfile https://github.com/zoobab/docker-alpine-356m/blob/master/Dockerfile
    2. tag it with a random tag
    3. push it
    4. rmi it
    5. pull it

    Repeat that at least 100 times, if not more, till the error appears.

  11. drnybble commented on Aug 2, 2017

    @drnybble

    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?

  12. thaJeztah commented on Aug 2, 2017

    @thaJeztah
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/distribution

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions