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.

Error: buildx call failed with: error: failed to solve: rpc error: code = Unknown desc = server message: insufficient_scope: authorization failed

See original GitHub issue

Behaviour

Steps to reproduce this issue

My docker/build-push-action@v1 action recently stopped. I switched to docker/build-push-action@v2, as I saw that had solved the problem for many others, but I’m still getting similar errors. “insufficient_scope: authorization failed” The build takes 4 hours and 40 minutes to complete, so it might be related to that. If I remove the build itself from the Dockerfile, so the image only contains the installed packages, it works. The repository is here: https://github.com/strawberrymusicplayer/strawberry-mxe The repository compiles Windows dependencies using MXE, uploads the docker image, and the image is used to cross-compile in the projects main repos CI. Maybe it is possible to move the build from the Dockerfile to the CI itself, but I’ve never figured out how. I think the build-push-action step might take to long, and the login times out, but I’m only guessing.

Expected behaviour

Upload docker image.

Actual behaviour

This is the log from after the last command in the dockerfile (make) completes:

#14 exporting to image
#14 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#14 exporting layers
#14 exporting layers 412.4s done
#14 exporting manifest sha256:47411017e85d960d2ecd4ac7c45758c722d1aa4892d15d68273704811f9a6a8f done
#14 exporting config sha256:c55344cd468195265ed3feb798e0eb281ab8fb61dd422e3411d348e7157fa643 done
#14 pushing layers
#14 ...

#15 [auth] ***/strawberry-mxe:pull,push token for registry-1.docker.io
#15 sha256:388866416d8582fa5332cd307829fa2fc6c99578a0ec35c3f5e7b40187f9ec35
#15 DONE 0.0s

#14 exporting to image
#14 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#14 pushing layers 0.3s done
#14 ERROR: server message: insufficient_scope: authorization failed

#16 [auth] ***/strawberry-mxe:pull,push token for registry-1.docker.io
#16 sha256:b759f41b58a21152630fd11de0127564bfad617a17f72a8de37e7dd3481ff4d6
#16 DONE 0.0s
------
 > exporting to image:
------
error: failed to solve: rpc error: code = Unknown desc = server message: insufficient_scope: authorization failed
Error: buildx call failed with: error: failed to solve: rpc error: code = Unknown desc = server message: insufficient_scope: authorization failed

Configuration

name: C/C++ CI
on: [push, pull_request]

jobs:
  build:
    name: Build MXE
    runs-on: ubuntu-latest
    steps:

      - name: Checkout
        uses: actions/checkout@v1.2.0

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - name: Login to DockerHub
        if: github.ref == 'refs/heads/test'
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_PASSWORD }}

      - name: Push to DockerHub
        if: github.ref == 'refs/heads/master'
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: jonaski/strawberry-mxe:latest

Logs

Download the log file of your build and attach it to this issue. logs_332.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jonaskicommented, Mar 9, 2021

Thanks! I didn’t notice I had two if’s in there. That’s embarrassing.

0reactions
crazy-maxcommented, Mar 9, 2021

@jonaski

      - name: Login to DockerHub
        if: github.ref == 'refs/heads/test'
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_PASSWORD }}

      - name: Push to DockerHub
        if: github.ref == 'refs/heads/master'
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: jonaski/strawberry-mxe:latest

Something odd with your workflow. You login only on test branch ref (if: github.ref == 'refs/heads/test') and build/push only on master branch ref (if: github.ref == 'refs/heads/master') so logically it fails when it tries to push because the login step is skipped for master branch: https://github.com/strawberrymusicplayer/strawberry-mxe/runs/2047784500?check_suite_focus=true#step:5:11

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

insufficient_scope: authorization failed · Issue #160
Strangely enough, I was getting this error because of a mismatch between the name given to a build stage and the name used...
Read more >
Docker buildx Error : rpc error: code = Unknown desc = ...
It is resloved! In my case, there was no repo in the Docker Hub created whose tag I have passed here in the...
Read more >
Docker image can be pushed to one repo, but not another
I want to build Docker images and push them to the repository using, e.g., ... to image: ------ ERROR: failed to solve: server...
Read more >
Troubleshooting | Google Kubernetes Engine (GKE)
The command fails and displays an error message, usually with HTTP status code 401 (Unauthorized). The cause of this issue might be one...
Read more >
kind – Known Issues - Kubernetes
Having problems with kind? This guide covers some known problems and solutions / workarounds. It may additionally be helpful to: check our issue...
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