build-push-action: raise `ghcr unexpected status: 403 Forbidden` when push ghcr image

Troubleshooting

Behaviour

We didn’t change any configuration before and after this error happened, same ghcr container image had permisson issue.

Steps to reproduce this issue

Expected behaviour

push successfully

Actual behaviour

#33 [auth] yikun/apache-spark-ci-image:pull,push token for ghcr.io
#33 DONE 0.0s

#32 exporting to image
#32 ...

#34 [auth] apache/spark/apache-spark-github-action-image-cache:pull yikun/apache-spark-ci-image:pull,push token for ghcr.io
#34 DONE 0.0s

#32 exporting to image
#32 pushing layers 1.5s done
#32 ERROR: unexpected status: 403 Forbidden
------
 > exporting to image:
------
ERROR: failed to solve: unexpected status: 403 Forbidden
Error: buildx failed with: ERROR: failed to solve: unexpected status: 403 Forbidden

Configuration

  • Repository URL (if public):
  • Build URL (if public):
# paste your YAML workflow file here and remove sensitive data

Logs

https://github.com/Yikun/spark/runs/8221889583?check_suite_focus=true

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 21 (2 by maintainers)

Most upvoted comments

What seem to solve it for me is adding an explicit permissions section to the workflow yml file:

    permissions:
      contents: read
      packages: write

Hope this helps someone else out there 😅

https://github.com/apache/spark/pull/37745#issuecomment-1234067056

We can confirm that: image

and

image

and

image

We can only recover this by create a new image.

Facing this issue again. Is there no fix for this?

Same issue for me…

Sorry but we can’t do much about it as it’s related to GitHub infrastructure. Same as https://github.com/docker/build-push-action/issues/651. Suggest to contact GitHub.