Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected status from HEAD #1240

Closed
2 of 3 tasks
RainbowZephyr opened this issue Oct 13, 2024 · 1 comment
Closed
2 of 3 tasks

Unexpected status from HEAD #1240

RainbowZephyr opened this issue Oct 13, 2024 · 1 comment

Comments

@RainbowZephyr
Copy link

RainbowZephyr commented Oct 13, 2024

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

Hello,
I am having trouble pushing to Github's container registry from the CI, I keep getting:

ERROR: failed to solve: failed to push ghcr.io/nomuwdev/nomuw-gateway:0.1.5: unexpected status from HEAD request to https://ghcr.io/v2/nomuwdev/nomuw-gateway/blobs/sha256:47289e83a07a72d51da5a8aa17e424eaf900f89d6df10d6a408f8c2afe22de22: 403 Forbidden

I have another repo under that organization and the pipeline works and pushes the images normally. #981 mentions renaming the tag in image, which I tried but still no avail. Read and write permissions are enabled for the actions in the repo settings and this is the workflow file:

Expected behaviour

The image should be built and pushed to Github container registry

Actual behaviour

Fails with error code 403 forbidden

Repository URL

No response

Workflow run URL

No response

YAML workflow

name: CI for staging branch

env:
  VERSION: '0.1.5'

on:
  push:
    branches:
      - staging

  pull_request:
    branches:
      - staging

jobs:
  deploy:
    runs-on: [ self-hosted, Linux, X64 ]

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

      - name: Log in to GitHub Container Registry
        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build and push Docker image
        uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          tags: ghcr.io/${{ github.repository }}:staging-${{ env.VERSION }}

Workflow logs

No response

BuildKit logs

No response

Additional info

No response

@crazy-max
Copy link
Member

403 Forbidden

403 either means the token does not have write access enabled similar to #687 (comment) or ${{ github.repository }} casing is not correct which sometimes returns 403: https://github.com/docker/build-push-action/blob/master/TROUBLESHOOTING.md#repository-name-must-be-lowercase or this package repository settings are not correct.

Anyway that's something we can't do much about it as it's related to GitHub infrastructure. Same as #651. Suggest to contact GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants