Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker::Image.create raises 404 when there is not enough disk space #554

Open
ilr39 opened this issue Feb 12, 2020 · 0 comments
Open

Docker::Image.create raises 404 when there is not enough disk space #554

ilr39 opened this issue Feb 12, 2020 · 0 comments

Comments

@ilr39
Copy link

ilr39 commented Feb 12, 2020

The Image.create method performs a POST request to the /images/create API and then queries the images//json API for the requested image.
The /images/create endpoint is problematic(as explained here).
In cases when there is not enough disk space to save the requests image to disk, the API will return 200 and will start streaming the downloading process status as an HTTP response with Transfer-Encoding: chunked. The only way to know the operation failed for this reason is to check for the specific string error message in the response content.

Querying the images//json API after that will return a 404 which is misleading as the underlying root problem is that there is not enough disk space and not anything related to the image missing from the docker registry.

The Excon client does handle the chunked response that returns from /images/create well, so a suggested solution could be saving the response that returns from the POST:
response = conn.post( '/images/create', opts, :headers => headers, :response_block => response_block(body, &block) )
And then check something like:
response.body().include? "no space left on device"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant