Plex won't start after update

Hello,

I need some help updating my plex from 1.0.0.2261 to 1.0.2.2413-7caf41d.x86_64.

I’m running it on CentOS 7 VM:

Linux pms 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 23
17:05:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

The server displayed a message that an update is available and when I click on manual update, the following file is downloaded:

plexmediaserver-1.0.2.2413-7caf41d.x86_64.rpm

I’ve stopped the server and run a yum localupdate for the above file and that finished no problem.

When trying to start the plexserver back, it error out.

Below the install captured outputs:

[root@pms tmp]# yum localupdate plexmediaserver-1.0.2.2413-7caf41d.x86_64.rpm
Loaded plugins: fastestmirror
Examining plexmediaserver-1.0.2.2413-7caf41d.x86_64.rpm: plexmediaserver-1.0.2.2413-7caf41d.x86_64
Marking plexmediaserver-1.0.2.2413-7caf41d.x86_64.rpm as an update to plexmediaserver-1.0.0.2261-a17e99e.x86_64
Resolving Dependencies
–> Running transaction check
—> Package plexmediaserver.x86_64 0:1.0.0.2261-a17e99e will be updated
—> Package plexmediaserver.x86_64 0:1.0.2.2413-7caf41d will be an update
–> Finished Dependency Resolution

Dependencies Resolved

==============================================================================
Package
Arch Version Repository Size

Updating:
plexmediaserver
x86_64 1.0.2.2413-7caf41d /plexmediaserver-1.0.2.2413-7caf41d.x86_64 199 M

Transaction Summary

Upgrade 1 Package

Total size: 199 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Stopping plexmediaserver (via systemctl): [ OK ]
Updating : plexmediaserver-1.0.2.2413-7caf41d.x86_64 1/2
Cleanup : plexmediaserver-1.0.0.2261-a17e99e.x86_64 2/2
Verifying : plexmediaserver-1.0.2.2413-7caf41d.x86_64 1/2
Verifying : plexmediaserver-1.0.0.2261-a17e99e.x86_64 2/2

Updated:
plexmediaserver.x86_64 0:1.0.2.2413-7caf41d

Complete!
[root@pms tmp]#

When trying to start:

[root@pms tmp]# service plexmediaserver start
Starting plexmediaserver (via systemctl): Job for plexmediaserver.service failed because the control process exited with error code. See “systemctl status plexmediaserver.service” and “journalctl -xe” for details.
[FAILED]

And journalctl shows:

_[root@pms tmp]# journalctl -xe
– Subject: Unit plexmediaserver.service has begun start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit plexmediaserver.service has begun starting up.
Jul 25 22:34:32 pms.mellointernet.us sh[14320]: /bin/mkdir: cannot create directory ‘’: No such file or directory
Jul 25 22:34:32 pms.mellointernet.us systemd[1]: plexmediaserver.service: control process exited, code=exited status=1
Jul 25 22:34:32 pms.mellointernet.us systemd[1]: Failed to start Plex Media Server for Linux.
– Subject: Unit plexmediaserver.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit plexmediaserver.service has failed.

– The result is failed.
Jul 25 22:34:32 pms.mellointernet.us systemd[1]: Unit plexmediaserver.service entered failed state.
Jul 25 22:34:32 pms.mellointernet.us systemd[1]: plexmediaserver.service failed.
Jul 25 22:34:37 pms.mellointernet.us systemd[1]: plexmediaserver.service holdoff time over, scheduling restart.
Jul 25 22:34:37 pms.mellointernet.us systemd[1]: Starting Plex Media Server for Linux…
– Subject: Unit plexmediaserver.service has begun start-up
– Defined-By: systemd
– Support:lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit plexmediaserver.service has begun starting up.
Jul 25 22:34:37 pms.mellointernet.us sh[14324]: /bin/mkdir: cannot create directory ‘’: No such file or directory
Jul 25 22:34:37 pms.mellointernet.us systemd[1]: plexmediaserver.service: control process exited, code=exited status=1
Jul 25 22:34:37 pms.mellointernet.us systemd[1]: Failed to start Plex Media Server for Linux.
– Subject: Unit plexmediaserver.service has failed
– Defined-By: systemd
– Support: lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit plexmediaserver.service has failed.

– The result is failed.
Jul 25 22:34:37 pms.mellointernet.us systemd[1]: Unit plexmediaserver.service entered failed state.
Jul 25 22:34:37 pms.mellointernet.us systemd[1]: plexmediaserver.service failed._

I’ve restored my snapshot back, so I’m running the old version, but any help on how to run this upgrade will be appreciated.

Thanks!

Did you have your PMS installed in a directory other than /var/lib/plexmediaserver/Library/Application Support ?

If you did, the PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR didn’t migrate correctly for you

Assuming you did,

As of ver 1.0.2, the PMS startup was unified across the linux platforms (it evolved to the point of not being maintainable).

PMS now supports/permits you to completely customize your configuration on systemd-based systems through the use of the systend overide.conf file. This is found in /etc/systemd/system/plexmediaserver.service.d/overide.conf

If you edit the file, you will probably find PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR didn’t get a proper value for unknown reasons.

All you need do is put the correct location in and properly quote it .

Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/path/to/new/Application Support"

Hello and thank you for your reply.

It has been some time since I installed Plex on my VM, so not sure what guide I’ve followed to install (can follow how-tos but learning Linux still :slight_smile: )

Looking at the directory you’ve mentioned above, I do see Plex in it:

[root@pms Application Support]# pwd
/var/lib/plexmediaserver/Library/Application Support
[root@pms Application Support]# ll
total 4
drwxr-xr-x 12 plex plex 4096 Jul 26 08:22 Plex Media Server
[root@pms Application Support]# [root@pms Application Support]# cd “Plex Media Server”
[root@pms Plex Media Server]# ll
total 20
drwxr-xr-x 4 plex plex 4096 Jul 26 08:21 Cache
drwxr-xr-x 4 plex plex 101 Jun 29 15:29 Codecs
drwxr-xr-x 2 plex plex 6 Jul 25 22:51 Crash Reports
drwxr-xr-x 3 plex plex 4096 Jul 26 08:21 Logs
drwxr-xr-x 3 plex plex 22 May 6 20:41 Media
drwxr-xr-x 10 plex plex 93 Jul 1 09:06 Metadata
-rw-r–r-- 1 plex plex 4 Jul 25 22:51 plexmediaserver.pid
drwxr-xr-x 10 plex plex 4096 Jul 11 14:05 Plug-ins
drwxr-xr-x 7 plex plex 91 May 6 19:19 Plug-in Support
-rw------- 1 plex plex 2224 Jul 26 08:22 Preferences.xml
drwxr-xr-x 2 plex plex 6 May 6 20:41 Scanners
drwxr-xr-x 3 plex plex 18 May 6 19:19 Thumbnails
[root@pms Plex Media Server]#

The current version was updated following the same steps I have done yesterday: Stop the server, yum localupdate, start the server (that I’m sure).

The first thing I see on journalclt is that the server is failing to create a directory and the error message has an empty string in it: ‘’ ← two quotes without anything inside.

Any ideas?

Yes.

Look at /etc/systemd/system/plexmediaserver.service.d/overide.conf This is the most likely culprit
Next, if overide.conf does not exist, check /usr/lib/systemd/system/plexmediaserver.service

For reference, some systems use /etc/systemd/system/plexmediaserver.service instead as the overide.conf equivalent (a ‘unit’ drop-in)

In both those files you should see, if using a default configuration.:

Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support"

Thank you for your reply.

My overide.conf had an empty directory as you thought, so added the above directory to it.

When trying to start it, got:

Starting plexmediaserver (via systemctl): Warning: plexmediaserver.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
Job for plexmediaserver.service failed because the control process exited with error code. See “systemctl status plexmediaserver.service” and “journalctl -xe” for details.

So run the daemon-reload and tried again.

This time it did start (Version 1.0.2.2413), but everything is gone:

The dashboard is empty
Add libraries with your media to make the most of Plex Media Server

What am I missing on the upgrade steps?

Thanks,
Al

Verify the path you typed. I say this because in testing, I did it too. I put in the override value but mistyped it. PMS wasn’t where I had told it and it proceeded to create a new, empty, PMS library in the location I had entered.

the default location is obviously "/var/lib/plexmediaserver/Library/Application Support" and just as you have it now. I had mistakenly typed “/var/lib/plexmediaserver/Application Support” facepalm

Here’s what I’ve done:

Restored my snapshot and looked for plexmediaserver.service and overide.conf

Only found plexmediaserver.service

----------- begin of plexmediaserver.service ------------------

  [Unit]
 Description=Plex Media Server for Linux
 After=network.target

  [Service]
 Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support"
 Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
 Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
 Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp
 Environment=LD_LIBRARY_PATH=/usr/lib/plexmediaserver
 Environment=LC_ALL=en_US.UTF-8
 Environment=LANG=en_US.UTF-8
 ExecStartPre=/bin/sh -c '/usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"'
 ExecStart=/bin/sh -c '/usr/lib/plexmediaserver/Plex\ Media\ Server'
 Type=simple
 User=plex
 Group=plex
 Restart=on-failure
 RestartSec=5
 StartLimitInterval=60s
 StartLimitBurst=3

  [Install]
 WantedBy=multi-user.target

----------- end of plexmediaserver.service ---------------------

Restored the upgraded snapshot and looked for plexmediaserver.service

Found plexmediaserver.service at /etc/systemd/system/multi-user.target.wants/

---------- begin of plexmediaserver.service ------------

[Unit]
Description=Plex Media Server for Linux
After=network.target

[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support"
Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp
Environment=LC_ALL=en_US.UTF-8
Environment=LANG=en_US.UTF-8
ExecStartPre=/bin/sh -c '/usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_D
ExecStart=/bin/sh -c 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver /usr/lib/plexmediaserver/Plex\ Media\ Server'
Type=simple
User=plex
Group=plex
Restart=on-failure
RestartSec=5
StartLimitInterval=60s

StartLimitBurst=3

[Install]
WantedBy=multi-user.target

---------- end of plexmediaserver.service ---------------

Comparing both files, the new one is missing:

Environment=LD_LIBRARY_PATH=/usr/lib/plexmediaserver

Added it to the file, but didn’t resolved the missing Library issue.

Took a second look at the /etc/systemd/system/plexmediaserver.service.d/overide.conf and noticed that I was missing the 1st " (quotation mark) on the Directory for the Environment. Fixed that and voila … working again.

So, first I’d like to thank you for your help troubleshooting.

Bottom line, unless all my steps are completely wrong and add the fact I’ve upgraded the same way the previous version, it seems there is a step missing on the creation of that file to point to the right directory, as the overide.conf file was created, the Environment variable added, but nothing was set as directory.

So, for short, to help future users with the same problem:

On my CentOS 7 install, I edited /etc/systemd/system/plexmediaserver.service.d/overide.conf and set the envioronment variable. In my case:

#  Plex Media Server - Systemd service override file
# All entries must be systemd compliant (Environrment="var=absolute_value")
#

[Service]

# If you wish to change Plex's Username or Group, uncomment the field(s) below and change to the correct values
#User=new_plex_username
#Group=new_plex_group

  Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support"

Moderator edit: Added ‘Code’ paragraph formatting to help others.

I would really like to know why it didn’t work properly for you on Centos because I wrote the migration script and i know it gets that right.

I have the snapshot of my old version. Can create a clone and create a ssh for you guys to work. Just contact me via message/e-mail.