Plex does not allow changing application support dir after a fresh install

Server Version#:1.20.3.3483-211702a9f
Player Version#: no clue never got to this point…

Here is how I tried it:
Here are the system details:

  • Debian sid latest updates all installed
  • uname -a output: Linux debian 5.9.0-1-amd64 #1 SMP Debian 5.9.1-1 (2020-10-17) x86_64 GNU/Linux
  • lsb_relase -cs output: sid

Here are the operations I took as root on this machine:

  • mount an empty ext4 fs on /opt/plex (mount options are same as for root)
  • mkdir -p “/opt/plex/Plex/tmp”
  • mkdir -p “/opt/plex/Plex/workdir/Library/Application Support”
  • wget -q https://downloads.plex.tv/plex-keys/PlexSign.key -O - | apt-key add -
  • apt update
  • apt install plexmediaserver
  • service plexmediaserver stop
  • chown -R plex:plex /opt/plex/Plex
  • systemctl edit plexmediaserver
    – Enter the following contents:
    – [Service]
    – Environment=“TMPDIR=/opt/plex/Plex/tmp”
    – Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/opt/plex/Plex/workdir/Library/Application Support”
  • systemctl daemon-reload
  • service plexmediaserver start
    – Result:
    – Job for plexmediaserver.service failed because the control process exited with error code.
    – See “systemctl status plexmediaserver.service” and “journalctl -xe” for details.
  • systemctl status plexmediaserver.service
    – Result:
    – plexmediaserver.service - Plex Media Server
    – Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
    – Drop-In: /etc/systemd/system/plexmediaserver.service.d
    – └─override.conf
    – Active: activating (auto-restart) (Result: exit-code) since Sat 2020-10-31 14:26:47 GMT; 723ms ago
    – Process: 9328 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=1/FAILURE)
  • apt reinstall plexmediaserver
  • Results
    – Reading package lists… Done
    – Building dependency tree
    – Reading state information… Done
    – 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
    – Need to get 0 B/80.5 MB of archives.
    – After this operation, 0 B of additional disk space will be used.
    – (Reading database … 469454 files and directories currently installed.)
    – Preparing to unpack …/plexmediaserver_1.20.3.3483-211702a9f_amd64.deb …
    – PlexMediaServer install: Pre-installation Validation.
    – PlexMediaServer install: Pre-installation Validation complete.
    – Unpacking plexmediaserver (1.20.3.3483-211702a9f) over (1.20.3.3483-211702a9f) …
    – Setting up plexmediaserver (1.20.3.3483-211702a9f) …
    – PlexMediaServer install: PlexMediaServer-1.20.3.3483-211702a9f - Installation starting.
    – PlexMediaServer install:
    – PlexMediaServer install: Now installing based on:
    – PlexMediaServer install: Installation Type: Update
    – PlexMediaServer install: Process Control: systemd
    – PlexMediaServer install: Plex User: plex
    – PlexMediaServer install: Plex Group: plex
    – PlexMediaServer install: Video Group: render
    – PlexMediaServer install: Metadata Dir: /opt/plex/Plex/workdir/Library/Application Support
    – PlexMediaServer install: Temp Directory: /opt/plex/Plex/tmp
    – PlexMediaServer install: Lang Encoding: en_US.UTF-8
    – PlexMediaServer install: Config file used: /etc/systemd/system/plexmediaserver.service.d/override.conf
    – PlexMediaServer install: Transcoding HW: Found
    – PlexMediaServer install:
    – PlexMediaServer install: Completing final configuration.
    – PlexMediaServer install: PlexMediaServer-1.20.3.3483-211702a9f - Installation successful. Errors: 0, Warnings: 0
    – Processing triggers for mime-support (3.64) …
    – Processing triggers for gnome-menus (3.36.0-1) …
    – Processing triggers for libc-bin (2.31-4) …
    – Processing triggers for desktop-file-utils (0.26-1) …

The installer thinks the install is all right with the override. But it does seem like there is some issue after all. I have checked with various ways to provide the override, and in some cases the installer indeed complained in the reinstall phase that the override is incorrect. So the installer can successfully use the directory, but the system.d startup script for PMS cannot. Is it running in as the correct user?

I have tried restarting the system as well just in case. No real effect.

Exit status 1 == Operation not permitted --OR— normal shell ‘exit 1’ flag.

Is /opt mounted with exec privilege ?
You’re 100% certain the path to the metadata directory allows the plex user access?

May I see /tmp/plexinstaller.log ?

dbtale@debian$ mount | grep plex
/dev/sdb1 on /opt/plex type ext4 (rw,relatime)

dbtale@debian$ls -l /opt/plex | grep Plex
drwxr-xr-x 4 plex plex 4096 Oct 31 13:11 Plex

dbtale@debian:/opt/plex$ ls -lR Plex/workdir
Plex/workdir:
total 4
drwxr-xr-x 3 plex plex 4096 Oct 31 14:02 Library

Plex/workdir/Library:
total 4
drwxr-xr-x 3 plex plex 4096 Oct 31 14:02 ‘Application Support’

‘Plex/workdir/Library/Application Support’:
total 4
drwxr-xr-x 8 plex plex 4096 Oct 31 14:08 ‘Plex Media Server’

No /tmp/plexinstaller.log is around. I assume it got removed after several tries of reinstalls etc.

The /tmp/plexinstaller.log gets removed with each restart. (/tmp is a ramdisk tmpfs)

if you run the install again, it will again log the output of preinstall (what it found)
which is what’s passed to pass 2 (postinstall)

May I see the actual override file please?
It may declare itself loaded but spelling errors are not detected by systemd.

Here is the log after a remove/install again:

Plex Media Server installation configuration info: Sat 31 Oct 17:43:40 GMT 2020

Init=0
Systemd=1
Custom=0
LinuxContainer=0
NewInstall=0
HaveOverride=1
OverrideFile="/etc/systemd/system/plexmediaserver.service.d/override.conf"
PlexUser=“plex”
PlexGroup=“plex”
VideoGroup=“render”
AppSuppDir="/opt/plex/Plex/workdir/Library/Application Support"
PlexTempDir="/opt/plex/Plex/tmp"
LangEncoding=“en_US.UTF-8”
ExistingVersion=0
HaveHardware=1
HaveTranscoderPref=0
NeedUser=0
NeedGroup=0
NeedVideo=0
Verbose=1
Running=0
Errors=0
Warnings=0
Platform=“Aspire V3-372”
Processor=“Intel® Core™ i5-6200U CPU @ 2.30GHz”
Distro=“Debian GNU/Linux bullseye/sid”
Kernel=“Linux debian 5.9.0-1-amd64 #1 SMP Debian 5.9.1-1 (2020-10-17) x86_64 GNU/Linux”
Memory=“7860 2780 2641”

override.conf.gz (159 Bytes)

Ok… let’s check one (arguably dumb) thing which impacts network share mounts. It might just apply to you too here.

  1. stop Plex and anything else using /opt
  2. unmount /opt
  3. Check the permissions of the mount point in the root /opt

I am suggesting this because network access will fail to access media (user plex is unprivileged) if the base filesystem mount point dir doesn’t allow access.

As dumb as it sounds, but it indeed was the mount point. I did check it myself but only when the fs was not mounted. In that case it was root:root 755 (as I intended). But when the fs was mounted I did not check it. And after the mounting it was root:root 700… After making it sure that it is also root:root 755 when mounted, the server started up correctly.

Care to change the thread title: “PEBKAC: borked mount point permissions” :rofl:

Glad you got it resolved

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