After update Plex impossible restart service

Hello

After the plex update ( last version ) is impossible restart service.
i can’t understand why
I try remove but same problem
Can you help me please

Thanks for you help

Regards David

Server :
Ubuntu 16.04.4 LTS
Linux ns3136236 4.19-ovh-xxxx-std-ipv6-64 #960989 SMP Wed Oct 30 08:31:50 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

systemctl status plexmediaserver.service

● plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-05-06 18:17:47 CEST; 24min ago
Process: 5892 ExecStart=/bin/sh -c /usr/lib/plexmediaserver/Plex\ Media\ Server (code=exited, status=126)
Process: 5890 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)
Main PID: 5892 (code=exited, status=127)

May 06 18:17:47 ns3136236 systemd[1]: Stopped Plex Media Server for Linux.
May 06 18:17:47 ns3136236 systemd[1]: plexmediaserver.service: Start request repeated too quickly.
May 06 18:17:47 ns3136236 systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
May 06 18:17:47 ns3136236 systemd[1]: Failed to start Plex Media Server for Linux.
May 06 18:18:20 ns3136236 systemd[1]: plexmediaserver.service: Start request repeated too quickly.
May 06 18:18:20 ns3136236 systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
May 06 18:18:20 ns3136236 systemd[1]: Failed to start Plex Media Server for Linux.
May 06 18:18:31 ns3136236 systemd[1]: plexmediaserver.service: Start request repeated too quickly.
May 06 18:18:31 ns3136236 systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
May 06 18:18:31 ns3136236 systemd[1]: Failed to start Plex Media Server for Linux.

journalctl -u plexmediaserver

18:45:34 ns3136236 systemd[1]: Starting Plex Media Server for Linux…
May 06 18:45:34 ns3136236 systemd[1]: Started Plex Media Server for Linux.
May 06 18:45:34 ns3136236 sh[3787]: /bin/sh: /usr/lib/plexmediaserver/Plex Media Server: No such file or directory
May 06 18:45:34 ns3136236 systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=127/n/a
May 06 18:45:34 ns3136236 systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
May 06 18:45:39 ns3136236 systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
May 06 18:45:39 ns3136236 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 1.
May 06 18:45:39 ns3136236 systemd[1]: Stopped Plex Media Server for Linux.
May 06 18:45:39 ns3136236 systemd[1]: Starting Plex Media Server for Linux…
May 06 18:45:39 ns3136236 systemd[1]: Started Plex Media Server for Linux.
May 06 18:45:39 ns3136236 sh[4019]: /bin/sh: /usr/lib/plexmediaserver/Plex Media Server: No such file or directory
May 06 18:45:39 ns3136236 systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=127/n/a
May 06 18:45:39 ns3136236 systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.

less /lib/systemd/system/plexmediaserver.service

1 [Unit]
2 Description=Plex Media Server for Linux
3 After=network-online.target
4 BindsTo=network-online.target
5
6 [Service]
7 Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support”
8 Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
9 Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
10 Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp
11 Environment=LD_LIBRARY_PATH=/usr/lib/plexmediaserver
12 Environment=LC_ALL=C
13 ExecStartPre=/bin/sh -c ‘/usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}”’
14 ExecStart=/bin/sh -c ‘/usr/lib/plexmediaserver/Plex\ Media\ Server’
15 Type=simple
16 User=plex
17 Group=plex
18 Restart=on-failure
19 RestartSec=5
20 StartLimitInterval=60s
21 StartLimitBurst=3
22
23 [Install]
24 WantedBy=multi-user.target

Thanks for you help

Can you share the output of the following two commands:
ls -l /var/lib/ | grep -i plexmediaserver
ls -l /usr/lib/plexmediaserver/

Also, can you attach the installation log file: /tmp/plexinstaller.log

The journalctl logging suggests that it’s unable to find the Plex Media Server executable.

2 Likes

While I’m not completely familiar with Plex Installations on Linux, I’ve helped plenty with FreeBSD/FreeNAS issues.

The issue with services starting is almost always permissions & ownership.
Older versions of Plex used to “create” a second identical user called “Plex” which would often confuse the system, thus I’d have to chown plex:plex && chmod 755 all the plex owned items in order to correct this after an update…

If this is not possible, or you’re willing to reinstall, you can

  • Back up your database to an external location
  • Install Plex from scratch
  • Start and Stop the service ( this will build the plex DB folders)
  • Copy the backed up to the DB folders in the new install
  • Start services

Note: When resolving using this method you may have to reshare access to your Plex users.

Similar instructions can be found here:
Just remember to account for the difference in folder locations

Hello thanks for reply

ls -l /var/lib/ | grep -i plexmediaserver
drwxr-xr-x 3 plex plex 4.0K May 6 22:09 plexmediaserver

ls -l /usr/lib/plexmediaserver/
nothing

but after y try with chown plex:plex /usr/lib/plexmediaserver -R
same error

i try

mkdir /usr/lib/plexmediaserver/Plex\ Media\ Server
ls -l /usr/lib/plexmediaserver/
drwxr-xr-x 2 root root 4.0K May 6 22:29 ‘Plex Media Server’

journalctl -u plexmediaserver

May 06 23:32:15 ns3136236 systemd[1]: Starting Plex Media Server for Linux...
May 06 23:32:15 ns3136236 systemd[1]: Started Plex Media Server for Linux.
May 06 23:32:15 ns3136236 sh[11916]: /bin/sh: /usr/lib/plexmediaserver/Plex Media Server: Is a directory
May 06 23:32:15 ns3136236 systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=126/n/a
May 06 23:32:15 ns3136236 systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
May 06 23:32:20 ns3136236 systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
May 06 23:32:20 ns3136236 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 1.
May 06 23:32:20 ns3136236 systemd[1]: Stopped Plex Media Server for Linux.
May 06 23:32:20 ns3136236 systemd[1]: Starting Plex Media Server for Linux...
May 06 23:32:20 ns3136236 systemd[1]: Started Plex Media Server for Linux.
May 06 23:32:20 ns3136236 sh[12120]: /bin/sh: /usr/lib/plexmediaserver/Plex Media Server: Is a directory
May 06 23:32:20 ns3136236 systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=126/n/a
May 06 23:32:20 ns3136236 systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.

Thanks for reply

i delete user : plex and group : plex
i remove installation
i create user and group
i install plex
try start service

but the same error

Don’t create the plex user and group manually; that is handled by the installer. Also, how are you installing? It should be:
sudo dpkg -i plexmediaserver_version.deb

At this point I’d suggest you remove Plex Media Server and remove your manually created plex user and group:
sudo dpkg -r plexmediaserver
sudo userdel -r plex
sudo groupdel plex

Don’t worry, this will leave your Plex database intact. I just went through this exact process on my test server to ensure it didn’t bork anything. You likely will need to re-claim your server though. After doing the above, download the latest PMS package from plex.tv and install it via:
sudo dpkg -i plexmediaserver_version.deb

If that doesn’t work, include the systemctl journalctl output again, along with the /tmp/plexinstaller.log file.

1 Like

no work but different error

### systemctl status plexmediaserver
● plexmediaserver.service - Plex Media Server
   Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
   Active: failed (Result: signal) since Thu 2020-05-07 09:44:44 CEST; 19ms ago
  Process: 10466 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_D
  Process: 10464 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exi
 Main PID: 10466 (code=killed, signal=ABRT)

May 07 09:44:44 ns3136236 systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
May 07 09:44:44 ns3136236 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 3.
May 07 09:44:44 ns3136236 systemd[1]: Stopped Plex Media Server.
May 07 09:44:44 ns3136236 systemd[1]: plexmediaserver.service: Start request repeated too quickly.
May 07 09:44:44 ns3136236 systemd[1]: plexmediaserver.service: Failed with result 'signal'.
May 07 09:44:44 ns3136236 systemd[1]: Failed to start Plex Media Server.

### journalctl -u plexmediaserver
May 07 09:44:39 ns3136236 systemd[1]: Started Plex Media Server.
May 07 09:44:39 ns3136236 Plex Media Server[10466]: terminate called after throwing an instance of 'std::runtime_error'
May 07 09:44:39 ns3136236 Plex Media Server[10466]:   what():  locale::facet::_S_create_c_locale name not valid
May 07 09:44:39 ns3136236 systemd[1]: plexmediaserver.service: Main process exited, code=killed, status=6/ABRT
May 07 09:44:39 ns3136236 systemd[1]: plexmediaserver.service: Failed with result 'signal'.
May 07 09:44:44 ns3136236 systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
May 07 09:44:44 ns3136236 systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 3.
May 07 09:44:44 ns3136236 systemd[1]: Stopped Plex Media Server.
May 07 09:44:44 ns3136236 systemd[1]: plexmediaserver.service: Start request repeated too quickly.
May 07 09:44:44 ns3136236 systemd[1]: plexmediaserver.service: Failed with result 'signal'.
May 07 09:44:44 ns3136236 systemd[1]: Failed to start Plex Media Server.

### /tmp/plexinstaller.log file.

      1 # Plex Media Server installation configuration info:  Thu May  7 09:44:13 CEST 2020
      2 Init=0
      3 Systemd=1
      4 Custom=0
      5 LinuxContainer=0
      6 NewInstall=1
      7 HaveOverride=0
      8 OverrideFile=""
      9 PlexUser="plex"
     10 PlexGroup="plex"
     11 VideoGroup="video"
     12 AppSuppDir="/var/lib/plexmediaserver/Library/Application Support"
     13 PlexTempDir="/tmp"
     14 LangEncoding="en_US.UTF-8"
     15 ExistingVersion=0
     16 HaveHardware=0
     17 HaveTranscoderPref=0
     18 NeedUser=1
     19 NeedGroup=1
     20 NeedVideo=1
     21 Verbose=1
     22 Running=0
     23 Errors=0
     24 Warnings=0

Thanks

Ok i try 3 time and now is correct i dont now why but is fonctionnal

Plex will continue to fail until the locale is initialized.

locale::facet::_S_create_c_locale name not valid
2 Likes

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