Build cache stopped working
Contributing guidelines
- [x] I've read the contributing guidelines and wholeheartedly agree
I've found a bug, and:
- [x] The documentation does not mention anything about my problem
- [x] There are no open or closed issues that are related to my problem
Description
I was using build cache to S3 bucket
- name: Build and push
id: docker-build
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDKIT_INLINE_CACHE=1
cache-to: |
type=s3,region=eu-central-1,bucket=buildcache-bucket,prefix=${{ inputs.service_name }}-${{ matrix.environment }}-,mode=inline
cache-from: |
type=s3,region=eu-central-1,bucket=buildcache-bucket,prefix=${{ inputs.service_name }}-${{ matrix.environment }}-,mode=max
Without changing anything in the build or permissions using oidc to aws.
I get the following build error on layer export
buildx failed with: ERROR: failed to build: failed to solve: error writing layer blob: upload multipart failed, upload id: 0CmOeTpIygbSJpgtG_iFzcKcWdeK1sLkI3ZcQe7ZkLmFj8.gAORXLej4RN3d47vSGD.NAFcHng2bd87otXv4rZDdktPL1HLRFvBANOohEZCTt5EzHR7mUqtmFyWo5yuL_o9ihX4o7yY4CmJzsIS8QSyPlzZl93TR1mqwtW4O500-, cause: operation error S3: CompleteMultipartUpload, https response error StatusCode: 400, RequestID: SHX5DBXB7E81W56D, HostID: p1oqbmZtDHuDL4ak8ysVjjtE15mdb2zRP2OXm9snUi5m4movFnOpYp450tiGRrTGZjHANwQOCq6ooe7UJDuk4IwNrOw2B3OC18wHGQCdymM=, api error InvalidPart: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag.
I tried changing inline to max same result error
Expected behaviour
Build cache work export layer correct. Expected logs
#21 exporting cache to Amazon S3
#21 preparing build cache for export
#21 writing layer sha256:29961bb2258c743c04056d982381746046014bb630810fe96328559c85d98619
#21 writing layer sha256:29961bb2258c743c04056d982381746046014bb630810fe96328559c85d98619 0.5s done
#21 preparing build cache for export 0.5s done
#21 DONE 0.5s
Actual behaviour
Errors
buildx failed with: ERROR: failed to build: failed to solve: error writing layer blob: upload multipart failed, upload id: 0CmOeTpIygbSJpgtG_iFzcKcWdeK1sLkI3ZcQe7ZkLmFj8.gAORXLej4RN3d47vSGD.NAFcHng2bd87otXv4rZDdktPL1HLRFvBANOohEZCTt5EzHR7mUqtmFyWo5yuL_o9ihX4o7yY4CmJzsIS8QSyPlzZl93TR1mqwtW4O500-, cause: operation error S3: CompleteMultipartUpload, https response error StatusCode: 400, RequestID: SHX5DBXB7E81W56D, HostID: p1oqbmZtDHuDL4ak8ysVjjtE15mdb2zRP2OXm9snUi5m4movFnOpYp450tiGRrTGZjHANwQOCq6ooe7UJDuk4IwNrOw2B3OC18wHGQCdymM=, api error InvalidPart: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag.
Repository URL
No response
Workflow run URL
No response
YAML workflow
- name: Build and push
id: docker-build
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDKIT_INLINE_CACHE=1
cache-to: |
type=s3,region=eu-central-1,bucket=buildcache-bucket,prefix=${{ inputs.service_name }}-${{ matrix.environment }}-,mode=inline
cache-from: |
type=s3,region=eu-central-1,bucket=buildcache-bucket,prefix=${{ inputs.service_name }}-${{ matrix.environment }}-,mode=max
Workflow logs
No response
BuildKit logs
Run docker/setup-buildx-action@v3
Docker info
Buildx version
Inspecting default docker context
Creating a new builder instance
Booting builder
Inspect builder
BuildKit version
builder-f734ec54-95b6-4b56-a6cb-08700025305f0: v0.25.1
Additional info
No response
We are also experiencing this, and have no clue yet why.
Related: https://github.com/moby/buildkit/issues/6357
+1 we are also experiencing this issue
+1
I'm able workaround by pinging the buildkit version like this:
runs:
steps:
...
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=moby/buildkit:v0.25.1
- name: Build python image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
...
Same here. We've temporarily disabled cache to unblock builds, but that isn't a long-term solution.
Same here.
+1
+1
We have same issue that just happening today. It was never an issue before. We are using version 0.22.0. After getting this S3 cache error, we tried to upgrade to latest version 0.30.1, but still face the same issue. I have no idea what trigger this issue. It was working all this while without upgrading our buildx or docker client.
We have 2 workaround for temporary solution, is either we disable cache to s3 or we switch to registry cache. We went for the 2nd option for now using registry cache type instead of s3. But we are very interested to know what cause this issue. Is there any changes in AWS S3 protocol ?
error writing layer blob: upload multipart failed, upload id:.QH8IUUGaFShEXzhDWPeOJVqH2OBQMZRhQg--, cause: operation error S3: CompleteMultipartUpload, https response error StatusCode: 400, RequestID: FY4PW3A8H550BCT0, HostID: xxxxxxxxxx5uJI=, api error InvalidPart: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag.
Can someone try with this BuildKit image crazymax/buildkit:s3patch and report back to us? Thx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=crazymax/buildkit:s3patch
See https://github.com/moby/buildkit/pull/6373 for more info
I can confirm this fixes it for us!
Why this is closed? I still have the issues without the custom driver.
Why this is closed? I still have the issues without the custom driver.
That's because the linked PR got merged on BuildKit repo. We are doing a BuildKit patch release today.
Thank you. Do we have the eta for the release?
Seems that it was cherry picked https://github.com/moby/buildkit/pull/6373 to v0.26.2
can we remove driver-opts: image=moby/buildkit:v0.25.1 now ?
can we remove
driver-opts: image=moby/buildkit:v0.25.1now ?
Yes, stable image has been updated to v0.26.2