0

I currently have the problem, that my Plex Media Server, which is set up on a Raspberry Pi 3 Model B, cannot be started. When I hit sudo service plexmediaservice status, I get the following error:

pi@raspberrypi:~ $ sudo service plexmediaserver status
● plexmediaserver.service - Plex Media Server for Linux
   Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2018-10-21 13:58:13 UTC; 3min 24s ago
  Process: 914 ExecStart=/bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver "/usr/lib/plexmediaserver/Plex Media Server" (code=exited, status=255)
  Process: 910 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPO
 Main PID: 914 (code=exited, status=255)

Oct 21 13:58:08 raspberrypi systemd[1]: plexmediaserver.service: Main process exited, code=exited, status=255/n/a
Oct 21 13:58:08 raspberrypi systemd[1]: plexmediaserver.service: Unit entered failed state.
Oct 21 13:58:08 raspberrypi systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
Oct 21 13:58:13 raspberrypi systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
Oct 21 13:58:13 raspberrypi systemd[1]: Stopped Plex Media Server for Linux.
Oct 21 13:58:13 raspberrypi systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Oct 21 13:58:13 raspberrypi systemd[1]: Failed to start Plex Media Server for Linux.
Oct 21 13:58:13 raspberrypi systemd[1]: plexmediaserver.service: Unit entered failed state.
Oct 21 13:58:13 raspberrypi systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.

What I already tried is to chmod the Plex Library with 777, according to this answer. But it still does not work. I have absolutely no clue, where should start searching for the error.

What can I do, to get my Plex Media Server back to work? Thank you in advance for your help.

UPDATE: I get this error message when I type sudo /bin/sh -c 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver "/usr/lib/plexmediaserver/Plex Media Server"'

terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
Aborted

This is the other log:

pi@raspberrypi:~ $ systemctl cat plexmediaserver.service
# /lib/systemd/system/plexmediaserver.service
[Unit]
Description=Plex Media Server for Linux
After=network-online.target

[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/
Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp
ExecStartPre=/bin/sh -c '/usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPO
ExecStart=/bin/sh -c 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver "/usr/lib/plexmed
Type=simple
User=plex
Group=plex
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target
 ESCOC

ON_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support"
lib/plexmediaserver
_PROCS=6
p
d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_
sr/lib/plexmediaserver "/usr/lib/plexmediaserver/Plex Media Server"'


~
 ESCOC

And this is the log when I type journalctl -b -e.

Oct 21 20:48:28 raspberrypi systemd[607]: Reached target Sockets.
Oct 21 20:48:28 raspberrypi systemd[607]: Reached target Timers.
Oct 21 20:48:28 raspberrypi systemd[607]: Reached target Basic System.
Oct 21 20:48:28 raspberrypi systemd[607]: Reached target Default.
Oct 21 20:48:28 raspberrypi systemd[607]: Startup finished in 55ms.
Oct 21 20:48:28 raspberrypi systemd[1]: Started User Manager for UID 1000.
Oct 21 20:48:29 raspberrypi systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
Oct 21 20:48:29 raspberrypi systemd[1]: Stopped Plex Media Server for Linux.
Oct 21 20:48:29 raspberrypi systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Oct 21 20:48:29 raspberrypi systemd[1]: Failed to start Plex Media Server for Linux.
Oct 21 20:48:29 raspberrypi systemd[1]: plexmediaserver.service: Unit entered failed state.
Oct 21 20:48:29 raspberrypi systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
Oct 21 20:48:32 raspberrypi sudo[640]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/sbin/service pl
Oct 21 20:48:32 raspberrypi sudo[640]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Oct 21 20:48:33 raspberrypi systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Oct 21 20:48:33 raspberrypi systemd[1]: Failed to start Plex Media Server for Linux.
Oct 21 20:48:33 raspberrypi systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
Oct 21 20:48:33 raspberrypi sudo[640]: pam_unix(sudo:session): session closed for user root
Oct 21 20:48:45 raspberrypi systemd[607]: Time has been changed
Oct 21 20:48:45 raspberrypi systemd-timesyncd[280]: Synchronized to time server [xxxx:xxx:xxxx:x::xxx]:123 (2.debian.
Oct 21 20:48:45 raspberrypi systemd[1]: Time has been changed
Oct 21 20:48:45 raspberrypi systemd[1]: apt-daily-upgrade.timer: Adding 23min 13.261304s random time.
Oct 21 20:48:45 raspberrypi systemd[1]: apt-daily.timer: Adding 11h 49.829368s random time.

Do I may start with the wrong user?

  • On the command line can you please execute: /bin/sh -c 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver "/usr/lib/plexmediaserver/Plex Media Server"' maybe prefixed with sudo? Does it give you some output/error messages? Can you please edit your question and add the output from this command: systemctl cat plexmediaserver.service. Can you find some related messages with journalctl -b -e? – Ingo Oct 21 '18 at 17:19
  • Hi @Ingo, thank you for your response. I've updated my question with the logs. Thank you for your time and support. I really appreciate that. – Julian Schmuckli Oct 21 '18 at 21:01
1

Execution of Plex Mediaserver terminates with exit code 255 that means the real exit code is greater than 255 and unknown. That does not help much and is not a good reputation for Plex Mediaserver. There are also no more error messages from the server. I don't know anything about Plex Mediaserver but maybe there is another logging file besides system logging?

The idea now is to run the server from the command line in the hope it will give more information why it fails. Most server fork oneself into the background and have an option to run for debugging in the foreground. You can look for that option. From the systemd unit we see what environment the server needs. We can invoke a shell with user and group plex, set the environment variables and try to start the server. Start a shell with:

rpi ~$ sudo --user=plex --group=plex --shell

Or maybe you have to use a login shell with:

rpi ~$ sudo --user=plex --group=plex --login

Within the shell you can set the environment variables and try to start the server:

shell ~$ export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/
shell ~$ export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
shell ~$ export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
shell ~$ export PLEX_MEDIA_SERVER_TMPDIR=/tmp
shell ~$ /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
shell ~$ LD_LIBRARY_PATH=/usr/lib/plexmediaserver "/usr/lib/plexmediaserver/Plex Media Server" <--debug>

<--debug> means the debug or foreground option if available. Within the shell you can modify the conditions step by step to get the server to run. After testing you quit the shell with exit. I hope this can give some more information what's going wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.