-
Notifications
You must be signed in to change notification settings - Fork 908
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
container is removed if a new image is found but download has failed #1385
Comments
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏 |
It happened again today ending with a crash of watchtower so I didnt get the notification but 3 or 4 running containers have been removed. Can it be because I have 45 containers running watchtower needs to check ? Sorry to spam this thread but it's really annoying - today I lost bookstack, ghost, and 2 piwigo... Anyway thanks for this great tool it works flawlessly most of the time ! 😃 |
Really similar issue here. In my case, downloaded images are occasionally pruned before the container is re-created which leads to existing containers being deleted but no new ones being created. Obviously that increases maintenance significantly for a tool which I use to reduce it. Would love if watchtower re-started the existing container and just logged an error in this case. |
@eskiiom if watchtower crashed there is something else going on, do you have the log for the crash? (probably belongs in a new issue though) |
@0x1a8510f2 Don't use |
This actually mainly happens when I log onto portainer panel while watchtower is doing an update and see images marked as unused. I'd delete them, only to realise that watchtower is still doing its thing and my containers are now gone. The scheduled prune would be equivalent right? So it shouldn't make a difference, unless I make it run at times watchtower isn't running, but that's not really a solution to the general problem of "if something goes wrong during the update, the containers are deleted permanently". |
I don't really understand why this would even happen, since docker pulls images if they don't exist locally. Perhaps it's just really bad timing? |
Yeah, it was bad timing essentially. In my case, only the new image was removed because only that was marked as unused, but I imagine both being removed is also possible. Since docker doesn't natively support recreating a container, I assume watchtower stores some description of the container in between deleting the old one and creating the new one? One option could be to write this description somewhere in the filesystem and log an error so the container can easily be re-created, but this would make the watchtower container stateful which isn't ideal obviously. Maybe logging the description in the form of a docker run command would work? Something like:
|
Hello and really sorry for the delay
I have since paused the watchtower container on this host. |
@eskiiom The crash is due to a bug fixed in #1220 (not released in :latest), combined with something else fishy going on (the reason for the image not being available). |
Hello everyone
I saw many closed issues on the same topic, mostly related to synology, which is not my case.
Also, most of these issues where closed with PR implemented, so I don't know if this is a know issue at the moment or not.
I am using the latest watchtower version
Describe the bug
It happened a couple of times already, on various images, so I believe the issue comes from my local network or ISP, but what happened is the following :
Found new owncloud/server:latest image (eeee478cb601) Found new homeassistant/home-assistant:latest image (203c7de4397c) Found new reallibrephotos/librephotos-frontend:dev image (f809549e4bc2) Stopping /librephotos-docker_frontend_1 (c33e994f9829) with SIGTERM Stopping /Homeassistant (8559d67e5658) with SIGTERM Stopping /Owncloud (3fbaf324eeb6) with SIGTERM Creating /Owncloud Error response from daemon: No such image: owncloud/server:latest Creating /Homeassistant Error response from daemon: No such image: homeassistant/home-assistant:latest Creating /librephotos-docker_frontend_1 Error response from daemon: No such image: reallibrephotos/librephotos-frontend:dev
To Reproduce
Try to update an image but pull the network plug when image is being downloaded.
New image found, but download fails, affected container is then deleted.
Expected behavior
I would like anything else but my containers removed.
So different options would be for example to recreate the container from the new image if and only is the download is successful
Even better would be to retry/resume the download when it has failed.
I would rather have an up and running container with a 1+ day old image, instead of recent download attempt which ends in container to disappear. A notification would be sufficient.
Screenshots

Environment
Logs from running watchtower with the
--debug
optionAdditional context
Sorry if I missed an important information on this issue, I looked but could not find
The text was updated successfully, but these errors were encountered: