Plexserver doesn't start [dietpi 6.32.2] Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
fhals
Posts: 2
Joined: Mon Sep 07, 2020 10:00 am

Plexserver doesn't start [dietpi 6.32.2]

Post by fhals »

Hi,

not sure if this happened in context with the latest update to 6.3.2 or a prior power outage, but my Plex doesn't start any more.
journalctl logs the failing reason:

Code: Select all

Starting Plex Media Server...
[b]DietPi Plex Media Server[679]: [b]/bin/mkdir: cannot create directory ‘/var/lib/plexmediaserver/Library’: File exists[/b][/b]
DietPi systemd[1]: plexmediaserver.service: Control process exited, code=exited status=1
DietPi systemd[1]: Failed to start Plex Media Server.
Peeking there, we find a symlink:

Code: Select all

lrwxrwxrwx  1 plex dietpi   20 Mar 23  2019 Library -> /mnt/plexlib/Library
Looking into the destination:

Code: Select all

ls /mnt/plexlib/Library
ls: cannot access '/mnt/plexlib/Library': No such file or directory

Code: Select all

systemctl status plexmediaserver
● plexmediaserver.service - Plex Media Server
   Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/plexmediaserver.service.d
           └─dietpi-group.conf, dietpi-services_edit.conf
   Active: failed (Result: exit-code) since Sun 2020-09-06 11:40:16 CEST; 2min 49s ago
  Process: 1680 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPOR
T_DIR}" (code=exited, status=1/FAILURE)
/var/lib/plexmediaserver has been originally owned by root:root, I experimented with plex:plex, plex:dietpi, root:dietpi etc., no success.

Is there anybody experiencing the same or has an idea to fix it?
Will a simple dietpi uninstall/reinstall fix this at a last resort? (Fearing the loss of all the metadata)

Thanks for help
Frans
User avatar
Joulinar
Posts: 2287
Joined: Sat Nov 16, 2019 12:49 am

Re: Plexserver doesn't start [dietpi 6.32.2]

Post by Joulinar »

Hi,

many thanks for your message. I did a test installation on my RPi3B+ and it looks different for me because I don't have that sym link

Code: Select all

Library -> /mnt/plexlib/Library
For me it's a normal folder

Code: Select all

root@DietPi3:/var/lib/plexmediaserver# ls -la
total 12
drwxr-xr-x  3 plex plex 4096 Sep  7 10:46 .
drwxr-xr-x 14 root root 4096 Sep  7 10:46 ..
drwxr-xr-x  3 plex plex 4096 Sep  7 10:46 Library
root@DietPi3:/var/lib/plexmediaserver#
As well /mnt did not contain a plexlib folder

Code: Select all

root@DietPi3:/mnt# ls -la
total 24
drwxr-xr-x  7 root   root   4096 Aug 26 12:04 .
drwxr-xr-x 21 root   root   4096 Jun  8 12:05 ..
drwxrwxr-x  6 dietpi dietpi 4096 Aug 26 12:01 dietpi_userdata
drwxrwxr-x  2 dietpi dietpi 4096 Jun  8 12:05 ftp_client
drwxrwxr-x  2 dietpi dietpi 4096 Jun  8 12:05 nfs_client
drwxrwxr-x  2 dietpi dietpi 4096 Jun  8 12:05 samba
drwxr-xr-x  2 root   root      0 Feb 14  2019 usb
root@DietPi3:/mnt#
Do you know if /mnt/plexlib was/is provided by an external disk?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
fhals
Posts: 2
Joined: Mon Sep 07, 2020 10:00 am

Re: Plexserver doesn't start [dietpi 6.32.2]

Post by fhals »

Thank you for taking a look at this and hinting me to broken hardware.

Plexlib had been moved and symlinked to an external disk, as it grew too large for the SD-Card.
This disk died (in fact a 16GB USB-Stick just for this purpose).

If you ever lose an external plexlibrary :
Create a new mounting point on a fresh disk.
Create a folder called "Library" on it.
Make this folder owned by plex (chown -R plex:plex )
Create a symlink to "Library" inside /var/lib/plexmediaserver
Set the correct user:group for the original library folder:
chown -R plex:plex /var/lib/plexmediaserver
Restart Plex.

Just did it and Plex ran up successfully.
Now it's like a fresh install, building a new library.

Thank you for the push to the right direction, Joulinar!
User avatar
Joulinar
Posts: 2287
Joined: Sat Nov 16, 2019 12:49 am

Re: Plexserver doesn't start [dietpi 6.32.2]

Post by Joulinar »

thx for sharing your experience. Good to see that creating a new library is straight forward :)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply