A Docker build using cache-to: type=gha could not export layers to the Actions cache. Most often this is a transient cache-service error; sometimes a missing scope makes entries collide or evict.
What this error means
The build-push step warns or errors while exporting the gha cache, often with a 4xx/5xx from the cache service. The image still builds, but cache export is unreliable across runs.
Actions log
ERROR: failed to solve: failed to compute cache key: failed to copy:
httpReadSeeker: failed open: unexpected status code ... 400 (transient)
Common causes
Transient Actions cache service error
The type=gha backend uploads layers to the same cache service that backs actions/cache. A brief 4xx/5xx during export fails the cache-to step through no fault of the build.
Missing or colliding cache scope
Without a scope, multiple workflows can contend for the same gha cache entries, causing evictions and inconsistent exports.
Add a scope keyed on the workflow so jobs do not evict each other.
Re-run when the export fails with a transient cache-service status code.
Use mode=max to cache intermediate layers for better hit rates.
How to prevent it
Scope type=gha cache per workflow to avoid cross-job eviction.
Use mode=max for fuller layer caching.
Treat cache-service 4xx/5xx during export as retryable.
Frequently asked questions
What causes "buildx gha cache"?
The type=gha backend uploads layers to the same cache service that backs actions/cache. A brief 4xx/5xx during export fails the cache-to step through no fault of the build.
How do I fix buildx gha cache?
Scope the gha cache and use mode=max
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.