question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

buildx call failed with: failed to solve: rpc error: code = Unknown desc = unexpected status: 403 Forbidden

See original GitHub issue

In continuation of https://github.com/docker/build-push-action/issues/200 Fixing registry URLs and image names didn’t work. Action fails with 403, but with slightly different text. Better descriptive error messages might help a lot.

Error: buildx call failed with: failed to solve: rpc error: code = Unknown desc = unexpected status: 403 Forbidden
jobs:
  publish:
    name: Publish Image
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Preparation
      id: prep
      run: |
        REGISTRY="docker.pkg.github.com"
        IMAGE="${REGISTRY}/${{ github.repository }}/${{ github.event.repository.name }}"
        TAGS="${IMAGE}:${{ github.sha }}"
        if [[ $GITHUB_REF == ref/head/master ]]; then
          TAGS="${TAGS},${IMAGE}:latest"
        fi
        echo ::set-output name=tags::${TAGS}
    - name: Docker Buildx setup
      uses: docker/setup-buildx-action@v1
    - name: Login in to registry
      uses: docker/login-action@v1
      with:
        registry: docker.pkg.github.com
        username: ${{ github.actor }}
        password: ${{ github.token }}
    - name: Push to registry
      uses: docker/build-push-action@v2
      with:
        push: true
        file: src/Dockerfile
        tags: ${{ steps.prep.outputs.tags }}

Initialization

...
Run docker/login-action@v1
🔑 Logging into docker.pkg.github.com...
🎉 Login Succeeded!
# --------------------
Run docker/build-push-action@v2
📣 Buildx version: 0.4.2
🏃 Starting build...
/usr/bin/docker buildx build --build-arg MY_SECRET="***" --tag docker.pkg.github.com/example-org/my-app/my-app:c7c6023ea9af524234444387000a2553aa20a7f6 --iidfile /tmp/docker-build-push-8RVwsf/iidfile --secret id=GIT_AUTH_TOKEN,src=/tmp/docker-build-push-8RVwsf/tmp-3034-k9IcoU4X5lva --file src/Dockerfile --push https://github.com/example-org/my-app.git#heads/deploy-den-gh-actions
time="2020-10-26T08:08:24Z" level=warning msg="invalid non-bool value for BUILDX_NO_DEFAULT_LOAD: "
#1 [internal] load git source https://github.com/example-org...
#1 0.034 Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/1/fs/
#1 0.229 c7c6023ea9af524234444387000a2553aa20a7f6	refs/heads/deploy-den-gh-actions
#1 0.484 From https://github.com/example-org/my-app
#1 0.484  * [new branch]      deploy-den-gh-actions -> heads/deploy-den-gh-actions
#1 0.484  * [new branch]      deploy-den-gh-actions -> origin/deploy-den-gh-actions
#1 DONE 0.5s

#3 [internal] load metadata for docker.io/library/node:12-alpine
#3 ...
...
# usual build
...
#18 exporting to image
#18 exporting layers
#18 exporting layers 1.0s done
#18 exporting manifest sha256:65a39d9de33f06b9b0bfcc4a1d263b35c11f65619c2d4b8af4253e8620a01b45 done
#18 exporting config sha256:c14e402195f459fe81fa566401906e32668263bc838fe0bcf2ab7c5ed635ce27 done
#18 pushing layers
#18 pushing layers 0.9s done
#18 ERROR: unexpected status: 403 Forbidden
------
 > exporting to image:
------
failed to solve: rpc error: code = Unknown desc = unexpected status: 403 Forbidden
Error: buildx call failed with: failed to solve: rpc error: code = Unknown desc = unexpected status: 403 Forbidden

I don’t have full root privileges on that repo. But I definitely can write to that repo. Docs state that everyone with write permissions can push packages.

Using ${{ github.repository_owner }} instead of ${{ github.actor }} as by docs - didn’t work either and outputs new error:

#18 exporting to image
#18 exporting layers
#18 exporting layers 1.2s done
#18 exporting manifest sha256:0c0726d898aa0d899919b55741f97b008a05b638dda4e6773d493c4b5bb7bd24 done
#18 exporting config sha256:f1ca744c973712076749ffaf0917d3786d85fc0f32b488e2f839106c8defce83 done
#18 pushing layers
#18 pushing layers 0.9s done
#18 ERROR: failed commit on ref "layer-sha256:680be72a94bda769d50675fcdbf6f0bfe1474ca61e23131a3dff49b25e390c08": invalid content digest in response: invalid checksum digest format
------
 > exporting to image:
------
failed to solve: rpc error: code = Unknown desc = failed commit on ref "layer-sha256:680be72a94bda769d50675fcdbf6f0bfe1474ca61e23131a3dff49b25e390c08": invalid content digest in response: invalid checksum digest format
Error: buildx call failed with: failed to solve: rpc error: code = Unknown desc = failed commit on ref "layer-sha256:680be72a94bda769d50675fcdbf6f0bfe1474ca61e23131a3dff49b25e390c08": invalid content digest in response: invalid checksum digest format

Referenced docs: https://github.com/docker/login-action/tree/ddf06e1fed3619d4c000ccc251072e2f261f532a#github-packages-docker-registry https://docs.github.com/en/free-pro-team@latest/packages/publishing-and-managing-packages/publishing-a-package https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

78reactions
AnderssonPetercommented, Nov 17, 2020
3reactions
Rich43commented, Dec 6, 2020

thanks for above comment, that fixed it for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

github action with docker makes error "exporting to image 403 ...
But my partner push code to main branch, it makes 403 forbidden error. I don't know how to solve this problem...
Read more >
[solved] Failing to build dockerfile for ARM servers; rpc error ...
I wrote a dockerfile, put it on github and added the docker. publish action file.
Read more >
Troubleshooting for Delivery Pipeline - IBM Cloud Docs
When I attempt to compile my app in a single pipeline job, the build job fails with an unexpected error. Your app requires...
Read more >
Solution for Docker issue failed to solve: rpc error
A solution for the Docker problem 'failed to solve: rpc error: code = unknown desc = failed to solve with frontend dockerfile v0'...
Read more >
Can't pull images from Azure Container Registry to Kubernetes
Cause 3: 403 Forbidden error. Failed to pull image "<acrname>.azurecr.io/<repository:tag>": rpc error: code = Unknown desc ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found