Repository navigation
Raise errors reported in the stream from ImageCollection.pull - #3453
Open
thirtyseven wants to merge 1 commit into
Open
thirtyseven wants to merge 1 commit into
thirtyseven wants to merge 1 commit into
Conversation
The daemon reports a failed pull inside the 200 response's JSON stream, not as an HTTP error. ImageCollection.pull drained that stream without reading it, then looked the image up, so every such failure (a registry refusal, a corrupted layer extraction) surfaced as ImageNotFound for an image that does exist upstream. ContainerCollection.run falls back to pull, so it hid the cause the same way. Decode the stream and raise ImagePullError with the daemon's message, mirroring how ImageCollection.load raises ImageLoadError. Signed-off-by: Ted Kaplan <ted.kaplan@bedrockrobotics.com>
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.
The daemon reports a failed pull inside the HTTP 200 response's JSON stream.
ImageCollection.pulldrains that stream without reading it and then inspects the image, so any failure after the request is accepted (a registry refusal, a failed layer extraction) surfaces asImageNotFoundfor an image that exists.ContainerCollection.runfalls back topulland hides the cause the same way. Libraries built on it, such as testcontainers-python, inherit the misleading error.This decodes the stream and raises a new
ImagePullErrorwith the daemon's message, the same wayImageCollection.loadraisesImageLoadError.Before and after, pulling while a concurrent
docker image prunecorrupts the pull (moby/moby#53321):Callers that caught
ImageNotFoundaround a failed pull will now seeImagePullError. Unit tests cover anerrorDetailframe and a bareerrorframe.🤖 Generated with Claude Code