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

How to rollback in case of catastrophic error? #90

Closed
COLABORATI opened this issue Jul 8, 2017 · 13 comments
Closed

How to rollback in case of catastrophic error? #90

COLABORATI opened this issue Jul 8, 2017 · 13 comments

Comments

@COLABORATI
Copy link

Well the title says it all - how to roll back in case an updated container breaks?

@franciscoed
Copy link

Sounds good. Any news about it?

@simskij
Copy link
Member

simskij commented Apr 7, 2019

That is not something watchtower currently aims to solve. I do like the idea however. Do you have any suggestions on how this would work?

@simskij
Copy link
Member

simskij commented Apr 13, 2019

Closing due to lack of response.

@simskij simskij closed this as completed Apr 13, 2019
@iamareebjamal
Copy link

I think if the docker container fails to start/restart within a set period of time or its HEALTHCHECK fails, watchtower could rollback to previous version of the container?

@dankozlowski
Copy link

This seems like an essential idea. Has there been any progress on this note?

@piksel
Copy link
Member

piksel commented May 4, 2023

No, there isn't anything like a "rollback" that watchtower can perform, even if it wanted to. In theory, it could hold on to the previous image and try to recreate the container with that image, but the most common reason for an update to fail is that the container uses something that watchtower doesn't understand. In such a case, recreating the container using the old image is unlikely to fare any better.

@maxime1992
Copy link

but the most common reason for an update to fail is that the container uses something that watchtower doesn't understand. In such a case, recreating the container using the old image is unlikely to fare any better.

Personally that's not what I'm after. I'd like to be able to rollback to previous versions for example not only if something crashes but mainly if I notice that something has a regression (but the container is still working ok).

On Watchtower side, I'm guessing this would mean:

  • Use docker inspect to be aware of a version of a given container
  • Save this in a database
  • Have a UI that shows the list of all the different versions that have been used in the past
  • If someone wants to rollback, specify the older version to create the image

This seems like an essential idea

Agreed. It's the primary reason I'm not using watchtower even though I was very interested in it initially (and still am). But with automatic upgrade, I need super easy rollback capabilities built in.

@gingerbeardman
Copy link

I'd also like this, I say this as watchtower upgraded to a latest that is broken/untested on my hardware setup.

@piksel
Copy link
Member

piksel commented May 21, 2023

Use docker inspect to be aware of a version of a given container
Save this in a database
Have a UI that shows the list of all the different versions that have been used in the past
If someone wants to rollback, specify the older version to create the image

None of this is compatible with how watchtower is structured today, it's stateless and UI-less (except for the CLI args/Env vars, but those are one-way). It could be done, but it would be a great effort (and perhaps alter the role of watchtower, which other users might not be be happy about), but the main problem is simply that no one is doing it. Watchtower is a community project and we are merely maintainers.

@meonkeys
Copy link

meonkeys commented Sep 2, 2023

Another issue: what if an upgrade caused a database migration, and that container's database code doesn't support rollback / downgrade?

@gingerbeardman
Copy link

That issue would be on the container, not watchtower.

@meonkeys
Copy link

meonkeys commented Sep 3, 2023

I agree, but it seems likely that watchtower would be blamed when a rollback fails. "Blame" isn't a great word here, I'm just not sure how common it is for containers to support rolling back to older images. Surely stateless/simple images would be fine.

Maybe it's just another case where a non-rollback-able container would need to be excluded from automated watchtower upgrades... but that means more hands-on sysadmin, communication, and research into which containers will be fine and which ones won't, and I use watchtower specifically to keep containers up to date with less manual work. 🤷

@gingerbeardman
Copy link

You're over thinking this IMHO

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

No branches or pull requests

9 participants