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

ERROR: failed to calculate checksum of ref ... no such file or directory #910

Closed
theAkito opened this issue Jul 22, 2023 · 7 comments
Closed

Comments

@theAkito
Copy link

theAkito commented Jul 22, 2023

Behaviour

Catching up on #558 (comment).

Steps to reproduce this issue

https://github.com/theAkito/docker-murmur/blob/master/.github/workflows/docker-build-push-app-buster-slim.yml

Expected behaviour

Process should complete successfully.

Actual behaviour

Internal Docker processing does not complete successfully, leading to failed Docker builds.

Configuration

name: Docker Image Build and Push

on:
  push:
    branches:
      - master
    tags:
      - "*.*.*"
  pull_request:

jobs:

  build-push:

    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Git Metadata for Docker
        id: meta
        uses: docker/metadata-action@v4
        with:
          images: |
            akito13/murmur
          flavor: |
            latest=true
            prefix=
            suffix=
          tags: |
            type=edge,branch=master
            type=raw,value=buster-slim
            type=schedule
            type=ref,event=branch
            type=ref,event=pr
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            type=semver,pattern={{major}}
            type=sha,prefix=,format=long

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2

      - name: Set up Docker BuildX
        uses: docker/setup-buildx-action@v2

      - name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and push
        uses: docker/build-push-action@v3
        with:
          context: .
          platforms: linux/arm/v7,linux/arm64/v8,linux/amd64
          push: ${{ github.event_name != 'pull_request' }}
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}

Logs

logs_9.zip

Additional Context

dotnet/dotnet-docker#4716

@crazy-max
Copy link
Member

crazy-max commented Jul 22, 2023

https://github.com/theAkito/docker-murmur/actions/runs/5627573725/job/15250407075#step:7:6824

#24 [linux/amd64 stage-1 5/6] COPY --from=build /root/mumble/release/murmurd /usr/bin/murmurd
#24 ERROR: failed to calculate checksum of ref qgp9ucmtmblbgry83pja48n5y::8myxzhj2gtzqfcqjue0dzjw4i: failed to walk /tmp/buildkit-mount2545155800/root/mumble/release: lstat /tmp/buildkit-mount2545155800/root/mumble/release: no such file or directory

It looks similar to docker/buildx#1899.

Do you repro locally with:

# create container builder to be able to build a multiplatform image
$ docker buildx create --name mybuilder --bootstrap
# build
$ docker buildx --builder mybuilder build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 .

@theAkito
Copy link
Author

@crazy-max

Locally, I'm getting the following.

ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref qu9hjqz890ej8kf870640mbq4::8ggpgykihnibeuqu4btxyqu2p: failed to walk /tmp/buildkit-mount1844446442/root/mumble/release: lstat /tmp/buildkit-mount1844446442/root/mumble/release: no such file or directory

@crazy-max
Copy link
Member

Ok can you change this step to enable BuildKit container logs:

      - name: Set up Docker BuildX
        uses: docker/setup-buildx-action@v2
        with:
          buildkitd-flags: --debug

That could be useful to us.

@theAkito
Copy link
Author

After debugging the issue locally, I came to the conclusion that it was a mistake in the configuration of the Dockerfile, where a file was there before, but in a new version of the deployed app it's not there, anymore. Hence, "no such file or directory".

However, I must emphasise, that the error is very unintuitive & should be more clear.

Is this something that would be reported on moby or where would that be accomplished?

As for this specific issue at hand, it can be considered resolved for all I expected.

@crazy-max
Copy link
Member

However, I must emphasise, that the error is very unintuitive & should be more clear.

We have made some enhancements related to this such as moby/buildkit#3990

Just of curiosity, could you try with latest 0.12.0 of BuildKit?:

      - name: Set up Docker BuildX
        uses: docker/setup-buildx-action@v2
        with:
          driver-opts: |
            image=moby/buildkit:v0.12.0
          buildkitd-flags: --debug

theAkito added a commit to theAkito/docker-murmur that referenced this issue Jul 23, 2023
theAkito added a commit to theAkito/docker-murmur that referenced this issue Jul 24, 2023
@theAkito
Copy link
Author

@DeniroBlack
Copy link

Downgrade docker on windows helps to me

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

No branches or pull requests

3 participants