pass store is uninitialized
errors causing failed builds and broken layers with DOCKER_BUILDKIT=1 builds
#39440
Labels
Description
We use multi-stage docker builds with multiple targets and
DOCKER_BUILDKIT=1
to produce faster builds and only build the required layers necessary for the target.We observe some kind of race condition between parallel image pulls at the start of the buildkit build that has three possible bad outcomes we have observed
pass store is uninitialized
In all cases, if you look at the buildkit log you will see one of the load metadata steps has an error
Usually the build has continued despite this error on an earlier step.
The failures are sporadic, and appear to be some kind of race condition between parallel load metadata steps, which are happening at the same time. The failed step has usually taken ~500-1000ms before getting the error above.
Steps to reproduce the issue:
Unclear exactly how to reproduce the issue deterministically, however appears to involve
pass
installed on the Linux machine that you are using so thatdocker-credentials-pass
is in actiondocker build
. The more parallelload metadata
steps buildkit is able to do, the more likely to seems to be to experience a failure.export DOCKER_BUILDKIT=1
docker build
Describe the results you received:
Sometimes images are just corrupt. Other times docker build will fail with an error implying something is missing from an earlier layer that is required by a later layer.
Here is an example of such a failed build (case 1 in my failure modes listed above). Note the error in step #4 which then causes failure in #7 because a file from the JDK layer is not able to be appended to.
The Dockerfile that produced the above error is
Describe the results you expected:
Builds to succeed without building corrupted images.
Additional information you deem important (e.g. issue happens only occasionally):
Only appears occasionally, but reasonably frequently for us (maybe 1 in 20 builds?).
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
AWS instances
The text was updated successfully, but these errors were encountered: