build-push-action icon indicating copy to clipboard operation
build-push-action copied to clipboard

unknown blob error on push

Open r-s-sandbox opened this issue 5 years ago • 3 comments

Behaviour

I am using v2 build push action and have started noticing intermittent failures during docker push with an unknown blob error.

Here is part of the job:

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

      - name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-

      - name: Login to docker registry
        uses: docker/login-action@v1
        with:
          registry: docker.pkg.github.com
          username: ${{ github.actor }}
          password: ${{ github.token }}

      - name: Build image
        uses: docker/build-push-action@v2
        with:
          context: .
          push: true
          file: ./Dockerfile
          tags: docker.pkg.github.com/${{ github.repository }}/app:latest
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache

Logs

1a4f5de7f684: Layer already exists
13545bbbc98b: Layer already exists
c67dd3decb62: Layer already exists
unknown blob
Error: exit status 1
Usage:
exit status 1
  github-actions build-push [flags]

Flags:
  -h, --help   help for build-push

r-s-sandbox avatar Jan 14 '21 11:01 r-s-sandbox

Have you tried upgrading to ghcr.io? I've been facing this issue too and after reading up on the subject a little it turns out GH are deprecating docker.pkg.github.com in favour of GitHub Container Registry, this might be useful to you.

I haven't yet figured out how to upgrade my CI pipeline but I'll reply here when I figure it out :~)

darnfish avatar Jan 14 '21 23:01 darnfish

Yes upgrading to ghcr.io did resolve the issue with push. Github acknowledged there was a problem with their systems and have since resolved the issue. Haven't tested if its resolved as I'm using the newer registry now.

r-s-sandbox avatar Jan 15 '21 12:01 r-s-sandbox

Yes looks like an issue with the deprecated GitHub package registry and not this action. See also https://github.com/docker/build-push-action/issues/148#issuecomment-702278002

crazy-max avatar Jan 21 '21 11:01 crazy-max