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.

Image push fails on Google Artifact Registry

See original GitHub issue

Behaviour

Steps to reproduce this issue

  1. Have a project configured on GCP with a Docker Artifact Registry configured
  2. Set up a service account in the project with write access to the registry
  3. Execute the GitHub Workflow pasted below

Expected behaviour

The image should be built and pushed to the Google Artifact Registry configured.

Actual behaviour

The image push fails with the following error.

📣 Buildx version: 0.4.2
🏃 Starting build...
/usr/bin/docker buildx build --label org.opencontainers.image.created=2020-09-15T14:40:23Z --label org.opencontainers.image.source=git://github.com/<redacted>.git --label org.opencontainers.image.version=19 --label org.opencontainers.image.revision=<redacted> --label org.opencontainers.image.licenses= --tag northamerica-northeast1-docker.pkg.dev/<redacted>:19 --iidfile /tmp/docker-build-push-2Wh0EC/iidfile --file ./Dockerfile --push .
time="2020-09-15T14:40:50Z" level=warning msg="invalid non-bool value for BUILDX_NO_DEFAULT_LOAD: "
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 348B 0.0s done
#1 DONE 0.0s

[...]

#15 exporting to image
#15 exporting layers
#15 exporting layers 5.1s done
#15 exporting manifest sha256:d5e9c868a04637edc4989104f2acc8410fe2d246374b51e946044534c40f2bdb 0.0s done
#15 exporting config sha256:8552d666e2b855b8f4f484188214df37c4a643cef92b50d228f30f17a23c7fd7 done
#15 pushing layers
#15 pushing layers 4.8s done
#15 ERROR: failed commit on ref "layer-sha256:5e922235e3dc435811ea3b2f5f1ef3f73ee042acadb77b51acf525f9cce130e2": invalid content digest in response: invalid checksum digest format
------
 > exporting to image:
------
failed to solve: rpc error: code = Unknown desc = failed commit on ref "layer-sha256:5e922235e3dc435811ea3b2f5f1ef3f73ee042acadb77b51acf525f9cce130e2": invalid content digest in response: invalid checksum digest format

Configuration

Repository and project are private.

name: Cloud Run

on:
  push:
    branches:
      - master
  pull_request:

env:
  DOCKER_IMAGE: foo
  PROJECT_ID: bar
  REGION: northamerica-northeast1
  REPOSITORY_ID: foobar

jobs:
  build-tag-push:
    name: Build, tag, and push Docker image
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Prepare
        id: prep
        run: |
          VERSION="${{ github.run_number }}"
          REGISTRY="${REGION}-docker.pkg.dev"
          REPOSITORY="${REGISTRY}/${PROJECT_ID}/${REPOSITORY_ID}"
          TAGS="${REPOSITORY}/${DOCKER_IMAGE}:${VERSION}"
          echo ::set-output name=registry::${REGISTRY}
          echo ::set-output name=version::${VERSION}
          echo ::set-output name=tags::${TAGS}
          echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')

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

      - name: Login to GCR
        uses: docker/login-action@v1
        with:
          registry: ${{ steps.prep.outputs.registry }}
          username: _json_key
          password: ${{ secrets.GCP_SA_KEY }}

      - name: Build and push image
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: ${{ steps.prep.outputs.tags }}
          labels: |
            org.opencontainers.image.created=${{ steps.prep.outputs.created }}
            org.opencontainers.image.source=${{ github.repositoryUrl }}
            org.opencontainers.image.version=${{ steps.prep.outputs.version }}
            org.opencontainers.image.revision=${{ github.sha }}
            org.opencontainers.image.licenses=${{ github.event.repository.license.name }}

Logs

I can’t pull the full log here, but I pasted the relevant parts above.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
crazy-maxcommented, Sep 28, 2020

@fparga

I tested it with the same workflow, looks like something have been fixed in Google Artifact Registry, it’s working as expected now.

Yes indeed see https://github.com/deislabs/oras/issues/157#issuecomment-699204841

1reaction
fpargacommented, Sep 22, 2020

@crazy-max I tested it with the same workflow, looks like something have been fixed in Google Artifact Registry, it’s working as expected now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot container image issues | Artifact Registry ...
Cannot push an image to Artifact Registry · Verify that the repository exists. · Verify that the full path of the image that...
Read more >
Service Account Unable to Push Docker Image to Google ...
I am trying to push a Docker image to Google Artifact Registry (GAR) while impersonating a Service Account ( $SERV_ACCT_EMAIL ):.
Read more >
Cannot push an image to Google Docker Artifact Registry #50
Able to push a docker image to Google Artifact Registry. Observed behavior. Getting the following error:.
Read more >
Insufficient errors `push`ing to a non-existent artifact registry ...
I incorrectly specified a repository and the command to create it failed. push 'ing to the non-existent repo, produces insufficient errors.
Read more >
Fixing Docker Image Tagging Issues in Google Cloud Build ...
How to fix missing tags in Docker images with Google Cloud Build and Artifact Registry. ... but the gcloud run deploy command 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