Plex stop working frequently without any reason

Hello,
sorry about this title, but i don’t know how to explain it better. I have the Problem if i starts more than one Playback, Plex stops to Response after a fewe minutes. When this happend in the most cases I have do do a manually restart.

Plex running on CentOS7
Router: Asus RT-AC87U
Prozesseor: Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz
RAM: 32692 MB (8192 for the vm)

I have deactivated the firewall because of some troubles whit the dvr-feature.
I have tested the latest plexpass and non plexpass version. The same problem
I was running Plex inside a docker under CentOS7 and with a direct installation, the same problem

Find attached my Log files. It would be great if some one can help. I have really no idea what i can do to solve the problem.

Thanks to all in advance :slight_smile:

Is it possible for you to do the following?

  1. Settings - Server - General – Uncheck “Verbose logging” - save this
  2. Optimize the database (I see a lot of database activity regarding media). A slow database will cause Plex’s components to stop communicating causing erratic operation and can easily interrupt playback.
  3. Restart PMS after doing this
  4. Attempt to recreate the situation.
  5. When you do, wait about 30 seconds before getting another full set of logs as you did above.
  6. Attach those here and I’ll take a look and compare.

(Verbose logs cause a lot of data to get lost)

@ChuckPA said:
Is it possible for you to do the following?

  1. Settings - Server - General – Uncheck “Verbose logging” - save this
  2. Optimize the database (I see a lot of database activity regarding media). A slow database will cause Plex’s components to stop communicating causing erratic operation and can easily interrupt playback.
  3. Restart PMS after doing this
  4. Attempt to recreate the situation.
  5. When you do, wait about 30 seconds before getting another full set of logs as you did above.
  6. Attach those here and I’ll take a look and compare.

(Verbose logs cause a lot of data to get lost)

Hello,

thanks for you help. I have everything done like you told. Please find attached the new log file.

Thanks in advance.

Andreas,
Thank you. I have found the problem.

Jun 06, 2017 07:22:11.546 [0x7f73a9f63840] ERROR - Error creating directory /transcode: boost::filesystem::create_directory: Permission denied: "/transcode"

Plex might be working for you until such time it needs to transcode. Then it will ‘fail’.

On Linux, the default location is in /var/lib/plexmediaserver/tmp_transcoding
If you have relocated it in your transcoder settings, go check there.

User plex does not have permissions to write into the directory to create what it needs.

@ChuckPA said:
Andreas,
Thank you. I have found the problem.

Jun 06, 2017 07:22:11.546 [0x7f73a9f63840] ERROR - Error creating directory /transcode: boost::filesystem::create_directory: Permission denied: "/transcode"

Plex might be working for you until such time it needs to transcode. Then it will ‘fail’.

On Linux, the default location is in /var/lib/plexmediaserver/tmp_transcoding
If you have relocated it in your transcoder settings, go check there.

User plex does not have permissions to write into the directory to create what it needs.

There was no folder in this path /var/lib/plexmediaserver/tmp_transcoding. Just a folder named Library.
In the transcoder settings of Plex is /transcode I have nothing changed. Just done the install of Plex with

sudo yum localinstall

I have created the folder /var/lib/plexmediaserver/transcode according to the plex transcoder settings and chown them to plex:plex with chmod of 755.

Still the same problem. Have I do something wrong?

If you have created /var/lib/plexmediaserver/transcode, do the following:

Did you go to Settings - Server - Transcode - Transcoder Temporary Directory enter the path /var/lib/plexmediaserver/transcode
Be certain to Save the change.

Plex was looking for the directory /transcode which would be in the root directory, not under /var/lib/plexmediaserver. Using the full pathname corrects this

@ChuckPA said:
If you have created /var/lib/plexmediaserver/transcode, do the following:

Did you go to Settings - Server - Transcode - Transcoder Temporary Directory enter the path /var/lib/plexmediaserver/transcode
Be certain to Save the change.

Plex was looking for the directory /transcode which would be in the root directory, not under /var/lib/plexmediaserver. Using the full pathname corrects this

Now I can see the temp files created by Plex while transcoding. but I have still the same issues. Plex stop response after estimated 30sec. I have attached a new protocol. I hope you can see whats happend here.

Thank you very much.

Andreas,
Thank you. It is much improved. Now we can see more of what is happening.

  1. Please go to Settings - Server - Network and disable IPv6. The addresses being shown indicate you do not need it. It also is causing streaming problem when playing
  2. The Plex database is VERY slow and needs optimization (Libraries - ... - Optimize Database)
Jun 06, 2017 09:06:12.194 [0x7f7b6b7fc700] WARN - SLOW QUERY: It took 1160.000000 ms to retrieve 0 items.
Jun 06, 2017 09:06:12.195 [0x7f7b6b7fc700] DEBUG - Running database fix-ups.
Jun 06, 2017 09:06:12.195 [0x7f7b6c7fe700] WARN - SLOW QUERY: It took 1160.000000 ms to retrieve 0 items.

After you complete this optimization, restart PMS

Next please go to Settings - Server - Scheduled Tasks. Enable Optimize database every week and check the schedule so it will run. Doing so helps prevent this problem from occurring again.

Hello Chuck,
I have all done like you told, but I have still the same problem. I have started 3 playbacks in my local network and Plex stop responding after 10 seconds and the Plex server become unavailable. I have to do a restart by cli. Also this restart takes a lot of time (30 sec) form press enter in the cli to be back on the command prompt.

Again i attached the log files.

Andreas,
Now we see a new error. Networking error

Jun 06, 2017 19:42:50.302 [0x7f31db7fd700] ERROR - Error issuing curl_easy_perform(handle): 7

https://curl.haxx.se/libcurl/c/libcurl-errors.html

Again we have SLOW QUERY.
06, 2017 19:43:13.985 [0x7f31cffff700] WARN - SLOW QUERY: It took 5030.000000 ms to retrieve 0 items.

What is your machine doing??? It appears GROSSLY overloaded!

@ChuckPA said:
Andreas,
Now we see a new error. Networking error

Jun 06, 2017 19:42:50.302 [0x7f31db7fd700] ERROR - Error issuing curl_easy_perform(handle): 7

libcurl - Error Codes

Again we have SLOW QUERY.
06, 2017 19:43:13.985 [0x7f31cffff700] WARN - SLOW QUERY: It took 5030.000000 ms to retrieve 0 items.

What is your machine doing??? It appears GROSSLY overloaded!

No, nothing special. It’s not overloaded I guess. Don know where this error came from :confused: Do you have any idea?

Andreas,
It is time to manually optimize the database.

From a terminal window, copy & paste the following commands in sequence. Should you encounter any errors, stop immediately and copy/paste all output back here.

sudo sh
service plexmediaserver stop
cd "/var/lib/plexmediaserver/Application Support/Plex Media Server/Plug-in Support/Databases"
sqlite3 com.plexapp.plugins.library.db .dump  > database.sql
mv com.plexapp.plugins.library.db com.plexapp.plugins.library.db.save
sqlite3 com.plexapp.plugins.library.db < database.sql
chown plex:plex com.plexapp.plugins.library.db
chmod 644 com.plexapp.plugins.library.db
rm -rf com.plexapp.plugins.library.db-wal
rm -rf com.plexapp.plugins.library.db-shm
service plexmediaserver start 
exit

This procedure did the following:

‘dumped’ the database to a text file,
renamed the existing database as a backup,
cleared the caches (if they exist… they should not),
imported the text file into a fresh database,
changed ownership and permissions from root back to plex

How many transcodes do you run on your machine at the same time? The Passmark specification for your processor (as reported in the log files) is 6926 Passmarks. This allows for up to 2 simultaneous video transcodes if the video processing is not extensive. Audio processing is much easier as one would expect.

The networking error is not something I can diagnose easily. It only tells me it cannot connect. This is the link I provided. If you ping plex.tv in a command window, what are the times in milliseconds?

@ChuckPA said:
Andreas,
It is time to manually optimize the database.

From a terminal window, copy & paste the following commands in sequence. Should you encounter any errors, stop immediately and copy/paste all output back here.

sudo sh
service plexmediaserver stop
cd "/var/lib/plexmediaserver/Application Support/Plex Media Server/Plug-in Support/Databases"
sqlite3 com.plexapp.plugins.library.db .dump  > database.sql
mv com.plexapp.plugins.library.db com.plexapp.plugins.library.db.save
sqlite3 com.plexapp.plugins.library.db < database.sql
chown plex:plex com.plexapp.plugins.library.db
chmod 644 com.plexapp.plugins.library.db
rm -rf com.plexapp.plugins.library.db-wal
rm -rf com.plexapp.plugins.library.db-shm
service plexmediaserver start 
exit

This procedure did the following:

‘dumped’ the database to a text file,
renamed the existing database as a backup,
cleared the caches (if they exist… they should not),
imported the text file into a fresh database,
changed ownership and permissions from root back to plex

How many transcodes do you run on your machine at the same time? The Passmark specification for your processor (as reported in the log files) is 6926 Passmarks. This allows for up to 2 simultaneous video transcodes if the video processing is not extensive. Audio processing is much easier as one would expect.

The networking error is not something I can diagnose easily. It only tells me it cannot connect. This is the link I provided. If you ping plex.tv in a command window, what are the times in milliseconds?

Hello Chuck,
that helps a lot. Its much better now. Regarding to your question about simultan transcodes: I do max 3 transcodes at a time. But i am thinking about to build a more powerfull Maschine. But i just need to do more investigation what the right components will be :slight_smile:

I really thank you very much for all you help in this case :slight_smile: