Plex not automatically launching on after rebooting QNAP

well it is obvious it doesn’t work.

the plex.sh shipped in 1.40.3 is still the broken version which contains

ProcessCount=$(ps -ef | grep Plex | wc -l)

instead of the proposed fixed version with
CODE: SELECT ALL

      if [ -d /proc/$(cat "$PidFile") ] && grep "Plex Media Serv" /proc/$(cat "$PidFile")/comm > /dev/null; then

I have started experiencing frequent power outages to the point where my UPS can’t keep up. Now I need to play tech support for my family multiple times a day as they can’t use Plex after an outage. Yes, I’m looking to increase the reliability of my power supply, but I’d also like to point out that I am very much looking forward to a version of Plex on QNAP that starts up properly after even an ungrafecul shut down. Thanks so much to the developers supporting the ecosystem! Your effort is much appreciated!

1 Like

the fixed startup script was (for some unfathomable reason) not included in 1.40.3. did someone check 1.40.4?

ping @ChuckPa

When folks are back (Monday) , I will find out what happened with this not being included as part of the release.

Please confirm for me that the updated script does function?
It should tell you if it’s recovering from a crash in the QNAP system logs

This is the critical region I added

      # Pid file was present but no process present. PMS crashed so confirm clean or do a cleanup.
      Pids="$(ps -ef | grep $QPKG_DIR | awk '{print $1}')"
      if [ "$Pids" != "" ]; then
        LogMessage="Plex Media Server is recovering from previous crash. Please standby."
        echo $LogMessage
        log_tool -t 0 -a "$LogMessage"

        # Cleanup each dangling process
        for i in $Pids
        do
          Count=5; Signal=-15
          while [ $Count -gt 0 ] && [ -e /proc/$i ]
          do
            kill $Signal $i
            sleep 3
            Count=$((Count - 1))
            [ $Signal -eq -15 ] && Signal=-9
            [ $Signal -eq -9  ] && Signal=-11
          done

          # if loop finishes and still have pid,  it's stuck and we stop here
          if [ -e /proc/$i ]; then
            LogMessage="Error: PlexMediaServer: Stuck process (pid) $i. PlexMediaServer cannot start."
            log_tool -t 1 -a  "$LogMessage"
            echo $LogMessage
          fi
        done
      fi

I’ve pressed Engineering to release it (The internal process got changed in March and this fell in the crack ) :frowning:

Please continue to use my script above for now. I’ll make certain it’s released in the next.

~ Please confirm for me that the updated script does function?

I tested it back in March but if you made changes since I can test again.

~ I’ll make certain it’s released in the next.

Awesome, thanks!

also looking forward to this making it into the next release

subscribed!

This seems to be same with Windows PMS also. Every reboot plex doesn’t auto load.

@crimsonfury

Can you provide DEBUG logs (the ZIP) you capture right after manually starting?

I don’t know windows but can spot fundamental errors in PMS logs.

Please do remember, this is a QNAP (Linux) thread.

1 Like

Plex Media Server Logs_2024-07-18_20-07-49.zip (6.8 MB)

Just tried European Vacation which has DTS and transcodes becuase of it. It just buffered until errored out about 5 minutes ago.

@crimsonfury

This is a QNAP thread (Linux).
I’m sorry, but I cannot help you with Windows.

Plese create a thread in the Windows sections.

ALL:

At long last ( :roll_eyes: ), I got the approval to release the updated plex.sh script for QNAP.

It had somehow fallen in the crack on their side. I did a “full strenth lurk” on my manager (who has approval authority) last night.

It’s done and set to go into the next development/testing cycle. I’m trying to get that nudged forward to this upcoming release.

If anyone needs help using what I updated, please let me know.

2 Likes

thanks! will test as soon as the new release is out.

just for clarification, will this land in 1.40.5 or in 1.41.0?

I’m trying to get it into 1.40.5. So far, it looks good to make it as folks have been using it here without issue?

Are there any issues ??? (IMPORTANT)

the new script worked fine on my end (in contrast to the old script which would 100% fail after a power outage). but i guess more widespread testing before shipping couldn’t hurt.

Folks:

New plex.sh looks like it’s in PMS 1.40.5.8761-c64418528

Heads up:

Plex/NVIDIA_GPU_DRV timing correction approved and will be in next PMS release after this (not sure if 1.40.6 or 1.41.0 numbering)

ALL:

I have a big question to ask:

Does the PlexData shared folder still work for you?

Can you:

  1. Using FileStation, Click PlexDataPlex Media Server and end up in the real Plex Media Server directory where you can do addition things like make a ZIP of the Logs directory ? (You must be admin not administrative user)

  2. While in the “Plex Media Server” directory, highlight everything and make your backups -OR- restore from backups?
    ( You cannot backup from the “PlexData” level. This will not work)

Ref: PlexData share for QNAP systems

  1. Yes PlexData lets me in there and I can zip the logs.
  2. I’m not familiar with snapshots if that’s the method. When I clicked it, I was told I only have 5GB of space for snaps, when I have TBs, ugh.

on QTS 4.5.4.2790 and a TS-451+

Can you:

PlexData doesn’t show up for me in FileStation on QTS 5.1.7 and i can’t find it via SSH either:

[/] # find  / -name PlexData       
find: /proc/14758: No such file or directory
find: /proc/14759: No such file or directory
find: /proc/14760: No such file or directory
find: /proc/14762: No such file or directory
find: /proc/14787: No such file or directory
find: /proc/14796: No such file or directory
find: /proc/14808: No such file or directory
[/] # 

@dinkblam

  1. PlexData is a shared folder which you’d create and need to give your username access to.

  2. It would be listed under /share if it were present.

Just saw that PMS update 1.40.5.8854 was available today…installed.