Failed to start Plex Media Server

Server Version#:1.25.6.5577-c8bd13540

One day my plex server on Ubuntu Server 20.04 LTS just stopped working. I don’t recall doing anything to it. I just lost access to it.
I’ve found that the service isn’t starting. I’ve tried rebooting the service and server many times and still no success. I run the status command and get the output below:

systemctl status plexmediaserver.service
● plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2022-02-27 02:33:16 UTC; 30s ago
Process: 1171 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/SUCCESS)
Process: 1180 ExecStart=/bin/sh -c export PLEX_MEDIA_SERVER_INFO_VENDOR="$(grep ^NAME= /etc/os-release | awk -F= “{print $2}” | tr -d " )"; export PLEX_MEDIA_SERVER_INFO_DEVICE=“PC”; export PL>
Main PID: 1180 (code=exited, status=255/EXCEPTION)

Feb 27 02:33:16 us01 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 3.
Feb 27 02:33:16 us01 systemd[1]: Stopped Plex Media Server.
Feb 27 02:33:16 us01 systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Feb 27 02:33:16 us01 systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
Feb 27 02:33:16 us01 systemd[1]: Failed to start Plex Media Server.

And another command to better give info on the error:
journalctl -e -u plexmediaserver.service
Feb 26 06:17:57 us01 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 2.
Feb 26 06:17:57 us01 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 2.
Feb 26 06:17:57 us01 systemd[1]: Stopped Plex Media Server.
Feb 26 06:17:57 us01 systemd[1]: Starting Plex Media Server…
Feb 26 06:17:57 us01 systemd[1]: Started Plex Media Server.
Feb 26 06:17:57 us01 Plex Media Server[1176]: /bin/sh: 1: exec: /usr/lib/plexmediaserver/Plex Media Server: not found
Feb 26 06:17:57 us01 systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=127/n/a
Feb 26 06:17:57 us01 systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
Feb 26 06:18:02 us01 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 3.
Feb 26 06:18:02 us01 systemd[1]: Stopped Plex Media Server.
Feb 26 06:18:02 us01 systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Feb 26 06:18:02 us01 systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
Feb 26 06:18:02 us01 systemd[1]: Failed to start Plex Media Server.
Feb 26 17:12:05 us01 systemd[1]: Starting Plex Media Server…
Feb 26 17:12:05 us01 systemd[1]: Started Plex Media Server.
Feb 26 17:12:06 us01 Plex Media Server[18670]: Error: Unable to set up server: listen: Address in use (N5boost10wrapexceptINS_6system12system_errorEEE)
Feb 26 17:12:06 us01 systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=255/EXCEPTION
Feb 26 17:12:06 us01 systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
Feb 26 17:12:11 us01 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 1.
Feb 26 17:12:11 us01 systemd[1]: Stopped Plex Media Server.
Feb 26 17:12:11 us01 systemd[1]: Starting Plex Media Server…
Feb 26 17:12:11 us01 systemd[1]: Started Plex Media Server.

(it repeats three times with no change in output)
I’ve searched far and wide and tried many solutions I’ve seen on the internet and still no success. Hopefully someone here can lend me a hand and get this problem solved.

Check first but Uninstall and reinstall the package.

Something removed file(s) from /usr/lib/plexmediaserver

/bin/sh: 1: exec: /usr/lib/plexmediaserver/Plex Media Server: not found

I tried uninstalling, rebooting and reinstalling but still get the same error. Also that file does exist on the server.
I ran the command below:
ls /usr/lib/plexmediaserver

And got this as an output:
CrashUploader ‘Plex DLNA Server’ ‘Plex Media Scanner’ ‘Plex Relay’ ‘Plex Script Host’ ‘Plex Tuner Service’ etc
‘Plex Commercial Skipper’ ‘Plex Media Fingerprinter’ ‘Plex Media Server’ ‘Plex SQLite’ ‘Plex Transcoder’ Resources lib

Do you have a customized startup (override) file?

If not, may I see your last set of logs? (make a tar.gz of the Logs directory)

Where do find the log file?

I did make some changes to a file so an external drive I have attached to the server auto mounts and is broadcast in my network as an SMB share on startup.

the logs , by default, are in "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs"

When you made your edits, did you edit /lib/systemd/system/plexmediaserver.service ?

ls /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Logs/
‘PMS Plugin Logs’ ‘Plex DLNA Server.4.log’ ‘Plex Media Scanner Chapter Thumbnails.4.log’ ‘Plex Media Scanner Matcher.4.log’ ‘Plex Transcoder Statistics.4.log’
‘Plex Crash Uploader.1.log’ ‘Plex DLNA Server.5.log’ ‘Plex Media Scanner Chapter Thumbnails.5.log’ ‘Plex Media Scanner Matcher.5.log’ ‘Plex Transcoder Statistics.5.log’
‘Plex Crash Uploader.2.log’ ‘Plex DLNA Server.log’ ‘Plex Media Scanner Chapter Thumbnails.log’ ‘Plex Media Scanner Matcher.log’ ‘Plex Transcoder Statistics.log’
‘Plex Crash Uploader.3.log’ ‘Plex Media Scanner Analysis.1.log’ ‘Plex Media Scanner Deep Analysis.1.log’ ‘Plex Media Server.1.log’ ‘Plex Tuner Service.1.log’
‘Plex Crash Uploader.4.log’ ‘Plex Media Scanner Analysis.2.log’ ‘Plex Media Scanner Deep Analysis.2.log’ ‘Plex Media Server.2.log’ ‘Plex Tuner Service.2.log’
‘Plex Crash Uploader.5.log’ ‘Plex Media Scanner Analysis.3.log’ ‘Plex Media Scanner Deep Analysis.3.log’ ‘Plex Media Server.3.log’ ‘Plex Tuner Service.3.log’
‘Plex Crash Uploader.log’ ‘Plex Media Scanner Analysis.4.log’ ‘Plex Media Scanner Deep Analysis.4.log’ ‘Plex Media Server.4.log’ ‘Plex Tuner Service.4.log’
‘Plex DLNA Server Neptune.log’ ‘Plex Media Scanner Analysis.5.log’ ‘Plex Media Scanner Deep Analysis.5.log’ ‘Plex Media Server.5.log’ ‘Plex Tuner Service.5.log’
‘Plex DLNA Server Neptune.old.log’ ‘Plex Media Scanner Analysis.log’ ‘Plex Media Scanner Deep Analysis.log’ ‘Plex Media Server.log’ ‘Plex Tuner Service.log’
‘Plex DLNA Server.1.log’ ‘Plex Media Scanner Chapter Thumbnails.1.log’ ‘Plex Media Scanner Matcher.1.log’ ‘Plex Transcoder Statistics.1.log’
‘Plex DLNA Server.2.log’ ‘Plex Media Scanner Chapter Thumbnails.2.log’ ‘Plex Media Scanner Matcher.2.log’ ‘Plex Transcoder Statistics.2.log’
‘Plex DLNA Server.3.log’ ‘Plex Media Scanner Chapter Thumbnails.3.log’ ‘Plex Media Scanner Matcher.3.log’ ‘Plex Transcoder Statistics.3.log’

Which log file from above is the one that’s helpful?

And no I did not edit that file.

Please do the following:

sudo tar cfz  /tmp/plexlogs.tar.gz  ./Logs

It grabs the entire directory (so i can see them with their rollover)
and places it in /tmp for easy access

plexlogs.tar.gz (1.2 MB)

Thank you. You have a seriously stuck process which is holding the socket open.

Please check, and report back,

ps -ef | grep -i plex

You’ll find either EAE or a ‘Plex Script Host’ process.

Please let me know what you find.

After you figure out the pid, kill -9 PID_NUMBER

Well i did not see any of the names of the processes you called but I killed the only plex process i saw and it doesnt kill it. Additionally, whenever I execute the kill command it ends my ssh session to the server as well so maybe I’m killing the wrong thing. I am not sure.

ps -ef | grep -i plex
root 737 1 0 03:28 ? 00:00:01 /sbin/mount.ntfs /dev/sdb2 /Plex_Storage -o rw,nosuid,nodev
toor 4678 4442 0 04:50 pts/0 00:00:00 grep --color=auto -i plex
~$ kill -9 4442

From what you’ve shown me, the kill -9 4442 killed the parent process (your shell).
The PID of the process is the first number. The parent process ID is the second number.

So that my instructions are better targeted, how long have you been using Linux?

Off and on for about 5 years. I apologise for any inconvenience caused due to me not knowing something.

In the case of killing the process, since the table didnt have any headings, I tried both processes at first. When i tried killing the first number (In the case of the output shown earlier “4678”) it said no such process so that’s when I tried to kill the second number which ended up terminating my SSH session.

From what you showed me, there are no Plex processes running.

If any part of Plex were running, you’d see one of these listed.

chuck@lemming:/lib/systemd/system$ ps -ef | grep -i plex
chuck      24852       1  9 Feb26 ?        01:06:47 /usr/lib/plexmediaserver/Plex Media Server
chuck      24894   24852  0 Feb26 ?        00:00:07 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.6.5577-c8bd13540 /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/System.bundle
chuck      24972   24852  0 Feb26 ?        00:00:12 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.25.6.5577-c8bd13540 32600
chuck      25007   24852  0 Feb26 ?        00:00:05 Plex Plug-in [tv.plex.agents.movie] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.6.5577-c8bd13540 /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/PlexMovieNew.bundle
chuck      25183   24852  0 Feb26 ?        00:00:05 Plex Plug-in [tv.plex.agents.music] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.6.5577-c8bd13540 /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/PlexMusic.bundle
chuck      25186   24852  0 Feb26 ?        00:00:05 Plex Plug-in [org.musicbrainz.agents.music] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.6.5577-c8bd13540 /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Musicbrainz.bundle
chuck      26026   24852  0 Feb26 ?        00:00:05 Plex Plug-in [tv.plex.agents.series] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25.6.5577-c8bd13540 /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/PlexSeries.bundle
chuck     120458   49736  0 02:10 pts/0    00:00:00 grep --color=auto -i plex
chuck     120459   24852  0 02:10 ?        00:00:00 /usr/lib/plexmediaserver/Plex Media Scanner --analyze-deeply --item 116390 --log-file-suffix  Deep Analysis
chuck@lemming:/lib/systemd/system$ 

Notice they are either the Plex Plug-in (agents) or the main server elements themselvs from /usr/lib/plexmediaserver

Let’s now find out which process is holding the main plex ports (any of them) open

sudo bash
for i in 3240[0-9]
do
netstat -tulpn | grep $i
done

This will show the progresses are using Plex’s ports.
Please show me your output (Copy/paste the text)

It will look something like this:

root@lemming:~# for i in 3240[0-9]
> do
> netstat -tulpn | grep $i
> done
tcp        0      0 127.0.0.1:32401         0.0.0.0:*               LISTEN      24852/Plex Media Se 
tcp6       0      0 :::32400                :::*                    LISTEN      24852/Plex Media Se 
root@lemming:~#

In the above, you can see my server is what’s using the ports ; which is normal.
For you, I expect to find something else.

1 Like

Thank you, I got the problem resolved. The problem was that I changed the port to SSH into the server and made it a bit too close to the port number Plex uses. I changed the port SSH uses to another one again, rebooted and now Plex works again.

Thank you for the help!

I’m guessing the day the Plex stopped working for me was the first time the server restarted since I made the changes which is why I never noticed the conflict until then.

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