Plex in Docker won't start

Server Version#: I think 1.40.5.8921-836b34c27

Hi, over the past week or so I’ve been having problems with my Plex server falling over and refusing to play content. My first troubleshooting steps were to run a docker ps which showed the container as unhealthy. docker stop plex would not work, so I had to reboot the server.

Today, I can’t get the Plex container to start in a healthy state at all. I’ve tried:

docker-compose down
docker-compose up -d --force-recreate

and then docker logs plex which shows:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 40-plex-first-run: executing...
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: executing...
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: exited 0.
[cont-init.d] 50-plex-update: executing...
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting Plex Media Server.
[services.d] done.
Critical: libusb_init failed

I’ve tried running GitHub - ChuckPa/PlexDBRepair: Database repair utility for Plex Media Server databases within the container, which reports that the two databases are ok.

Please could someone suggest next steps?

Having checked the database backups, there are copies from 2024/08/30, 2024/09/02 and 2024/09/05 but 1) the above tool reports them as ok, and 2) I’m not sure if any of these pre-date the updated docker image which was released ~8 days ago. I can’t recall exactly when I pulled the latest and upgraded.

Thank you.

Possibly related case: Plex not starting after power outage

I ran a database repair based on the other post I found.

Within the container:

apt update
apt install wget
wget https://github.com/ChuckPa/PlexDBRepair/archive/refs/tags/v1.07.00.tar.gz
mv v1.07.00.tar.gz PlexDBRepair-1.07.00.tar.gz
tar xf PlexDBRepair-1.07.00.tar.gz
cd PlexDBRepair-1.07.00
chmod +x DBRepair.sh
./DBRepair.sh

Stop PMS, then repair:

Exporting current databases using timestamp: 2024-09-05_15.33.29
Exporting Main DB
Exporting Blobs DB
Successfully exported the main and blobs databases.
Start importing into new databases.
Importing Main DB.
Importing Blobs DB.
Successfully imported databases.
Verifying databases integrity after importing.
Verification complete.  PMS main database is OK.
Verification complete.  PMS blobs database is OK.
Saving current databases with '-BACKUP-2024-09-05_15.33.29'
Making repaired databases active
Repair complete. Please check your library settings and contents for completeness.
Recommend:  Scan Files and Refresh all metadata for each library section.

I also chose 6 to reindex the main db.

Content plays ok now but the container remains unhealthy. Edit: I’ve found the healthcheck definition in the compose file: "netstat -ntlp | grep :32400 && mountpoint /Media" - and the error here is there’s no longer a /Media mount so this will be why it’s showing unhealthy! A legacy folder, I think.

Though I can’t explain why:

  1. Content fails to play periodically starting over the last week. Interestingly, in the Plex client on Google Chromecast with Google TV, I can see when this is going to happen before attempting to stream because it stops showing the video resolution/audio codecs on the page.
  2. The errors from docker logs plex re: Critical: libusb_init failed

You can search that error in these forums and it shouldn’t matter unless you are using a USB TV tuner. My two servers throw the same error and run fine.

Did you check your docker compose file, remove the mount and recheck the health status?

Thanks for the reply. Removing the legacy mount brought the container up as healthy, but I decided to leave it a few days to see how it went. At some point between last night and today, streaming broke.

I’ve tracked down the issue that caused it overnight though.

The docker container runs on an Ubuntu VM, which uses rclone to mount an SMB share hosted on a Windows 10 VM. The mount was up, but the log file was full of entries like this:

2024/09/08 16:14:21 ERROR : IO error: couldn't connect SMB: response error: No more connections can be made to this remote computer at this time because the computer has already accepted the maximum number of connections.

For some unknown reason, there were 20 open SMB sessions on the Windows machine, all for a single season of a children’s show that a friend had been streaming one after the other. It seems like something wasn’t closing the session(s). 20 is the max on Windows 10 (maybe that’s a sign I should move to something else…). I cleared them and streaming was available once again. Annoyingly I didn’t check if they still had open files though. Perhaps this has been the culprit over the previous weeks.

Testing just now and opening a single file from the Plex for Windows application, it results in 3 open SMB sessions initially (but only 1 with 1 open file), before eventually dropping to just 1 session. Ending the stream, and the session is closed. Odd.

I’ll adjust the local security policy to disconnect idle SMB connections after 20 minutes and see if that helps.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.