Error: buildx call failed with: error: failed to solve: rpc error: code = Unknown desc = server message: insufficient_scope: authorization failed
See original GitHub issueBehaviour
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
- Repository URL (if public): https://github.com/strawberrymusicplayer/strawberry-mxe
- Build URL (if public): https://github.com/strawberrymusicplayer/strawberry-mxe/blob/master/Dockerfile
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:
- Created 3 years ago
- Reactions:5
- Comments:6 (1 by maintainers)
Top GitHub Comments
Thanks! I didn’t notice I had two if’s in there. That’s embarrassing.
@jonaski
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