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

Plugin run does not fail on returned docker error #167

Closed
timkral opened this issue May 15, 2015 · 0 comments
Closed

Plugin run does not fail on returned docker error #167

timkral opened this issue May 15, 2015 · 0 comments

Comments

@timkral
Copy link
Contributor

timkral commented May 15, 2015

I mistakenly attempted a docker:push for a non-existent image and I noticed that my build did not fail (even though the docker logs showed an error):

[INFO] DOCKER> ... The push refers to a repository [yespath/motor] (len: 0)
14-May-2015 16:04:10    [ERROR] DOCKER> No such id: yespath/motor
14-May-2015 16:04:10    [INFO] DOCKER> ... The push refers to a repository [yespath/motor] (len: 1)
14-May-2015 16:04:10    [ERROR] DOCKER> No such id: yespath/motor
14-May-2015 16:04:10    [INFO] DOCKER> ... The push refers to a repository [yespath/motor] (len: 1)
14-May-2015 16:04:10    [ERROR] DOCKER> No such id: yespath/motor
14-May-2015 16:04:10    [INFO] DOCKER> ... The push refers to a repository [yespath/motor] (len: 1)
14-May-2015 16:04:10    [ERROR] DOCKER> No such id: yespath/motor
14-May-2015 16:04:10    [INFO] ------------------------------------------------------------------------
14-May-2015 16:04:10    [INFO] BUILD SUCCESS
14-May-2015 16:04:10    [INFO] ------------------------------------------------------------------------
14-May-2015 16:04:10    [INFO] Total time: 22.127 s
14-May-2015 16:04:10    [INFO] Finished at: 2015-05-14T23:04:10+00:00
14-May-2015 16:04:11    [INFO] Final Memory: 16M/185M
14-May-2015 16:04:11    [INFO] ------------------------------------------------------------------------
14-May-2015 16:04:11    Finished task 'Docker deploy' with result: Success

I tried testing the docker remote API directly (both v1.14 and v1.17) and I noticed that it returns a 200 status code in this case:

curl -v -X POST -L --post301 -H "X-Registry-Auth : XXXX" http://localhost:4243/images/doesnotexist/push* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 4243 (#0)
> POST /images/doesnotexist/push HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:4243
> Accept: */*
> X-Registry-Auth : XXXX
> 
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Thu, 14 May 2015 23:43:30 GMT
< Transfer-Encoding: chunked
< 
{"status":"The push refers to a repository [doesnotexist] (len: 0)"}
{"errorDetail":{"message":"could not find image: no such id: doesnotexist"},"error":"could not find image: no such id: doesnotexist"}

So it seems that simply examining the response status code is not sufficient to determine if the request was successful or not.

For what it's worth, I think this is kind of a poor API contract. But still, it's disconcerting to see docker errors and a successful build.

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