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.

insufficient_scope: authorization failed

See original GitHub issue

Behaviour

Steps to reproduce this issue

  1. Set up QEMU
  2. Set up Docker Buildx
  3. Login to DockerHub
  4. Build and push

Expected behaviour

Publish image to docker hub

Actual behaviour

ERROR: server message: insufficient_scope: authorization failed

Configuration

https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication https://hub.docker.com/repository/docker/antoniofalcaojr/dotnet5-graphql3-webapi

name: Push API Image

on:
  push:
    branches: master
  workflow_dispatch:

jobs:
  push_to_registry:
    name: Push Docker image to Docker Hub
    runs-on: ubuntu-latest
    steps:
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Login to DockerHub
        uses: docker/login-action@v1 
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        name: Build and push
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          file: ./src/Dotnet5.GraphQL3.Store.WebAPI/Dockerfile 
          push: true
          tags: antoniofalcaojf/dotnet5-graphql3-webapi:latest
      -
        name: Image digest
        run: echo ${{ steps.docker_build.outputs.digest }}

Command produced

/usr/bin/docker buildx build --tag antoniofalcaojf/dotnet5-graphql3-webapi:latest --iidfile /tmp/docker-build-push-lDmUS3/iidfile --secret id=GIT_AUTH_TOKEN,src=/tmp/docker-build-push-lDmUS3/tmp-3384-twk4xwQeuxwk --file ./src/Dotnet5.GraphQL3.Store.WebAPI/Dockerfile --push https://github.com/AntonioFalcao/Dotnet5.GraphQL3.WebApplication.git#heads/release

Logs

#33 exporting to image
#33 exporting layers
#33 exporting layers 2.4s done
#33 exporting manifest sha256:3c6a2a955932783e726461031bee8657c2ec7f2b2f239c110ba44ae58effef69 done
#33 exporting config sha256:6d39eefff02cee7c50511f16bd824957f3ef082ed60324850954a5aa3b13a5ee done
#33 pushing layers
#33 pushing layers 0.2s done
#33 ERROR: server message: insufficient_scope: authorization failed
------
 > exporting to image:
------
failed to solve: rpc error: code = Unknown desc = server message: insufficient_scope: authorization failed
Error: The process '/usr/bin/docker' failed with exit code 1

Issue Analytics

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

github_iconTop GitHub Comments

12reactions
chase-moskalcommented, Jun 29, 2021

hello, if anybody else gets stuck on this like i did, here’s what i did to solve it

i had to fix my tags setting:

    - name: push image - server
      uses: docker/build-push-action@v2
      with:
        file: ./s/Dockerfile
        context: .
        push: true
        tags: ${{ env.REGISTRY }}/${{ github.repository }}/server:${{ github.sha }}

where

  • ${{ env.REGISTRY }} is equivalent with ghcr.io (the github packages registry)
  • ${{ github.repository }} is equivalent with chase-moskal/xiome (my github name and private repo’s name)
  • server is the name i decided for my docker image, since my repo is pushing multiple different images
  • ${{ github.sha }} is simply the commit id, which i’m using to identify my staging images (i plan to use git v tags for real production releases)
  • thus it computes to something like ghcr.io/chase-moskal/xiome/server:69aa49cd2994f2063f908dd8868f1aa4da2385bddfbc0e069534a7fa5865cb08

this fixed the issue in my case, particularly adding the ghcr.io/ prefix

6reactions
AntonioFalcaoJrcommented, Oct 5, 2020

@AntonioFalcao So it’s a typo in your workflow:

antoniofalcaojf/dotnet5-graphql3-webapi != antoniofalcaojr/dotnet5-graphql3-webapi

OMG! So sorry about that! It’s working now. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dockerfile build raising insufficient_scope: authorization failed ...
First I though it was an authentication problem so I logged in the Docker desktop, but still it does not work. Is there...
Read more >
Push to Azure container registry using Helm throws Error
Push to Azure container registry using Helm throws Error: server message: insufficient_scope: authorization failed.
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., main/foo/foo:latest , but I also want to push customer-specific ......
Read more >
Unable to pull private docker image during pipeline - Jira
... registry endpoint: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed.
Read more >
Failure to build image FROM an image that already exists locally
... pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed.
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