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
Add ability to handle registry downtimes via a 503 HTTP error code #9120
Comments
Is this registry.hub or registry? Now, this is confusing :-) |
@dmp42 I think it should work for either. |
registry never ever goes down :-) |
I’m working on #2 currently, but without the message component. Basically says, “your registry appears to be down” when encountering any 5xx code. Is that a workable solution for now, or do you require the message as well?
|
+1 |
@erikh It would be nice to have the message as well, so that we can give you more then the generic message. For example "We are down for routine maintenance, be back in 5 minutes". Maybe default to the generic message if there isn't one in the body of the reply? |
I think that mentioning the status page in the message would be a nice addition; http://status.docker.com |
I’ve interpreted that this has less to do with the hub, and more to do with registries, which may be private. -Erik
|
Ah, yes. Visiting that page won't be very informative for your private registry :) |
Ideally, if the message was just pulled from the response from the server, then the registry sending the 503 can put what ever it wants for a message. On the hub, we could link to status.docker.com, and when it is a private registry, they could point to what ever they want. But I don't think putting the status.docker.com address in there by default is a good idea. Lets keep it as generic and simple as possible so it works for all cases. |
I'm thinking;
|
Let's make this actionable: when docker gets a 50x error code from a v2 registry, it needs to output the (body) message to the user. |
Related - but I would keep both. |
Relatedly, we're looking for a similar feature for EOL tags on official images so we can inform users that that image is no longer supported and no long receives security updates. |
I think the key thing to take out of this, is that it would be nice to be able to display the message to the client if it isn't an expected status code (200, 201, etc) |
FWIW, having a similar issue with a new feature we want to enable on the Hub with server-side error messages. HTTP status other than 200 will result in an error message akin to |
@jfrazelle How about this solution. If there is a status code that is higher then 400, then look to see if it is a JSON response, and if so, take the "message" value and display that to the user. If neither JSON, or a message attribute in the JSON, then display what ever you do now. It is important to note, that there might be other attributes besides the message, but feel free to ignore the other attributes. Example are some example messages
|
I see no problem with this as long as it's okay with registry folks :) also ping @crosbymichael |
IIRC, the new registry will return more structure errors (ie, a "code" and a "descriptive text"). Would be nice to take the same approach here? |
Do we need anything more complicated than a 503 status with a If a 503 is encountered, just display something like this:
I don't see any reason for implementing a more complex protocol. It just doesn't provide enough benefit for the amount of time required. This is already in the V2 specification: https://github.com/docker/distribution/blob/master/doc/spec/api.md#errors-1. |
@stevvooe but for depreciating images we need something |
@stevvoe agreed it doesn't need to be complicated. My response was to the example, and my concern was introducing something new that would differ from the V2 response. If V2 returns just a header, that's fine with me :) |
@stevvooe yes, sorry, I keep doing that.. argh. |
writing this patch tonight sorry got sidetracked should be simple |
Maybe I am confused but I went to implement and it looks like we already have this https://github.com/docker/docker/blob/master/utils/utils.go#L256 and it is called serveral times in |
which gets the body anyways https://github.com/docker/docker/blob/master/registry/session.go#L288 so are we looking for something on top of that, because if hub now sends something in the body it will show up in the response |
This is not simple, and requires understanding v1/v2 and describing precisely what the expected behavior should be. |
Cool sounds great thanks On Sunday, March 22, 2015, Olivier Gambier notifications@github.com wrote:
|
@aaronlehmann @stevvooe is this still need to be done? |
@LK4D4 I'd be surprised that this doesn't work. We already have error codes that can propagate to client. Is there anything else we need to do? |
This is supported in the registry with a health check. 503 and a descriptive error are returned, but the daemon. A
a
|
Right now if the registry wants to have a scheduled downtime for routine maintenance there isn't a good way to notify someone using the docker engine. Two things we can do to make this better.
1 is less important, but I figured if we are going to talk about this, lets see what the best possible solution would be, and strive for that.
Open for other suggestions on how to make this better.
The text was updated successfully, but these errors were encountered: