buildx "failed to receive status: rpc error ... transport is closing" in CI
buildx talks to the BuildKit daemon over gRPC. "transport is closing" means that connection was severed while the build was running, often because the BuildKit container was killed, ran out of memory, or the runner was preempted.
What this error means
A build fails partway with "failed to receive status: rpc error: code = Unavailable desc = transport is closing". The build had been progressing before the drop.
ERROR: failed to receive status: rpc error: code = Unavailable desc = transport is closingCommon causes
The BuildKit daemon was killed or OOM-ed
A memory-heavy build can push the buildkitd container past its limit; the kernel kills it and the gRPC stream closes.
The runner or builder was preempted mid-build
A spot or ephemeral runner reclaimed during the build tears down the BuildKit connection abruptly.
How to fix it
Recreate the builder and retry
- Remove and recreate the buildx builder so a fresh buildkitd starts.
- Re-run the build; a transient daemon drop usually does not recur.
- If it repeats, look at memory usage during the build.
docker buildx rm mybuilder || true
docker buildx create --name mybuilder --use
docker buildx inspect --bootstrapReduce build memory pressure
Lower parallelism or split heavy stages so buildkitd does not get OOM-killed.
docker buildx build --build-arg MAKEFLAGS=-j2 .How to prevent it
- Give the BuildKit container enough memory for heavy builds.
- Limit build parallelism on constrained runners.
- Retry transient daemon drops rather than treating them as build errors.