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.

v2: pushing to Github Container Registry fails

See original GitHub issue

When pushing to the Github Container Registry, I get the following error:

#24 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

The PAT has what I believe is the required scope: delete:packages, read:packages, repo, write:packages.

If the full workflow is useful, you can find it here: https://github.com/cicirello/alpine-plus-plus/blob/master/.github/workflows/docker-publish.yml

There are two jobs in the workflow, the first pushes to Docker Hub successfully. The second attempts to push to the Github Container Registry, and fails. The docker/login-action succeeds in logging in to the GitHub Container Registry.

Issue Analytics

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

github_iconTop GitHub Comments

23reactions
cicirellocommented, Sep 7, 2020

@crazy-max Awesome. Thanks. It was definitely due to my missing ghcr.io/ at start of tags. It works now. It might be useful for v2 to have an example workflow for GHCR, as well as an example workflow for pushing to both Docker Hub and GHCR (e.g., your alpine-s6 workflow was helpful in simplifying mine).

9reactions
crazy-maxcommented, Sep 7, 2020

@cicirello

I have pushed to GHCR successfully on this repo with the following workflow (see https://github.com/users/crazy-max/packages/container/alpine-s6).

The PAT has what I believe is the required scope: delete:packages, read:packages, repo, write:packages.

I would have thought that your scopes were not enough but it looks good to me.

But looking at the build command generated by the action, it looks like you forgot to prepend your tags with ghcr.io/.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pushing to GitHub Container Registry fails with ...
Push the files to GitHub and it will trigger the workflow. Expected behaviour. The Docker image should be pushed to GitHub. Actual behaviour....
Read more >
Error when pushing image to github · Issue #115
Hi @dirodriguezm,. With GitHub Container Registry you can only have a single namespace (user or org) compared to GitHub Package Registry. So in ......
Read more >
Docker push to "Other Docker Container Registry" fails ...
Currently if i push to Other Docker Container Registry the tooling appends the scheme port to the container image tag. Which then fails...
Read more >
Random 403 errors when pushing to GHCR · Issue #463
Troubleshooting Pushing to GHCR seems to randomly resulting in 403s in the last 24 hours. Rerunning the GH action seems to resolve things ......
Read more >
Unable to push to ghcr.io from Github Actions #26274
Running the job doesnt allow pushing to the container registry: #20 pushing ghcr.io/REDACTED/REDACTED:master with docker #20 sha256:REDACTED ...
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