Ideas Docker container autorestart

Status
Not open for further replies.

freeloader

Blitz 2nd Class
Original poster
38
8
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?
 

Datamonkeh

Data Hoarding Primate
Staff
Donor
592
252
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.
 

freeloader

Blitz 2nd Class
Original poster
38
8
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?
 

Admin9705

Administrator
Project Manager
5,448
1,855
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.
 

freeloader

Blitz 2nd Class
Original poster
38
8
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.
 

freeloader

Blitz 2nd Class
Original poster
38
8
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.
 
  • Like
Reactions: Admin9705
Status
Not open for further replies.

Similar threads