What's new

Register Now! Find useful tips, Interact /w Community Members and join the part the Best Community on the Internet!

Discussion Docker container autorestart

Not open for further replies.


Full Member
I've had a few problems with Plex (long story short, I probably tried to download and import too many movies at the same time) and the Plex docker container crashes once in a while with the error message "Sqlite3: Sleeping for 200ms to retry busy DB."

I was a bit surprised to see that the docker container just reported as "stopped" in Portainer. I would expect that it was started with the flag "autorestart".

Is there a specific reason why docker containers are not started with the autorestart flag, or is something you could implement in a future version?


Data Hoarding Primate
Hit refresh in the dashboard and marvel at the change in status - no restart required. Also given some of the library sizes here, it's very unlikely that you imported too many files at once.


Full Member
So you're saying that the containers have a restart policy activated and that I just needed to wait a little longer for the container to auto restart again after a crash?


Project Manager
They all start up when loaded. Plex takes awhile and provided a misleading status. If you need to restart containers at certain times, you can create a script and then a Cron job can run. For us to do this makes no sense.


Full Member
Perhaps I should clarify a bit: the containers start up fine when Plex is loaded or the server is rebooted. I have no issue there.

The problem is that the docker container sometimes stops or crashes (this can happen from time to time). I noticed that I need to manually restart the container in Portainer to get it back to work in that case.

Docker provides for an option to set a "restart policy" however, it allows you to define when a docker container should automatically restart (see: https://docs.docker.com/config/containers/start-containers-automatically/#use-a-restart-policy). If you set each container's restart policy to 'unless-stopped' for example, it will always try to restart your containers upon a crash.


Full Member
Update: I noticed all containers are started with "restart_policy: unless-stopped", so I guess I just caught my app in portainer right before the autostart would kick in. Can be closed, it's already part of the ecosystem.
Not open for further replies.

Similar threads

Development Donations


Top NZB NewsGroups!

Members - Up To a 58% Discount!


Online statistics

Members online
Guests online
Total visitors