buildkit icon indicating copy to clipboard operation
buildkit copied to clipboard

ERROR: Error on COPY command when using caching "failed to solve: failed to compute cache key"

Open erez-levi opened this issue 2 years ago • 3 comments

I am using the gha caching for my github workflow, more often now I'm getting the following error:

ERROR: failed to solve: failed to compute cache key: failed to copy: read tcp 1.1.1.148464->2.2.2.2:443: read: connection timed out

When this error occurs one or two reruns will make it work, lately It becomes more frequent and interfering with our work, wanted to know if others encountered this and if this is something in my configuration that I can adjust or is it a bug.

configuration:

  - name: build image
    uses: docker/build-push-action@v4
    with:
      push: true
      context: ./${{ inputs.image_path }}
      provenance: false
      tags: |
       ${{ inputs.docker_repo }}/${{ env.NAME }}:${{ env.TAG }}
      build-args: |
        GIT_BRANCH=${{ inputs.branch }}
        GIT_REPO=${{ github.repository }}
        GIT_TAG=${{ env.TAG }}
      target: ${{ inputs.target }}
      file: ./${{ inputs.image_path }}/${{ inputs.dockerfile_name }}
      cache-from: type=gha
      cache-to: type=gha,mode=max

erez-levi avatar Nov 19 '23 11:11 erez-levi

Observed the same with both inline and registry cache, for the ADD command with src=<URL>. Made me go back to docker builder, which is sad since that one sucks at multi-stage builds due the lack of registry cache

ko3n1g avatar Nov 21 '23 20:11 ko3n1g

Without a reproducible (even if multiple attempts are needed) testcase it is hard to say if this is just a network stack issue or something in the builder.

tonistiigi avatar Nov 22 '23 01:11 tonistiigi

I'll try to reproduce it next time this happens

erez-levi avatar Nov 22 '23 09:11 erez-levi