Unclaimed server on your network after symlinking Media to new path (on different device)



Hi, I'm quite advanced with Linux and believe this to be a bug.

I stopped plexmediaserver.
Copied the Media folder to /home/username/Media
Moved the Media folder to Media_OLD
Symlinked to the new Media location, The application should not be able to tell the difference unless specifically testing for a symlink and not file access.
lrwxrwxrwx 1 root root 20 Aug 4 13:38 Media -> /home/redacted/Media

Demonstrating every file is owned by plex


root@redacted:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media# find . ! -uid 119
root@redacted:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media#

All files kept their permissions/octals (owned by plex) I experience no other errors.

Except now every single day, Plex tells me the server is unclaimed. I claim it, Same thing again the next day. For some reason it seems to be happening each day which could not be a local OS issue. It used to tell me an unclaimed server existed but I deleted them a few times and now stopped doing it.

Everything works. Except this.


Not a bug. The symlink is biting you in the butt and is a local OS issue.

Create the proper systemd override and it will never happen.


@ChuckPA said:
Not a bug. The symlink is biting you in the butt and is a local OS issue.

Can you clarify this other then just saying its so? I'm a senior developer and engineer and "is a local OS issue" doesn't explain anything. AFAIK if your code cant do something every other app can its a bug. The onus is on you to explain why its not if your saying so.

Also , Could you clarify what you mean by "symlink biting me in the butt" if I write something in Python or Ruby that checks for file access or existence its not at all interested if its a symlink.

Perhaps once you explain the "biting you in the butt OS local issue" I can lodge an issue with the Debian bug tracker.

Create the proper systemd override and it will never happen.

I shouldn't need to do this if your code is written properly. I want my file tree to work regardless of the systemd service configuration. As it should.


Also I should add it stopped happening , After a Plex update. So it was a Bug.

Show a bit more respect for Debian before blaming it over a Windows port. Clearly the issue is not Debian.

This is obviously resolved now. It was a Plex bug as we can see from this ridiculous windows file tree on a Linux volume, where I'm using a symlink. No butt biting.

lrwxrwxrwx 1 root root 20 Aug 4 13:38 Media -> /home/graphene/Media
drwxr-xr-x 4 plex plex 4096 Jul 12 19:18 Metadata
-rw-r--r-- 1 plex plex 5 Aug 10 17:46 plexmediaserver.pid
drwxr-xr-x 3 plex plex 4096 Jul 27 08:36 Plug-ins
drwxr-xr-x 7 plex plex 4096 Jul 12 18:46 Plug-in Support
-rw------- 1 plex plex 1053 Aug 10 17:46 Preferences.xml
root@graphene:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server#


Sure, I'll be happy to clarify. Before throwing around your senior developer status, know this: I've been developing in Unix and Linux for 30+ years now in the kernel, system services, and applications on the full range of target platforms from HA server farms to embedded devices on microkernels.

  1. Symlinks are unidirectional. If you symlink to a new directory, spawn a process, and the process performs a chdir() to .., it will not follow the symlink backward to the origin. It will seek the parent directory at the target.
  2. Symlink across a file system boundary and use of iNotify. same condition applies.
  3. PMS uses the environment variable PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR. This is the chosen method to communicate where the metadata resides.
  4. Systemd affords a very clean and well documented mechanism for customizing any PMS runtime variables.
  5. Systemd is the mechanism chosen by the distros to spawn services. Do not blame PMS.

If you want to do something different, completely transparent to everything, including SystemD and avoid the use of symlinks

use a bind mount and avoid systemd entirely. Now you have it in /etc/fstab and at a lower level in the kernel, beneath ALL the BS.

Again, not a bug; a choice.


As one final note. Debian isn't supported by Plex. One of the ninja's and the community support it.

It happens to work for Debian 8.x and above because of SystemD. Were it not for that, it wouldn't run at all.