fix: detect image pull errors from Docker progress stream#24
Closed
liliwilson wants to merge 1 commit intomainfrom
Closed
fix: detect image pull errors from Docker progress stream#24liliwilson wants to merge 1 commit intomainfrom
liliwilson wants to merge 1 commit intomainfrom
Conversation
Previously, pullImage discarded the Docker pull progress stream with io.Discard and only checked for IO errors. Docker reports many pull failures (rate limits, auth errors, image-not-found for specific platforms) as JSON messages within the progress stream, not as the initial error return. This caused silent pull failures followed by a confusing 'No such image' error from ContainerCreate. Now we decode each JSON message in the stream and surface any error immediately with a clear message. Co-Authored-By: Warp <agent@warp.dev>
Author
|
warpy eagerly made this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running a self-hosted worker, tasks fail with a confusing error:
The image exists on Docker Hub, so the error is misleading.
Root Cause
pullImagediscards the Docker pull progress stream withio.Copy(io.Discard, reader)and only checks for IO-level read errors. Docker'sImagePullAPI reports many pull failures — rate limits, auth errors, image-not-found for specific platforms — as JSON messages within the progress stream, not as the initial error return.When one of these failures occurs,
pullImagesilently swallows the error, thenContainerCreatefails because the image was never actually pulled.Fix
Decode each JSON message from the pull progress stream and check for the
errorfield. If a pull error is detected, return it immediately with a clear message like:This surfaces the real failure (e.g., rate limiting, missing platform variant, auth issue) instead of the downstream "No such image" error.
This PR was generated with Warp.