Skip to content

[bug] Error: failed to solve: rpc error: code = Unknown desc = content digest sha256:...: not found #101

Closed
moby/buildkit
#1077

Description

@shykes

Summary

This error occurs randomly, and causes a build to fail when otherwise it would have succeeded. On re-running the exact same build, the error goes away.

Environment

docker-buildx version: standalone binary downloaded from https://github.com/docker/buildx/releases/download/v0.2.2/buildx-v0.2.2.linux-amd64 (sha256 5c31e171440213bb7fffd023611b1aaa7e0498162c54cb708c2a8abe3679717e)

Docker engine version:

Server: Docker Engine - Community
 Engine:
  Version:          18.09.6
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       481bc77
  Built:            Sat May  4 01:59:36 2019
  OS/Arch:          linux/amd64
  Experimental:     false

How to reproduce

Unfortunately, I have not found a way to reproduce it reliably. However it does not seem to be related to the contents of the Dockerfile, since I have reproduced it (accidentally) with two completely unrelated Dockerfiles.

Based on my understanding of the error message, it appears that --load is required to reproduce.

Here is the output of the most recent occurrence:

+ /home/sh/bin/docker-buildx build --load --build-arg user=sh --build-arg uid=1002 --build-arg docker_guid=999 -t dev -
[+] Building 11.1s (54/54) FINISHED
 => [internal] load .dockerignore                                                               0.0s
 => => transferring context: 2B                                                                 0.0s
 => [internal] load build definition from Dockerfile                                            0.1s
 => => transferring dockerfile: 2.30kB                                                          0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                0.4s
 => [1/49] FROM docker.io/library/alpine@sha256:ca1c944a4f8486a153024d9965aafbe24f5723c1d5c02f  0.0s
 => => resolve docker.io/library/alpine@sha256:ca1c944a4f8486a153024d9965aafbe24f5723c1d5c02f4  0.0s
 => CACHED [2/49] RUN apk update                                                                0.0s
 => CACHED [3/49] RUN apk add openssh                                                           0.0s
 => CACHED [4/49] RUN apk add bash                                                              0.0s
 => CACHED [5/49] RUN apk add bind-tools                                                        0.0s
 => CACHED [6/49] RUN apk add curl                                                              0.0s
 => CACHED [7/49] RUN apk add docker                                                            0.0s
 => CACHED [8/49] RUN apk add g++                                                               0.0s
 => CACHED [9/49] RUN apk add gcc                                                               0.0s
 => CACHED [10/49] RUN apk add git                                                              0.0s
 => CACHED [11/49] RUN apk add git-perl                                                         0.0s
 => CACHED [12/49] RUN apk add make                                                             0.0s
 => CACHED [13/49] RUN apk add python                                                           0.0s
 => CACHED [14/49] RUN apk add openssl-dev                                                      0.0s
 => CACHED [15/49] RUN apk add vim                                                              0.0s
 => CACHED [16/49] RUN apk add py-pip                                                           0.0s
 => CACHED [17/49] RUN apk add file                                                             0.0s
 => CACHED [18/49] RUN apk add groff                                                            0.0s
 => CACHED [19/49] RUN apk add jq                                                               0.0s
 => CACHED [20/49] RUN apk add man                                                              0.0s
 => CACHED [21/49] RUN cd /tmp && git clone https://github.com/AGWA/git-crypt && cd git-crypt   0.0s
 => CACHED [22/49] RUN apk add go                                                               0.0s
 => CACHED [23/49] RUN apk add coreutils                                                        0.0s
 => CACHED [24/49] RUN apk add python2-dev                                                      0.0s
 => CACHED [25/49] RUN apk add python3-dev                                                      0.0s
 => CACHED [26/49] RUN apk add tar                                                              0.0s
 => CACHED [27/49] RUN apk add vim                                                              0.0s
 => CACHED [28/49] RUN apk add rsync                                                            0.0s
 => CACHED [29/49] RUN apk add less                                                             0.0s
 => CACHED [30/49] RUN pip install awscli                                                       0.0s
 => CACHED [31/49] RUN curl --silent --location "https://github.com/weaveworks/eksctl/releases  0.0s
 => CACHED [32/49] RUN curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-  0.0s
 => CACHED [33/49] RUN curl -L -o /usr/local/bin/kubectl https://storage.googleapis.com/kubern  0.0s
 => CACHED [34/49] RUN curl -L -o /usr/local/bin/kustomize  https://github.com/kubernetes-sigs  0.0s
 => CACHED [35/49] RUN apk add ruby                                                             0.0s
 => CACHED [36/49] RUN apk add ruby-dev                                                         0.0s
 => CACHED [37/49] RUN gem install bigdecimal --no-ri --no-rdoc                                 0.0s
 => CACHED [38/49] RUN gem install kubernetes-deploy --no-ri --no-rdoc                          0.0s
 => CACHED [39/49] RUN apk add npm                                                              0.0s
 => CACHED [40/49] RUN npm config set unsafe-perm true                                          0.0s
 => CACHED [41/49] RUN npm install -g yarn                                                      0.0s
 => CACHED [42/49] RUN npm install -g netlify-cli                                               0.0s
 => CACHED [43/49] RUN apk add libffi-dev                                                       0.0s
 => CACHED [44/49] RUN pip install docker-compose                                               0.0s
 => CACHED [45/49] RUN apk add shadow sudo                                                      0.0s
 => CACHED [46/49] RUN echo '%wheel ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers                     0.0s
 => CACHED [47/49] RUN useradd -G docker,wheel -m -s /bin/bash -u 1002 sh                       0.0s
 => CACHED [48/49] RUN groupmod -o -g 999 docker                                                0.0s
 => CACHED [49/49] WORKDIR /home/sh                                                             0.0s
 => ERROR exporting to oci image format                                                        10.5s
 => => exporting layers                                                                         0.6s
 => => exporting manifest sha256:97c8dedb84183d0d87b6c930b12e1b9396bb81fd9c6587fe2fbb9ae092d30  0.0s
 => => exporting config sha256:ef15b3f6a374fd494a0a586f7b33ac9435953460776e268b20f2eee5f14def6  0.0s
 => => sending tarball                                                                          9.6s
 => importing to docker                                                                         0.0s
------
 > exporting to oci image format:
------
Error: failed to solve: rpc error: code = Unknown desc = content digest sha256:ef15b3f6a374fd494a0a586f7b33ac9435953460776e268b20f2eee5f14def65: not found
Usage:
  /home/sh/bin/docker-buildx build [OPTIONS] PATH | URL | - [flags]

Aliases:
  build, b

Flags:
      --add-host strings         Add a custom host-to-IP mapping (host:ip)
      --build-arg stringArray    Set build-time variables
      --cache-from stringArray   External cache sources (eg. user/app:cache, type=local,src=path/to/dir)
      --cache-to stringArray     Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir)
  -f, --file string              Name of the Dockerfile (Default is 'PATH/Dockerfile')
  -h, --help                     help for build
      --iidfile string           Write the image ID to the file
      --label stringArray        Set metadata for an image
      --load                     Shorthand for --output=type=docker
      --network string           Set the networking mode for the RUN instructions during build (default "default")
      --no-cache                 Do not use cache when building the image
  -o, --output stringArray       Output destination (format: type=local,dest=path)
      --platform stringArray     Set target platform for build
      --progress string          Set type of progress output (auto, plain, tty). Use plain to show container output (default "auto")
      --pull                     Always attempt to pull a newer version of the image
      --push                     Shorthand for --output=type=registry
      --secret stringArray       Secret file to expose to the build: id=mysecret,src=/local/secret
      --ssh stringArray          SSH agent socket or keys to expose to the build (format: default|<id>[=<socket>|<key>[,<key>]])
  -t, --tag stringArray          Name and optionally a tag in the 'name:tag' format
--target string Set the target build stage to build.

Activity

  1. tonistiigi commented on Jul 8, 2019

    @tonistiigi
    Member

    I think I see how this could happen if there are parallel builds that end up building the same image and one ends up finishing with this error during load. Is this case possible in your case?

    If not then I need to enable debug logs in buildx cause without them it's very hard to guess what actually happened.

  2. tonistiigi commented on Jul 9, 2019

    @tonistiigi
    Member

    With #102 you can create the builder instance with docker buildx create --buildkitd-flags '--debug' and after this happens use docker logs <buildkit_container> to get the debug logs for the daemon.

  3. changed the title [-][bug] Error: failed to solve: rpc error: code = Unknown desc[/-] [+][bug] Error: failed to solve: rpc error: code = Unknown desc = content digest sha256:...: not found[/+] on Jul 10, 2019
  4. shykes commented on Jul 10, 2019

    @shykes
    ContributorAuthor

    I think I see how this could happen if there are parallel builds that end up building the same image and one ends up finishing with this error during load. Is this case possible in your case?

    Yes, that is very likely. Both environments where the issue occurred match your description. In fact I am also encountering another issue (issue coming soon) which is definitely related to concurrency.

  5. added
    kind/bug
    on Jul 12, 2019
  6. shykes commented on Jul 15, 2019

    @shykes
    ContributorAuthor

    Thank you!

  7. kegi commented on May 6, 2020

    @kegi

    I think this should be reopen.
    I'm having this error quite often when I build. Usually, I just re-run the command until it stop failing. (2-3 times in average).

    I'm building for 3 platforms in parallel.

    Docker version : 19.03.8, build afacb8b

  8. MarkCarbonell98 commented on May 13, 2020

    @MarkCarbonell98

    Same error here:

    Screenshot from 2020-05-13 11-38-53

    Using docker Docker version 19.03.8, build afacb8b7f0

    On a Raspberry Pi with arm32v7 architecture

  9. skabashnyuk commented on May 20, 2020

    @skabashnyuk

    I think this should be reopen.
    I'm having this error quite often when I build. Usually, I just re-run the command until it stop failing. (2-3 times in average).

    I'm building for 2 platforms in parallel.

    Got the same here https://github.com/eclipse/che-dashboard/actions

  10. tonistiigi commented on May 20, 2020

    @tonistiigi
    Member

    Please open a new issue with reproduction steps if you think there is still a way to hit this.

  11. shaunc commented on Jul 19, 2020

    @shaunc

    According to https://stackoverflow.com/questions/59868448/rpc-error-code-unknown-desc-failed-to-build-llb this is a resource issue. Indeed, adding another processor and a Gig seems to be working for me. Obviously a better error would be appropriate, at the least.

  12. holdenk commented on Oct 3, 2020

    @holdenk

    Just ran into this as well, cross building locally with qemu the docker file was

    FROM debian:buster-slim
    
    ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
    ENV PATH /opt/conda/bin:$PATH
    
    RUN apt-get update --fix-missing && \
        apt-get install -y wget bzip2 ca-certificates libglib2.0-0 libxext6 libsm6 libxrender1 git mercurial subversion && \
        apt-get clean
    
    COPY setup.sh /setup.sh
    RUN /setup.sh
    CMD [ "/bin/bash" ]
    

    and the setup file

    #!/bin/bash
    
    set -ex
    export arch=$(uname -m)
    if [ "$arch" == "aarm64" ]; then
      arch="arm64";
    fi
    wget --quiet https://github.com/conda-forge/miniforge/releases/download/4.8.5-1/Miniforge3-4.8.5-1-Linux-${arch}.sh -O ~/miniforge.sh
    chmod a+x ~/miniforge.sh
    ~/miniforge.sh -b -p /opt/conda
    /opt/conda/bin/conda clean -tipsy
    ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
    echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc
    echo "conda activate base" >> ~/.bashrc
    find /opt/conda/ -follow -type f -name '*.a' -delete
    find /opt/conda/ -follow -type f -name '*.js.map' -delete
    /opt/conda/bin/conda clean -afy
    
    

    My build command was: docker buildx build -t holdenk/miniforge3:v0 . --platform linux/amd64,linux/arm64 --push

    re-running seems to solve the issue though.

  13. huguesBouvier commented on Feb 13, 2021

    @huguesBouvier

    I am getting the same issue too: It happened for arm64

  14. andrewthetechie commented on Feb 13, 2021

    @andrewthetechie

    Seeing this as well, building for amd64 and arm64 in parallel

    `

    ocker versio

    2 | Client: Docker Engine - Community
    3 | Version: 20.10.3
    4 | API version: 1.41
    5 | Go version: go1.13.15
    6 | Git commit: 48d30b5
    7 | Built: Fri Jan 29 14:28:23 2021
    8 | OS/Arch: linux/amd64
    9 | Context: default
    10 | Experimental: true
    11 |  
    12 | Server: Docker Engine - Community
    13 | Engine:
    14 | Version: 20.10.3
    15 | API version: 1.41 (minimum version 1.12)
    16 | Go version: go1.13.15
    17 | Git commit: 46229ca
    18 | Built: Fri Jan 29 14:31:57 2021
    19 | OS/Arch: linux/amd64
    20 | Experimental: true
    21 | containerd:
    22 | Version: v1.4.3
    23 | GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
    24 | runc:
    25 | Version: 1.0.0-rc92
    26 | GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
    27 | docker-init:
    28 | Version: 0.19.0
    29 | GitCommit: de40ad0
    30 | + docker buildx version
    31 | github.com/docker/buildx v0.5.1 11057da
    `

    In my case, this is failing as a part of a drone build running inside a kubernetes cluster.

  15. tonistiigi commented on Feb 13, 2021

    @tonistiigi
    Member

    This issue has been closed. If you are seeing something similar create a new issue with a reproducer and full version infos.

  16. lei-cheung commented on Sep 15, 2021

    @lei-cheung

    use docker login you account

  17. itspawanhere commented on Feb 13, 2022

    @itspawanhere

    I have a Macbook pro with M1 chip.
    And I keep getting the same error: failed to solve: rpc error: code = Unknown desc

  18. Amin-asadii commented on Feb 21, 2022

    @Amin-asadii

    ERROR [bass-master_ida stage-1 4/24] COPY ida.run /installation/
    plase slove thise error

  19. cah-iovani-juarezgarcia commented on Apr 20, 2022

    @cah-iovani-juarezgarcia

    Having same error, im connecting from a different country from where i usually connect so... maybe a vpn related issue?

  20. yvess commented on May 3, 2022

    @yvess

    have the same error on Mac (docker desktop 4.7.1) only arm64 buildx with:

    • "--load" -> "failed to solve: failed to get reader: content digest sha256:a3...: not found"
    • "--push" works
  21. alberto56 commented on Nov 7, 2022

    @alberto56

    I get this error if I use the DigitalOcean "Docker" image, which has an old version of Docker on it. If I use the "Ubuntu" image and install Docker myself, I no longer get this error.

  22. sellrock-de commented on Dec 9, 2022

    @sellrock-de

    Having the same error randomly...

  23. sabaimran commented on Feb 14, 2023

    @sabaimran

    In case it might help someone else, I ran into the issue because my Dockerfile wasn't in the root of my folder where I was expecting it to be.

  24. olahsymbo commented on Feb 20, 2023

    @olahsymbo

    I solved this issue by first deleting ~/.docker/config.json then sign in again using sudo docker login. Afterward, I changed the name from Dockerfile to dockerfile and finally tried sudo docker-compose build

  25. crazy-max commented on Jul 28, 2023

    @crazy-max
    Member

    Locking this issue. Open a new issue with reproduction steps if you hit this again. Thanks.

  26. locked as resolved and limited conversation to collaborators on Jul 28, 2023
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

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions