Plex Unreachable after "Scan Library Files"

Hi All,

I’ve had this problem for a few months now, hoping these frequent plex server updates will solve the problem but unfortunately not.

Every time I add new media in the plex server and do a re-scan (Scan Library files), everything is fine (metadata, thumbnails, etc…). But the server is then unreachable. I have to restart the Plex Server in Synology Packages and everything is OK again. I do not have the “Scan library automatically or periodically” on, I’ve been using Plex for about 5+ years now and have never encountered this problem until recently (3-4 months?)

Any insight on what’s going on? quite frustrating since I’m adding new media everyday.

Thanks in advance.

David
Server Version#:1.18.8.2468-5d395aa9d
Player Version#:

2 Likes

I really wish you had come here to the forum when it first happened. Waiting this long only serves to make resolving it harder.

Would you please do the following?

  1. Stop Plex
  2. Wait 3 minutes (let’s DSM calm down)
  3. Start Plex
  4. Wait 2 more minutes
  5. Stop Plex
  6. Now manually retrieve the log files

Hi Chuck,

As per attached. Many Thanks in advance.

Logs.zip (5.8 MB)

David

David,

XPEnology in a VM?

Chuck,

No, not in VM. it’s a dedicated PC running Xpenology.

Thanks,

David

Thanks. That explains the i5-8500 :smiley:

As for “Unreachable”, please detail further.
I see playback activity. I also see where you’ve started and stopped it a few times while it was working.

Seems like users can still see video playback during “Scanning library files”, maybe because there is a buffer or cache preloaded? but after rescan is done, further access is not possible (Server unreachable). Doesn’t matter what client (Roku, apple tv, plex.tv app via browser, etc…

The Plex status in Synology is still “running”, just no access. BUT it seems like it solves itself after a while (maybe 15+ minutes or so?), but I haven’t confirmed this.

Once I see that the server is unreachable, I just restart the Plex app in synology package and everything is fine.

Hope that helps. let me know if there is more information you need.

thanks,

david

Earlier in the day,

Mar 02, 2020 11:56:16.826 [0x7fb4b25a1700] DEBUG - Subtitles: Found a candidate subtitle language [eng] for a foreign film
Mar 02, 2020 11:56:16.826 [0x7fb4b25a1700] DEBUG - Audio Stream: 158748, Subtitle Stream: 158749
Mar 02, 2020 11:56:16.826 [0x7fb4f8a13700] WARN - SLOW QUERY: It took 121870.000000 ms to retrieve 1 items.
Mar 02, 2020 11:56:16.826 [0x7fb4c0855700] DEBUG - Last refresh (2020-03-02 08:59:32) appears to be older than directory change time (2020-03-02 10:43:24), need to refresh local media agent.
Mar 02, 2020 11:56:16.826 [0x7fb513a97740] DEBUG - Captured session 10.

This is 121.87 seconds to access the database. (2 minutes). Normal database operations for 1 item are normally 1-5 milliseconds.

I see you have Docker containers running. Are they doing anything to consume your disk i/o at that point which would make the database so slow?

Are you running out of physical memory and it’s swapping?

Other clustered SLOW QUERY messages

Mar 02, 2020 11:56:16.811 [0x7fb4b16fb700] WARN - SLOW QUERY: It took 133430.000000 ms to retrieve 2 items.
Mar 02, 2020 11:56:16.811 [0x7fb513a97740] DEBUG - Captured session 1.
Mar 02, 2020 11:56:16.811 [0x7fb4b16fb700] DEBUG - Last refresh (2020-03-02 08:59:39) appears to be older than directory change time (2020-03-02 10:43:24), need to refresh local media agent.
Mar 02, 2020 11:56:16.812 [0x7fb43b447700] WARN - SLOW QUERY: It took 121800.000000 ms to retrieve 4 items.
Mar 02, 2020 11:56:16.812 [0x7fb4b0b43700] WARN - SLOW QUERY: It took 133380.000000 ms to retrieve 1 items.
Mar 02, 2020 11:56:16.814 [0x7fb4b2e6b700] DEBUG - HTTP requesting GET http://127.0.0.1:32400/system/agents/update?mediaType=4&force=1&respectTags=0&parentGUID=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F350667%2F2%3Flang%3Den&parentID=74532&guid=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F350667%2F2%2F5%3Flang%3Den&id=76030&agent=com.plexapp.agents.localmedia&async=0
Mar 02, 2020 11:56:16.814 [0x7fb43b159700] WARN - SLOW QUERY: It took 133460.000000 ms to retrieve 1 items.
Mar 02, 2020 11:56:16.814 [0x7fb4b0b43700] DEBUG - Last refresh (2020-03-02 08:49:42) appears to be older than directory change time (2020-03-02 10:43:24), need to refresh local media agent.
Mar 02, 2020 11:56:16.814 [0x7fb4b2b7d700] WARN - SLOW QUERY: It took 133470.000000 ms to retrieve 1 items.
Mar 02, 2020 11:56:16.815 [0x7fb4fb029700] WARN - SLOW QUERY: It took 121820.000000 ms to retrieve 2 items.
Mar 02, 2020 11:56:16.816 [0x7fb43ab7d700] DEBUG - Refreshing GUID: 'com.plexapp.agents.thetvdb://299139/4/7?lang=en'
Mar 02, 2020 11:56:16.816 [0x7fb513a97740] DEBUG - Captured session 2.
Mar 02, 2020 11:56:16.816 [0x7fb43ab7d700] DEBUG - HTTP requesting GET http://127.0.0.1:32400/system/agents/update?mediaType=4&force=1&respectTags=0&parentGUID=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F299139%2F4%3Flang%3Den&parentID=55941&guid=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F299139%2F4%2F7%3Flang%3Den&id=57987&agent=com.plexapp.agents.localmedia&async=0
Mar 02, 2020 11:56:16.817 [0x7fb4b16fb700] DEBUG - Refreshing GUID: 'com.plexapp.agents.thetvdb://299139/4/13?lang=en'
Mar 02, 2020 11:56:16.817 [0x7fb513a97740] DEBUG - Captured session 3.
Mar 02, 2020 11:56:16.817 [0x7fb4b16fb700] DEBUG - HTTP requesting GET http://127.0.0.1:32400/system/agents/update?mediaType=4&force=1&respectTags=0&parentGUID=com%2Eplexapp%2Eagents%2Eth

The only Docker app I am running is Tautulli.

Memory should be OK, I have 16GB of Ram on it and I’ve never see it use more than 5% load.

When is the last you optimized the database?
Do you have it set to automatically defragment and perform other maintenance in Scheduled Tasks?

When is the last you optimized the database? - I don’t think I have. where do you do it?

Do you have it set to automatically defragment and perform other maintenance in Scheduled Tasks? - I don’t think so.

But I do have a lot of files on this Plex Server. 25TB+, 60K+ files, 7K+ Folders, spread across 6 HD’s.

This will take a bit for it to do.

  1. Settings - Server - Scheduled Tasks.
    a. Turn on the DB optimization if not already enabled (likely not)
    b. Also turn on the backups if not (I am concerned you have no backups either).

  2. Hover over the Libraries in the left panel to expose the ellipsis.
    a. Click the ellipsis
    b. Manage Server
    c. Optimize Database

This last step might take a bit.

OK, I’ll give it a try.

  • Settings - Server - Scheduled Tasks.
    a. Turn on the DB optimization if not already enabled (likely not)
    b. Also turn on the backups if not (I am concerned you have no backups either).
  • I had these on already, as per screen shot attached.
  • Hover over the Libraries in the left panel to expose the ellipsis.
    a. Click the ellipsis
    b. Manage Server
    c. Optimize Database
  • Done, only took a few minutes.

Great.

Now restart it, Let it get settled (about a minute) and then see how it behaves.

Since you’re at that menu, obviously there’s improvement.

Hi Chuck,

It just happened again, but little differently.

  1. Added some new media in a few different video folders. (about 15 files, into 4-5 different folders)
  2. Hit “Scan library files” for those relevant folders.
  3. Scanning takes proceeds, plex collects metadata, thumbnails, and updates each folder correctly.
  4. Everything is working fine, but after about 5, ‘Dashboard’ is not updating and the circular arrow is just spinning. This happens for the next 3-5 minutes. (no CPU, RAM, bandwidth graph, etc…) During this time, Tautulli loses connection to Plex (no updates, just spinning arrow)
  5. Plex is unreachable again.
  6. Restart Plex server package, and everything is fine again.

I have attached the logs for this. Can you have a look?
Logs-2.zip (5.4 MB)

Thanks,

David

Your database or XPEnology is hurting you.

Mar 02, 2020 21:19:34.555 [0x7fa0632f9740] DEBUG - Captured session 6.
Mar 02, 2020 21:19:34.555 [0x7fa0632f9740] DEBUG - Captured session 7.
Mar 02, 2020 21:19:34.555 [0x7fa0632f9740] DEBUG - Captured session 8.
Mar 02, 2020 21:19:34.555 [0x7fa0632f9740] DEBUG - Captured session 9.
Mar 02, 2020 21:19:34.582 [0x7f9f87159700] WARN - SLOW QUERY: It took 38510.000000 ms to retrieve 1 items.
Mar 02, 2020 21:19:34.583 [0x7fa04fc2c700] WARN - SLOW QUERY: It took 38470.000000 ms to retrieve 1 items.
Mar 02, 2020 21:19:34.583 [0x7fa00ee6b700] WARN - SLOW QUERY: It took 38430.000000 ms to retrieve 1 items.
Mar 02, 2020 21:19:34.583 [0x7fa00c855700] WARN - SLOW QUERY: It took 38520.000000 ms to retrieve 1 items.
Mar 02, 2020 21:19:34.585 [0x7fa02bfff700] WARN - SLOW QUERY: It took 38620.000000 ms to retrieve 1 items.
Mar 02, 2020 21:19:34.585 [0x7f9fe6e6b700] WARN - SLOW QUERY: It took 38590.000000 ms to retrieve 1 items.
Mar 02, 2020 21:19:34.587 [0x7fa04fc2c700] DEBUG - We're going to try to auto-select an audio stream for account 1.
Mar 02, 2020 21:19:34.587 [0x7fa04fc2c700] DEBUG - Selecting best audio stream for part ID 80136 (autoselect: 1 language: en)
Mar 02, 2020 21:19:34.587 [0x7fa04fc2c700] DEBUG - We're going to try to auto-select a subtitle.
Mar 02, 2020 21:19:34.587 [0x7fa04fc2c700] DEBUG - Subtitles: Found a candidate subtitle language [eng] for a foreign film
Mar 02, 2020 21:19:34.587 [0x7fa04fc2c700] DEBUG - Audio Stream: 219214, Subtitle Stream: 221835
Mar 02, 2020 21:19:34.588 [0x7fa0632f9740] DEBUG - Captured session 10.
Mar 02, 2020 21:19:34.588 [0x7fa04fc2c700] DEBUG - Request: [172.17.0.2:55842

For comparison, do you have an older version of PMS you can downgrade to?
It might point some light definitively on version versus environment.

There is a second comparison we can perform.
We set the existing server off to the side and construct a “TEST” server name.
This type test is used to see if there is a deep corruption that PMS itself can’t detect (which happens rarely but does happen)

  • Is there anywhere I can download previous versions? I know for a fact that I didn’t have this problem a few months ago, so this might be the case.

Thanks,

David

I’m having the exact same issue. I’m a relatively new user to the Plex Media Server, but very new to my Synology NAS. Could you advise me on how to restart the Plex Server via the Synology NAS?

goto synology DSM (port 5000), click on package center, then Plex. Under the “Action” pulldown menu, choose stop. I usually give it a minute, then start it again.

Hi All,

I can confirm all “Server Unreachable” issues have gone away after re-intalling 1.16.5.xxx.

Thanks to ChuckPa for his help on this.

David