Plex Server Crashing, when scanning new series. Getting frustrated!

Server Version#: Version 1.20.4.3517
Player Version#: Version 1.22.0.1421-be6a7c42

Might be posting the wrong section??

I’ve been having this problem for a few weeks now, I think.
Almost everytime I import new series, my Plex server just refuses to let anyone in.

I can see with “sudo service plexmediaserver status” that’s running - but it’s saying things like:
“sql: Waiting for busy DB…”
and then
“Connection to x.x.x.x (ip) refused” everytime I try to connect to the server
Don’t have the exact logs for it, and I can’t seem to dust the errors up in the logs, after I restart the server.

I attached logs to this post.
Edit: Removed logs

I tried repairing the database using the plex tutorial on this site. Went okay, but the crashes still happen. Mostly when scanning new TV Series. Doesn’t happen when scanning movies. Usually it happens when it has to scan / import a lot of episodes.

Just crashed again
“Nov 08 19:40:55 >> Plex Media Server[2444]: Connection to x.x.x.x.x closed by remote host.”

Nov 08 19:26:06 Engels systemd[1]: Started Plex Media Server.
Nov 08 19:33:30 Engels Plex Media Server[2264]: Dolby, Dolby Digital, Dolby Digital Plus, Dolby TrueHD and the double D symbol are trademarks of Dolby Laboratories.
Nov 08 19:34:06 Engels Plex Media Server[2264]: decoder information: 249
Nov 08 19:34:24 Engels Plex Media Server[2264]: decoder information: 249
Nov 08 19:37:10 Engels Plex Media Server[2264]: decoder information: 249
Nov 08 19:37:10 Engels Plex Media Server[2264]: decoder information: 249
Nov 08 19:37:15 Engels Plex Media Server[2264]: decoder information: 249
Nov 08 19:37:15 Engels Plex Media Server[2264]: decoder information: 249
Nov 08 19:40:55 Engels Plex Media Server[2444]: Connection to 172.105.74.4 closed by remote host.
Nov 08 19:54:17 Engels Plex Media Server[2646]: Connection to 172.104.245.120 closed by remote host.
~

Thanks for the logs.

Everything I see in your logs implies ownership & permissions errors in /var/lib/plexmediaserver (or wherever moved)

The decoder error (429) is a “You’ve made too many requests for this codec. You’re now throttled until you can behave”

A few questions:

  1. Did you relocate PMS / have a custom override.conf ? You aren’t showing the full normal systemctl status plexmediaserver output.
    2, If you did, did you remember to verify ownership & permissions of the files afterwards by forcing it sudo chown -R ?

I did just move my setup from one server to another. Just tar’d everything up on the previous server, and extracted on to the new one. The only thing I did (on the new server) was sudo chown -R plex:plex on the newly copied/extracted /var/lib/plexmediaserver folder. Atleast as far as I remember.

Edit:
Also my username on the server is also “plex”

If you’ve made a tar-ball from one to the other, standard Linux dictates the UID/GID changes between systems so yes, sudo chown -R plex:plex /var/lib/plexmediaserver after extraction is the right step.

I am very concerned about the 429 (throttled) from plex.tv

Did you change software version in this process? If you didn’t then it should have had no reason to ask for new codecs.

Am I correct this is a remote (VPS-hosted) server?

Exactly. Made a tarball and chown’d the /var/lib/plexmediaserver folder :).

I have no idea what is going on, when the PlexMediaServer gets unresponsive, so if you can help me out, it would be greatly appreciated. Because I have no clue.
Edit: The only thing I know, is that it happens whenever I scan a lot of new TV episodes in. Or when the auto-scan starts, and it “catches” a lot of TV episodes. Don’t think it happens when I import/scan movies.

I didn’t change software version between the upgrades. If you mean PlexMediaServer version that is. Didn’t change Ubuntu version either. I did a Ubuntu upgrade a long time ago on the previous server, but the new server is a fresh Ubuntu 20.04.01 install.

Yes, it’s a remote VPS-hosted / dedicated server. The previous one was aswell.

Please explain “catches” ?

It sees as new and attempts to analyze ?

Please do the following for me – a bit of an experiment?

  1. Stop PMS
  2. Get into the command line and down into the Codecs directory (under “Plex Media Server”
  3. There, you’ll find all the codecs for this PMS version (most recent)
  4. Please make a tar ball of the entire “Codecs” and keep it savely in along side the dir (not in it)
  5. Now clear out the codecs (everything)
  6. Start PMS

When it comes up,

  1. Go to a specific movie
  2. Analyze it. (this should force it to download those individual codecs again)
  3. Wait 2 minutes
  4. Gather the log zip and attach it.
  5. Stop PMS

Yes, that would be my meaning of “catches”, lol. It’s when it’s a new series, and it has to “guess” (match) the series. That’s usually when it stops responding. It could also be when it’s analyzing, but I’m not too sure of that. Which means: I don’t know, because the server seems to stop whenever the matching goes on - but it could also be the analyzing. I have no way of knowing.

I did exactly as you asked. Here are the logs.
Edit: Removed logs
The movie I analyzed was Kingdom of Silence.

At point “5” - “Stop PMS”. Should I keep it offline for further testing, or can I start it again…?
Edit: I ended up starting it again at “Sun 08 Nov 2020 09:44:32 PM CET”

Edit 2: I’m going to bed soon btw, so if I don’t answer now, it’s because I’m sleeping :). I hope you’ll keep track of this thread and help me out, because I have no idea how to solve it (and I’m getting quite desperate). I was about to do a clean wipe of everything and starting over, if it kept on going. But it would take days to rebuild Plex’s database and metadata, intro-skip segments and so on :frowning:

In the event there is database problem, please find out how far back your backups go while I go through the logs.

Output from /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases

plex@Engels:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases$ ls
com.plexapp.dlna.db
com.plexapp.plugins.library.blobs.db
com.plexapp.plugins.library.blobs.db-2020-11-01
com.plexapp.plugins.library.blobs.db-2020-11-04
com.plexapp.plugins.library.blobs.db-2020-11-07
com.plexapp.plugins.library.blobs.db-shm
com.plexapp.plugins.library.blobs.db-wal
com.plexapp.plugins.library.db
com.plexapp.plugins.library.db-2020-11-01
com.plexapp.plugins.library.db-2020-11-04
com.plexapp.plugins.library.db-2020-11-07
com.plexapp.plugins.library.db-shm
com.plexapp.plugins.library.db-wal

Just so you know, I’m off to bed now, sorry to keep you waiting

I’m looking at your logs now and finding all the codecs are coming in as needed and without issue.

Is it behaving any better?

I haven’t been importing more episodes this evening, but will try again tomorrow. I’ll post in this thread again, when I do :slight_smile: I’ll try and import (add and then scan) a large amount again, to see if it crashes / gets unresponsive.

Please do the following

Settings - server - scheduled tasks

  1. Turn on the all the automatic tasks (I’ve attached my settings below)
  2. I’d also like you to Empty trash & Optimize the DB manually once
  3. Tonight, do your thing and see what happens.

You may have more options than I and your backup directory will be different.
This is from my QNAP server

As a general recommendation if I may?

Please consider the use of a tool like FileBot.

  1. The names are clean
  2. Structure is consistent for everything (you control the template)
  3. Matching is much faster
  4. Zero chance of incorrect matches because you’ve already curated the names

I’ve been using FileBot for years, pretty much since the beginning.

Using the same name scheme for all my files, it usually works great :slight_smile: ! It’s just very recently that whenever I scan especially TV shows in (new episodes, new series, new seasons) - and a lot of them, the server just gives up. Or atleast that’s what it feels like. Kind of suspected the database. Though I tried to repair it using the Linux based guide on this website.

All the scheduled things have been enabled pretty much since day one, and I regularly clean the bundles and optimize the databse manually (through the Plex fo Windows app). I also empty the trash now and again.

If worst come to worst, I guess I’ll have to do a clean wipe. But I’ll try later tonight and keep the console open, when I import / scan new series in :slight_smile: It’ll be many hours from now though. I’ll keep the thread updated

Minor update (11/11 - a few days later)
So far it works well :slight_smile: !! No crashing yet :smiley:

Crashed once again @ChuckPa

I just attached the logs. If it’s any help, it crashed when I imported a large amount of House MD episodes. Happened around 21:20-22:00 in the logs I think, not too sure :confused:
Really considering rebuilding the whole database from scratch

Edit: Removed logs

This looks like a permissions / the file itself. Notice the intro detection and playback both fail.

It knows which file file to get to (which is in the DB).

this is the transcoder starting up and trying to read the data – where it fails.

Nov 12, 2020 22:00:14.673 [0x7ff70f7fe700] WARN - MDE: unable to find a working transcode profile for video stream
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] WARN - MDE: unable to find a working transcode profile for video stream
Nov 12, 2020 22:00:14.674 [0x7ff72dffb700] DEBUG - It took 20.000000 ms to retrieve 169 items.
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] DEBUG - Cleaning directory for session c8a8244d-1c1a-4469-8690-7637462e24d5 ()
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] DEBUG - Starting a transcode session c8a8244d-1c1a-4469-8690-7637462e24d5 at offset -1.0 (state=3)
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] DEBUG - Streaming Resource: Added session 0x7ff684154bb0:c8a8244d-1c1a-4469-8690-7637462e24d5
Nov 12, 2020 22:00:14.674 [0x7ff72dffb700] DEBUG - We're going to try to auto-select an audio stream for account 1.
Nov 12, 2020 22:00:14.674 [0x7ff72dffb700] DEBUG - Selecting best audio stream for part ID 185803 (autoselect: 1 language: en)
Nov 12, 2020 22:00:14.674 [0x7ff72dffb700] DEBUG - Audio Stream: 461908, Subtitle Stream: -1
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] DEBUG - [Universal] Using local file path instead of URL: /home/plex/m/gcd/plex/TV Shows/House (2004)/Season 03/House.S03E05.1080p.BluRay.x264-SHORTBREHD.mkv
Nov 12, 2020 22:00:14.674 [0x7ff6737fe700] DEBUG - Last refresh (1900-01-01 00:00:00) appears to be older than directory change time (2020-11-12 20:42:53), need to refresh local media agent.
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] DEBUG - JobRunner: exec of /usr/lib/plexmediaserver/Plex Transcoder cancelled. In shutdown state.
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] WARN - TranscodeSession: job runner failed to start
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] DEBUG - Streaming Resource: Terminated session 0x7ff684154bb0:c8a8244d-1c1a-4469-8690-7637462e24d5 with reason Conversion failed. The transcoder failed to start up.
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] ERROR - Failed to start session.
Nov 12, 2020 22:00:14.674 [0x7ff70f7fe700] ERROR - IntroDetector: Failed to start a transcode session: /home/plex/m/gcd/plex/TV Shows/House (2004)/Season 03/House.S03E05.1080p.BluRay.x264-SHORTBREHD.mkv
Nov 12, 2020 22:00:14.674 [0x7ff7f488d700] DEBUG - Killing job.```

Okay, thanks for (once again) looking through my logs @ChuckPa. Much appreciated :slight_smile:

Is there anything I can do about it? I’m using a “clouddrive” solution (plexdrive). Could that be the issue? I mean, it’s been working without problems until recently. Maybe I should try rclone’s mount instead.

And when the transcoder fails detection and playback, why does the server “crash” / stop responding? Is there anything to do about this? It looks like the server is running (using sudo service plexmediaserver status) - but I (and the users) can’t connect to the PMS.

Very late edit (01/04/2021)
For the ones stumbling upon this thread, plexdrive seemed to be the issue for me. I switched to the rclone mount system instead. Using parts of animosity22’s script to keep everything going smoothly.

Oh, you’re using that 3rd party tool?

Those type configurations are very sensitive to everything involving your LAN & WAN.
The whole ‘Permissions management’ must be perfect (pre and post mount) in addition to anything managed by the cloud storage provider

My best advice here is to walk through each element / each layer and double check.

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