Plex is running, web UI not accessible

Server Version#: 1.15.1.710-ece95b3a1
Player Version#: Unknown
Distro: Ubuntu 18.04.1 LTS

I just came back from a 3 week business trip to find that my PMS is not accessible. I have PMS installed on my dedicated ubuntu 16.04 box and when I logged in, I could see that the service was indeed running. I stopped the service and started it again, PMS was still not available.

I hooked up a monitor to the server and tried the direct url, http://localhost:32400/web and was given connection refused - same error I get across my network which tells me it’s not a router issue.

Checked the logs and the system log was last updated on the 18th of Feb, nothing since then… even though I have stopped and started the service, restarted the box, it does not capture any details.

I’ve done a few things which I will output below…

sudo journalctl -xe | grep -i plex

Mar 07 22:43:40 Media-Server sudo[10467]:      sga : TTY=pts/1 ; PWD=/home/sga ; USER=root ; COMMAND=/usr/sbin/service plexmediaserver status
Mar 07 22:43:46 Media-Server sudo[10473]:      sga : TTY=pts/1 ; PWD=/home/sga ; USER=root ; COMMAND=/usr/sbin/service plexmediaserver start
Mar 07 22:43:47 Media-Server systemd[1]: Starting Plex Media Server...
-- Subject: Unit plexmediaserver.service has begun start-up
-- Unit plexmediaserver.service has begun starting up.
Mar 07 22:43:47 Media-Server systemd[1]: Started Plex Media Server.
-- Subject: Unit plexmediaserver.service has finished start-up
-- Unit plexmediaserver.service has finished starting up.
Mar 07 22:43:49 Media-Server sudo[10533]:      sga : TTY=pts/1 ; PWD=/home/sga ; USER=root ; COMMAND=/usr/sbin/service plexmediaserver status
Mar 07 22:46:18 Media-Server sudo[10604]:      sga : TTY=pts/0 ; PWD=/usr/lib/plexmediaserver ; USER=root ; COMMAND=/bin/nano /lib/systemd/system/plexmediaserver.service
Mar 07 22:59:02 Media-Server sudo[11239]:      sga : TTY=pts/0 ; PWD=/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs ; USER=root ; COMMAND=/bin/nano com.plexapp.system.log

sudo serivce plexmediaserver status

â—Ź plexmediaserver.service - Plex Media Server
   Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-03-07 22:43:47 AEDT; 34min ago
  Process: 10503 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=0/S
 Main PID: 10508 (sh)
    Tasks: 6 (limit: 4915)
   CGroup: /system.slice/plexmediaserver.service
           ├─10508 /bin/sh -c  PLEX_MEDIA_SERVER_INFO_VENDOR="$(grep ^NAME= /etc/os-release | awk -F= "{print \$2}" | tr -d \" )"  PLEX_MEDIA_SERVER_INFO_DEVICE="PC"  PLEX_MEDIA_SERVER_INFO_MOD
           └─10526 /usr/lib/plexmediaserver/Plex Media Server

Mar 07 22:43:47 Media-Server systemd[1]: Starting Plex Media Server...
Mar 07 22:43:47 Media-Server systemd[1]: Started Plex Media Server.

I can’t for the life of me figure out why all of the sudden I can’t access PMS anymore, or why on Feb 19th it just decided to stop working (a day after I left on my trip).

I’ve read that a common ask is to force a crash and get a debug log, but I can’t access my UI, so I can;t check it the required settings are in place.

I also read that sometimes a fragmented DB can cause pains, but I can’t find any recent articles on how to force a DB optimisation via the CLI.

I’m very open to suggesstions on how to fix this, troubleshoot, logs to attach etc… Just need to figure out just WTH happened while I was away.

Thanks for the help!

Woke up and started to look into it again, wanted to be fully sure that something is amiss with the internal config on the server, so I ran the following:

sga@Media-Server:~$ curl -I localhost:32400/web/index.html
curl: (7) Failed to connect to localhost port 32400: Connection refused
sga@Media-Server:~$ netstat --listening | grep 32400
Nothing

Something very intersting… when I run the server manually, I can access the UI, but it says the server is not found, and got some interesting output from the CLI…

sga@Media-Server:~$ /bin/sh -c 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver /usr/lib/plexmediaserver/Plex\ Media\ Server'
/usr/lib/plexmediaserver/Plex DLNA Server: /usr/lib/plexmediaserver/lib/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0)
/usr/lib/plexmediaserver/Plex DLNA Server: /usr/lib/plexmediaserver/lib/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0)
/usr/lib/plexmediaserver/Plex DLNA Server: /usr/lib/plexmediaserver/lib/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0)
/usr/lib/plexmediaserver/Plex DLNA Server: /usr/lib/plexmediaserver/lib/libcrypto.so.1.0.0: no version information available (required by /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0)

Plex has a configuration which is defined as it launches.

If you invoke it from the command line as you have, because of how strict Linux permissions are, and the likely missing variables, PMS will start looking for your metadata using your username in your home directory. It’s not there. :wink:

Please to the following

sudo sh
cd "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server"
tar cfz /tmp/Logs.tar.gz Logs

Return to this reply window and attach (upload) the Logs.tar.gz found there.

Thanks @ChuckPa - Will be home in about 30 minutes and I’ll upload the logs then.

Hey @ChuckPa - see logs attached… Would be great to know what you’re looking for in these files so that I can do the same if I get a similar issue in the future.

Thanks for the help!

Logs.tar.gz (3.2 MB)

Thanks for the logs. I found it – or at least one of the problems

Feb 18, 2019 23:52:53.034 [0x7f23e57fe700] ERROR - Error parsing allowedNetworks '192.168.*': Invalid argument

you specify the network by full CIDR notation (e.g. 192.168.0.0/24 - or 192.168.0.0/255.255.255.0)

Yeah, I was just about to let you know about that setting… I’ve had that set for over a year (set via the UI) and if you look at previous logs, that error persists but the server still ran.

I actually updated the Prefences.xml file to use 192.168.1.0/255.255.255.0

But interesting enough, when I start the service via systemctl or service, no logs are updated - which boggles my mind

and does it work? (don’t leave me hanging! haha)

haha - whoops, should have given more context… I changed it last night, and to no avail. :frowning:

Check your DM

Ok, so for historical purposes… @ChuckPa and I spent several hours going back and fourth on DM looking into the issue and we were able to isolate the problem, but only after quite a few test scenarios to help isolate the problem.

I’ll summarise what we did here for others that may run into a similar issue in the future and who stumble across this thread…

Root Cause of the problem: I had changed ownership of my /var/lib/plexmediaserver folder to my local user:group because I also run plexupdate to keep my PMS on the most latest version. I am not saying don’t use this script, it is a brilliant utility, I just did some f00kery when I first installed it many years back

The steps we ran through were as follows:

  1. Stop Plex
  2. Go into /var/lib/plexmediaserver
  3. Rename Library to Library.keep
  4. Start Plex
  5. Setup a minimal (small) library section… Only 1.
  6. Get to the dashboard.
  7. See how it performs on full defaults.

After doing the above steps, I was shown:

Job for plexmediaserver.service failed because the control process exited with error code.
See "systemctl status plexmediaserver.service" and "journalctl -xe" for details.

So to get the output of the service to review what was happening, I did the following:

bash$ systemctl status plexmediaserver.service
â—Ź plexmediaserver.service - Plex Media Server
   Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2019-03-08 17:05:33 AEDT; 4s ago
  Process: 2854 ExecStart=/bin/sh -c  PLEX_MEDIA_SERVER_INFO_VENDOR="$(grep ^NAME= /etc/os-release | awk -F= "{print \$2}" | tr -d \" )"  PLEX_MEDIA_SERVER
  Process: 8194 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_S
 Main PID: 2854 (code=killed, signal=TERM)

And here is where @ChuckPa saw the issue, and responded with:

For Frack-sake… think I missed it :man_facepalming:

  1. Did you customize Plex’s default config by editing /lib/systemd/system/plexmediaserver.service or have a systemd override ( systemctl status plexmediaserver will list it as “loaded”)
  2. If not, there is a simple permissions issue: ls -la /var/lib/plexmediaserver (who owns it)
  3. If it appears to be plex:plex , and otherwise normal. do the following:
sudo sh
cd /var/lib/plexmediaserver
chown -R plex:plex .
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

systemctl reset-failed
systemctl restart plexmediaserver

So here he was able to see that my plexmediaserver folder had a differnent owner:group and we went into what is the intention of the future ownership of this folder…

The question was: Do I want to keep it assigned to sga:sga (my user) or have it owned back by plex:plex

I opted to keep the serviced to run as plex:plex and I will update my autoupdater to run properly.

So with that decision in mind, the next steps were:

To pull your existing library back and run as Plex,

  1. Stop Plex
  2. Follow these :slight_smile:
sudo sh
systemctl stop plexmediaserver
cd /var/lib/plexmediaserver
mv Library Library.trash-this
mv Library.keep Library
chown -R plex:plex .
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;   
systemctl start plexmediaserver

When it’s back up and running, delete Library.trash-this

And like magic… my Library was back and Plex was accessible from across my network again!

@ChuckPa - You sir are a legend and I can’t thank you enough mate!!! :love_you_gesture::facepunch::fist_right::clap:

1 Like

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