Conversation
`Docker Integrations` fails about once in a hundred job-runs with
Error: pull ping error: pull ping response: rpc error: code = Unknown desc =
image pull: command failed: docker pull 127.0.0.1:PORT/sess-ID/pullping:img-0
and the cause two hundred lines earlier, inside an escaped buildkitd log line:
failed to copy: httpReadSeeker: failed open: failed to do request:
Get "https://127.0.0.1:PORT/v2/sess-ID/pullping/blobs/sha256:...": EOF
A bare EOF with no status, on loopback, for a blob of an image buildkitd has
just published to its own session registry. That is a server closing an idle
keep-alive connection under a client about to reuse it, not an answer about the
image. `dockerPullLocalImage` pulled once and gave up.
Three attempts, 150ms then 300ms. Measured across four consecutive CI runs the
fault appears in 1 of 96 job-runs, so a single retry removes almost all of it and
the second is for the tail.
Every error is retried rather than a matched subset, deliberately: the ref names
an image that exists on a registry this process reaches over loopback, so there
is no permanent failure worth failing fast on, and classifying would mean
matching text in a subprocess's stderr - making this depend on the wording of
another program's messages.
This is the client half of the race. The server half is buildkit's session
registry, which would want its idle timeout raised above the client's; that
needs the fork and is not attempted here.
Tested against a frontend that fails the first pull with the error CI produced:
one failure is retried and tags exactly once, and a pull that never works still
fails with the transport error intact rather than "tried three times".
Assisted-by: Claude:claude-opus-5 claude-code
➖ Are we earthbuild yet?No change in "earthly" occurrences 📈 Overall Progress
Keep up the great work migrating from Earthly to Earthbuild! 🚀 💡 Tips for finding more occurrencesRun locally to see detailed breakdown: ./.github/scripts/count-earthly.shNote that the goal is not to reach 0. |
Here's the analysis by Gemini 3.8 Flash.Investigation: Flaky
|
|
Ah yes, my agents have stumbled upon the same a few different times. I think most comprehensive was when I sent fable at a full review of our buildkitd fork, highlighted the same points as Janis. Full review here so I don't lose it: |
|
Created #912 to track the symptom. I'll have a look at the backend fix as well. I have a scenario that reproduces this pretty reliably that I can test with at o8t. |
|
Raised EarthBuild/buildkit#24 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughLocal Docker image pulls now retry failed pulls up to three times with increasing delays. Context cancellation interrupts delays. Tests cover transient recovery and persistent failure behavior. ChangesDocker pull retry
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Unblocks: 1 PR Merge Risk: ⚪ Minimal · up to Local registry pull failures now receive bounded retries without leaving an actionable correctness or availability risk in the changed flow. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
janishorsts
left a comment
There was a problem hiding this comment.
🐑 it!
Combined with @kmannislands's stacked PR, this should be fixed.
Docker Integrationsfails intermittently on a pull that has nothing wrong with it.The failure
The surfaced error names the mechanism:
The cause is two hundred lines earlier, inside an escaped buildkitd log line:
A bare
EOF, no status, on loopback, for a blob of an image buildkitd has just published to itsown session registry. That is a server closing an idle keep-alive connection under a client about
to reuse it — not an answer about the image.
dockerPullLocalImagepulled once and gave up.How often
Counted across four consecutive CI runs on
giles-post-buildkit-engine:About 1% per job-run — rare enough that a green run proves nothing, common enough to fail a build
a few times a month. That is the band where a fault gets rediagnosed rather than recognised.
The change
Three attempts, 150ms then 300ms.
Every error is retried rather than a matched subset, deliberately. The ref names an image that
exists, on a registry this process reaches over loopback, so there is no permanent failure worth
failing fast on — and classifying would mean matching text in a subprocess's stderr, making this
code depend on the wording of another program's messages.
What this does not fix
This is the client half of the race. The server half is buildkit's session registry
(
moby/buildkit/session/pullping), which wants its idle timeout above the client's — that needsthe fork and is not attempted here.
The error also still surfaces as the mechanism rather than the cause. Worth fixing separately:
dockerPullLocalImageshould include the frontend's stderr in its wrap.Testing
Against a frontend that fails the first pull with the error CI produced: one failure is retried and
tags exactly once, and a pull that never works still fails with the transport error intact rather
than "tried three times".
At 1 in 96 a green CI run is not evidence either way, which is why the test drives the failure
directly.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PQ2c9xLfQvSY8YGLr7o5tv
Summary by CodeRabbit