docker-py icon indicating copy to clipboard operation
docker-py copied to clipboard

client.images.push doesnt raise exception

Open obiii opened this issue 2 years ago • 5 comments

Hi,

We are using client.images.push to push docker images to Azure ACR. We are facing an internal authorization issue, but expected the API to raise an exception but it does not. It returns the generator str but raising an exception would be optimal here.

obiii avatar Jul 20 '23 16:07 obiii

I came here to report exactly the same thing. This is kind of a big deal because it results in silent failures.

odoublewen avatar May 15 '24 21:05 odoublewen

@milas What do you think?

Khushiyant avatar Jun 14 '24 14:06 Khushiyant

Also using this API and was surprised that our CI pipeline showed up as green even if the push failed. Turns out this issue is the reason. When attaching a debugger it looked like the HTTP status code was 200. Using AWS ECR. The docker cli returned a non-zero exit code (2) for the same push call.

markokristian avatar Feb 18 '25 13:02 markokristian

I was also experiencing the same thing with the following code. If I print the response, I will see the error but the try/catch statement won't detect it.

Image

ltanji01 avatar Feb 25 '25 15:02 ltanji01

Engine API doesn't raise error but return JSON with errorDetail and progressDetail [See here]

I am working on PR for this issue and will link soon so, at least a exception is raised in case of failure

Khushiyant avatar Mar 19 '25 07:03 Khushiyant