Plexmediaserver.service fails to start after upgrade to 1.18.9.2571

uname -a:
Linux tivo 5.4.0-4-amd64 #1 SMP Debian 5.4.19-1 (2020-02-13) x86_64 GNU/Linux

cat /etc/os-release:
PRETTY_NAME=“Debian GNU/Linux bullseye/sid”
NAME=“Debian GNU/Linux”
ID=debian
HOME_URL=“https://www.debian.org/
SUPPORT_URL=“https://www.debian.org/support
BUG_REPORT_URL=“https://bugs.debian.org/

plexmediaserver.service: Failed with result ‘exit-code’.
plexmediaserver.service: Control process exited, code=exited, status=217/USER
plexmediaserver.service: Failed at step USER spawning /bin/sh: No such process
plexmediaserver.service: Failed to determine user credentials: No such process

Plex Media Server installation configuration info: Fri Mar 27 22:08:45 EET 2020

Init=0
Systemd=1
LinuxContainer=0
NewInstall=0
HaveOverride=0
OverrideFile=""
PlexUser=“plex”
PlexGroup=“plex”
VideoGroup=“video”
AppSuppDir="/var/lib/plexmediaserver/Library/Application Support"
PlexTempDir="/var/lib/plexmediaserver/tmp_transcoding"
LangEncoding=“en_US.UTF-8”
ExistingVersion=11809
HaveHardware=1
NeedUser=0
NeedGroup=0
NeedVideo=0
Verbose=1
Running=1

btw i noticed that there is no version in os-release(as queried by plexmediaserver.service)

This line is disturbing

plexmediaserver.service: Failed at step USER spawning /bin/sh: No such process
plexmediaserver.service: Failed to determine user credentials: No such process

It presumes user plex is the username,
it knows this is a reinstall on top of itself (existing = 1.18.9)

Need User, Group, Video are all zero (nothing needs to be created)

when you run the installation, what does the console output look like?

Did you customize something?

nothings customized afaik.

let’s see what journalctl is complaining about ?

sudo journalctl -xe | grep -i plex

you’ll want to scroll through it.

Next, look for the obvious like directory permissions.

If nothing jumps out at you, give it the sledgehammer anyway :slight_smile:

sudo chown -R plex:plex /var/lib/plexmediaserver

did recursive chown, dirs 755 files 644 allready.
grep plex /etc/passwd: plex:x:110:114::/usr/lib/plexmediaserver:/bin/bash

for the sake of it i exported all vars globally:
plex@tivo:/$ export | grep PLEX
declare -x PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"
declare -x PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver"
declare -x PLEX_MEDIA_SERVER_INFO_DEVICE=“PC”
declare -x PLEX_MEDIA_SERVER_INFO_MODEL=“x86_64”
declare -x PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=“11”
declare -x PLEX_MEDIA_SERVER_INFO_VENDOR=“Debian GNU/Linux”
declare -x PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=“6”
declare -x PLEX_MEDIA_SERVER_TMPDIR="/tmp"

and started with:
plex@tivo:/$ LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib /usr/lib/plexmediaserver/Plex\ Media\ Server

and everything works !!!

Mar 28, 2020 09:25:48.976 [0x7f3206dc0700] INFO - Plex Media Server v1.18.9.2571-e106a8a91 - Debian GNU/Linux PC x86_64 - build: linux-x86_64 debian - GMT 02:00
Mar 28, 2020 09:25:48.976 [0x7f3206dc0700] INFO - Linux version: 11, language: en-US
Mar 28, 2020 09:25:48.976 [0x7f3206dc0700] INFO - Processor Intel® Core™ i5-4460 CPU @ 3.20GHz
Mar 28, 2020 09:25:48.976 [0x7f3206dc0700] INFO - /usr/lib/plexmediaserver/Plex Media Server
etc…

considering everything worked before the upgrade, and manually starting works, i think the service file is the culprit.
perhaps a dash<->bash escaping problem ?

root@tivo:~# l /bin/sh
lrwxrwxrwx 1 root root 4 Mar 28 09:36 /bin/sh -> bash

We have always used /bin/sh as the shell for that little bit when launching PMS.

There should be no shell for user plex (which you show in your /etc/passwd)

Why are you using these bash statements?

that way i declared vars in profile on login. its just for me to not using the ExecStart with grepping. like i wrote, there is no Version in debians os-release for example
root@tivo:~# cat /etc/os-release
PRETTY_NAME=“Debian GNU/Linux bullseye/sid”
NAME=“Debian GNU/Linux”
ID=debian
HOME_URL=“https://www.debian.org/
SUPPORT_URL=“https://www.debian.org/support
BUG_REPORT_URL=“https://bugs.debian.org/

I’m trying to figure out what your intent is.

Are you intending to have a login account with the same UID/GID as the plex service UID/GID? If you are, creating an overloaded entry in /etc/passwd is far easier.

As you have it defined,

plex:x:110:114::/usr/lib/plexmediaserver:/bin/bash

is going to launch bash. This will fail every time.
It’s also not how user plex was created. (you forgot about this customization)

changed to: plex:x:110:114::/usr/lib/plexmediaserver:/usr/sbin/nologin
works now thank you
btw the user was created years ago, i dont even remember when, and always worked.
nvm, thanks for your help

1 Like

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