Discussion - Docker container autorestart | PlexGuide.com

Discussion Docker container autorestart

  • Stop using Chrome! Download the Brave Browser via >>> [Brave.com]
    It's a forked version of Chrome with native ad-blockers and Google's spyware stripped out! Download for Mac, Windows, Android, and Linux!
Welcome to the PlexGuide.com
Serving the Community since 2016!
Register Now
Status
Not open for further replies.

freeloader

Active
Original poster
Mar 29, 2019
47
16
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
Project Manager
Donor
Donor
Jan 20, 2018
832
384
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

Active
Original poster
Mar 29, 2019
47
16
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
Donor
Jan 17, 2018
5,156
2,112
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

Active
Original poster
Mar 29, 2019
47
16
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.
 

Admin9705

Administrator
Project Manager
Donor
Jan 17, 2018
5,156
2,112
makes sense, i can look into it
 
  • Like
Reactions: 1 user

freeloader

Active
Original poster
Mar 29, 2019
47
16
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: 1 user
Status
Not open for further replies.

Recommend NewsGroups

      Up To a 58% Discount!

Trending