Plex stops running on QNap

Hi @doctorwho @ChuckPa , so I downloaded the latest Qnap release PlexMediaServer-1.25.0.5246-cb2507e4d-x86_64.qpkg from the Plex website, re-installed the media server, and restarted my NAS. It has been over 2hrs and the server is still up and running fine. I guess that fixed it but I’ll keep my fingers crossed.
Thank you

Hi @adewalegeorge, glad to hear yours is working, did you remove it completely, then re-install or just perform an upgrade?

I’d tried the same version last week, but again it loaded ran for a few seconds then stopped. Then stopped and restarted it once more, it ran again for a few seconds, then repeat but got the same result, thus the downgrade to PMS 1.24.5 which go it all working again.

One other thing to point out, I’ve created as suggested by QNAP to create another Admin user and disable the original Admin account.

May try getting that account active again and install as that users, as it was the original account that installed and configured PMS. Will let you know how I get on.

Hi @Soulman247, just downgraded the PMS, as my QTS is on the latest release copy of v4.5.4

Tried QTS h5.0.0 pre release a couple of months ago but found it bug ridden, so reverted back to h4.5.4

upgrade ? downgrade >

Need version numbers AND some logs please which capture this.

I think I know what’s happening but need to confirm (log files)

Sorry - I now realise that you also have to go into QTS > Control Panel > Network and File Services > Telnet / SSH

Make sure “Allow SSH Connection” is ticked, then click on “Edit Access Permission” and make sure your user is ticked in the list (it only shows you admin accounts in that list)

Hi ChuckPa, I am sending my latest log file via PM. Got the cron job auto-restarting when PMS web address stops responding, and can see that it happened a couple of times in the past week - at around 2am and 4am. I’ll also send you my crontab list, in case you can spot a clash with a QTS service.

ChuckPa couldnt send you a PM, so here you go:

Looking at the QTS notification centre, it reports my cron job (which runs every 10 mins) restarted PMS at:

  • 25/11 at 4.10am
  • 25/11 at 4.20am
  • 23/11 at 2.10am
  • 23/11 at 2.20am

For all this time, I have been running QTS 5.0.0.1853 (yes, I ignored the 1858 release for the minute). PMS is 1.24.5.5173

FWIW my crontab is below. (is it normal to have so many entries??)
good luck!
chris

;;;;;;;;;;;;;;;;

#0 2 * * * /sbin/qfstrim
10 15 * * * /usr/bin/power_clean -c 2>/dev/null
0 3 * * * /sbin/clean_reset_pwd
0-59/15 * * * * /etc/init.d/nss2_dusg.sh
30 7 * * * /sbin/clean_upload_file
0-59/10 * * * * /etc/init.d/storage_usage.sh
30 3 * * * /sbin/notice_log_tool -v -R
35 7 * * * /sbin/qbox_util -c  > /dev/null 2>/dev/null
0-59/20 3 * * * /sbin/adjust_time
*/10 * * * * /sbin/config_cache_util 0
0 1 * * * /etc/init.d/flush_memory.sh >/dev/null 2>&1
0 3 * * 0 /etc/init.d/idmap.sh dump
7 9,21 * * * /sbin/notify_update --nc 1>/dev/null 2>&1
0 4,16 * * * /sbin/hwclock -s
20 0 * * * /share/CACHEDEV1_DATA/.qpkg/HybridBackup/rr2/scripts/insight/insight.sh -runall >/dev/null 2>&1
#30 7 * * * /sbin/storage_util --ironwolf_disk_health_test dev_id=00000002
00 03 * * * sh /share/CACHEDEV1_DATA/.qpkg/MalwareRemover/MalwareRemover.sh scan;#_QSC_:MalwareRemover:malware_remover_schedule:None:d::
0 0 * * * /sbin/auto_update 1>>/dev/null 2>>/dev/null
0 10 1 * * /sbin/hal_event --pd_self_test dev_id=0x00000002,action=1
0 10 1 * * /sbin/hal_event --pd_self_test dev_id=0x00000001,action=1
0 23 */1 * * /sbin/qpkg_cli -U 1>/dev/null 2>/dev/null
30 00 * * * sh /share/CACHEDEV1_DATA/.qpkg/MalwareRemover/Upgrade.sh;#_QSC_:MalwareRemover:malware_remover_upgrade:None:d::

* * * * * /var/cache/netmgr/lock_timer.sh
* 4 * * * /usr/sbin/logrotate /etc/config/mariadb_mc.logr
50 7 * * * /sbin/qpkg_cli --check_license 0 > /dev/null 2>/dev/null
0 0 * * * /usr/local/sbin/qulog-archive local_event retention 0 >/dev/null 2>&1
0 1 * * * /usr/local/sbin/qulog-archive remote_event retention 0 >/dev/null 2>&1
0 2 * * * /usr/local/sbin/qulog-archive local_access retention 0 >/dev/null 2>&1
0 3 * * * /usr/local/sbin/qulog-archive remote_access retention 0 >/dev/null 2>&1
0 4 * * * (source /etc/init.d/qulog.sh dummy; check_mariadb) >/dev/null 2>&1
0 4 * * * /etc/init.d/wsd.sh restart
* 4 * * * /usr/sbin/logrotate /etc/config/mc_logr.conf
0 2 * * 0 /usr/local/medialibrary/bin/mymediadbcmd checkRepairDB  >/dev/null 2>&1
0 12 * * * /mnt/ext/opt/LicenseCenter/bin/qlicense_tool local_check
0 0 * * * /usr/local/sbin/qsh nc.archive >/dev/null 2>&1
0 1 * * * (source /etc/init.d/nc.sh dummy; check_mariadb) >/dev/null 2>&1
43 10 * * * /mnt/ext/opt/QcloudSSLCertificate/bin/ssl_agent_cli
35 7 * * * /sbin/qsyncsrv_util -c  > /dev/null 2>/dev/null
0 0 * * * /sbin/qsyncsrv_tool --fix  > /dev/null 2>/dev/null
*/10 * * * * /sbin/curl --silent --insecure --fail --max-time 10 http://127.0.0.1:32400; [[ $? = 7 ]] && /etc/init.d/plex.sh restart >/dev/null 2>&1
0 3 * * * /sbin/vs_refresh
4 3 * * 3 /etc/init.d/backup_conf.sh
  1. Crontab - Yes, QNAP likes to avail itself of crontab for system maintenance tasks. :slight_smile:

  2. I see the butler running a lot of tasks. In the logs retained (1-5) , I don’t see any failures. :frowning: (they rolled off the end. Your oldest is Nov 29)

  3. Are you aware you can access the logs at any time via FileStation ?

  1. One of the extra things we can do, which will probably help here is to add the hidden preference LogNumFiles="10" to Preferences.xml, using the QNAP Text Editor app, when PMS is stopped.

Preferences.xml, on the very last line, will look like:

SomeOtherPref="Value" LogNumFiles="10" />

Be careful not to damage other preferences.

I recommend making a backup copy of Preferences.xml prior to editing it – just in case you accidentally corrupt it.

TO ALL FOLLOWING HERE:

Regarding the question about upgrading PMS to 1.24.5173 or higher

If you’re upgrading from a version below 1.24.5.5173 to 1.24.5.5173 or higher,

There will be an initial delay where PMS won’t respond because of the extensive database changes being performed.

Please see the release notes:

For context here, I am running QTS 5.0.0.1858 (2021/11/19) I attempted updating QTS, and quickly noticed that running the new Security Counselor disabled a few services like the network access which I re-enabled.

I installed PlexMediaServer-1.25.0.5246-cb2507e4d-x86_64.qpkg over the previous version already installed, restarted the entire QNAP server, and this fixed it all for me. I hope that helps.

Thank you, will give it a shot!

Just given v1.25.1.5286 on QTS v.4.5.4 and it’s now working a treat, no dropouts at all. Great stuff

Hi to everybody.
Upgraded to latest PMS 1.25.0.5282 coming from 1.24.3.5033 and now the Plex page is still loading…
Is it normal? I have read of some extensive database changes…
Should I leave it like that and get back in a few hors?
I already tried to close and restart PMS after manual install o my QNAP TS-251+ (QTS 4.5).
Please let me know. Thank you.

TO ALL:

A condition was discovered where, when PMS crashes on QTS 5.0, the only recourse is to restart QTS (:angry:)

I have been working on solving this and have a potential solution.

It is working well here and I would appreciate feedback from anyone willing to try it.

It won’t break it. If anything, it will make starting/stopping in App Center behave as it should in these degenerate situations.

Any volunteers to try my ‘plex.sh’ replacement script ?

I’ll give it a go.

@JCHH

Thank you for volunteering.

What’s contained in this change:

  • When shutting down PMS from App Center , it now checks twice to ensure everything shut down.

  • It cleans up after itself (PID file, etc).

  • Remedies the situation where the server process crashes but leaves the other support processes.

  • Remedies the race condition where PMS thinks its running but it’s not.

  • Manual use of the plex.sh command from the shell command line no longer terminates itself! :scream: :rofl:

  • “plex.sh” is now 64-bit system aware and won’t attempt operations limited to 64 bit NAS systems.

To install (recommended)

  1. Upload to “Public” shared folder on QNAP :sunglasses:

  2. SSH into the machine

  3. cd /share/Public

  4. tar xf ChuckPa-Plex-sh.tar.gz

  5. cd /share/*/.qpkg/Plex*

  6. mv plex.sh plex.sh-orig

  7. cp -p /share/Public/plex.sh .

  8. ls -la plex.sh
    – confirm owned by admin:admin
    – confirm permissions 755 (executable)

  9. Invoke manually ./plex.sh <command>

  10. Operate normally via App Center

  11. Crash test (manually make PMS fail with SEGV)
    – Start Plex
    – Allow it to become stable
    – get the “Plex Media Server” pid (ps -ef | grep 'Plex Media Server')
    – Kill it hard kill -11 pid_number
    – Go to App Center
    – Stop Plex there
    – Back in shell ps -ef | grep -i plex
    – No PMS processes should remain.

ChuckPa-Plex-sh.tar.gz (2.9 KB)

@ChuckPa

You lost me at step 1. Upload what to public and where is public?

edit: you mean upload ChuckPa-Plex-sh.tar.gz to share/public on my QNAP, don’t you?

Yes. sorry

1 Like

OK, so after all those steps, ps -ef | grep -i plex returns:
17598 admin 1148 S grep -i plex

…before kill -11 and stopping in the Applications centre, ps -ef | grep -i plex returned:

 6194 admin     88452 S   ./Plex Media Server
 6752 admin     42800 S N Plex Plug-in [com.plexapp.system] /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Resources/Plug-ins-2edd3c44d/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.0.5282-2edd3c44d /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Resources/Plug-ins-2edd3c44d/System.bundle
 7035 admin     12920 S   /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Plex Tuner Service /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Resources/Tuner/Private /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Resources/Tuner/Shared 1.25.0.5282-2edd3c44d 32600
 7634 admin     43480 S   Plex Plug-in [com.plexapp.agents.imdb] /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Resources/Plug-ins-2edd3c44d/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.0.5282-2edd3c44d /share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Resources/Plug-ins-2edd3c44d/PlexMovie.bundle
 8878 admin      1016 S   grep -i plex

Thank you.

The only match grep could find is grep itself. Perfect :muscle: :slight_smile:

I think we’re ready to push this to QA for final check and release

Thoughts?