Server keep "crashing" since last few beta updates

Is user plex the admin/default/account-used-to-install-Ubuntu ?

Yes that’s the only user

Damn,

Now I know why it’s all frogged up.

Ubuntu NEVER works well this way.

All the OS-isms interfere.

Easiest solution is to move PMS to a new username and then add that username to group video.

It involves:

  1. A systemctl ‘override.conf’ file which I’ll write for you.
  2. chown -R :wink: of /var/lib/plexmediaserver
  3. Potential modification of permissions to media so the new UID has proper access

Thoughts?

sounds good, I could keep that “legacy-plex” user for the docker instances while using “new-plex” user for PMS only. My video folders are mounted over NFS where I remap any user to a specific one so it won’t blow up if I change the owner of PMS

What I’m thinking (on the fly here)

  1. user plex because it’s your “Plex server”
  2. user pms to run “Plex Media Server”

with one hopefully less cranky than the other :wink:

yeah pms sounds good, gonna admit that the first idea that came to my mind was legitplex but it’s obnoxious on a second thought :rofl:

Your humor is warped. I like it :stuck_out_tongue: lol

Please find for me which nologin ?

Please find for me which nologin ?

/usr/sbin/nologin

PMS is stopped ?

when I’ve typed the which command? : no, same result if pms is stopped.

Else I’ve just stopped pms rn

Here we go:
(Let me proof read this again after I post. I don’t want any errors)

AS ROOT (sudo bash)

systemctl stop plexmediaserver
ps -ef | grep -i plex

## Make sure NO plex processes remain.   Kill if needed

# Create new user
useradd --system --shell /usr/sbin/nologin --home /var/lib/plexmediaserver "pms"
groupadd --system "pms"
usermod -g pms pms

# Add 'video' group to pms (we know by inspection)
usermod -a -G video pms

# Confirm  (should see 'pms video')
groups pms

# now change ownership of all  /var/lib/plexmediaserver
chown -R pms.pms /var/lib/plexmediaserver

# Create override for pms
mkdir /etc/systemd/system/plexmediaserver.service.d
cat > /etc/systemd/system/plexmediaserver.service.d/override.conf <<EOF
[Service]
User=pms
Group=pms
EOF

# You can pretty ^^ this up in a text editor if you want but we only 
# need change the username to 'pms:pms'

systemctl daemon-reload

# Systemctl should now recognize the 'override.conf' file
systemctl status plexmediaserver

# Let's start it.
systemctl start plexmediaserver

I’ve written the above so you can copy/paste to the terminal command line
# is obviously comment / info for you.

If there are any deviations…STOP

Stop before you systemctl start plexmediaserver
You can change any file permissions

(do one if needed as confirmation – perhaps “Other Videos” so we can test using the test files )

Ready ?

Ready ?

:rofl:

gonna stop if something isn’t expected after each command

Making progress ?

so

systemctl stop plexmediaserver
ps -ef | grep -i plex

## Make sure NO plex processes remain.   Kill if needed

:ok_hand:

# Create new user
useradd --system --shell /usr/sbin/nologin --home /var/lib/plexmediaserver "pms"

:ok_hand:

groupadd --system "pms"
usermod -g pms pms

:pinched_fingers: got some warning telling me that the group already exist with pms user in it, certainly the previous command auto-create/add new pms group while creating the user. I’ve checked the group and user and it was pms:pms so i continued

# Add 'video' group to pms (we know by inspection)
usermod -a -G video pms

:ok_hand:

# Confirm  (should see 'pms video')
groups pms

:ok_hand:

# now change ownership of all  /var/lib/plexmediaserver
chown -R pms.pms /var/lib/plexmediaserver

:ok_hand:

# Create override for pms
mkdir /etc/systemd/system/plexmediaserver.service.d
cat > /etc/systemd/system/plexmediaserver.service.d/override.conf <<EOF
[Service]
User=pms
Group=pms
EOF

# You can pretty ^^ this up in a text editor if you want but we only 
# need change the username to 'pms:pms'

:ok_hand: additionally called cat /etc/systemd/system/plexmediaserver.service.d/override.conf just to double check

systemctl daemon-reload
:ok_hand:

# Systemctl should now recognize the 'override.conf' file
systemctl status plexmediaserver

:ok_hand:

and I stopped there, I think I should change the user in autofs conf before starting pms:

On Ubuntu 22, you will get the warning about adding pms to group pms
(I forgot that – SORRY)

If you’re mounting NFS, Why are you doing it that way?

I do it this way: (sec=sys option)

  1. Mount the entire media volume on the NAS
# Master Media mount
192.168.0.20:/vol/media     /glock/media       nfs defaults,sec=sys,rw,auto,async,x-systemd.after=network-online.target,nofail,bg 0 0

– Mounted with sec=sys option so the NFS server changes to UID/GID permissions in the mounted filesystem
– On the server side,

— Dir = 0755 (everyone can read)
— File = 0644 (everyone can read)

Now, local PMS user can READ the NFS link without any fuss.

If you want to keep it your way, for now == :+1:

The basic test is confirm PMS starts and Media shows as (maybe?) unavailable

good point on NAS side I’m already in security=sys, my autofs conf on server side is maybe too legacy :slight_smile:

starting pms rn

It’s alive :tipping_hand_man::level_slider: :zap: :space_invader: :zap:

Libraries got the stuff at the right place and I can start a movie like nothing happened.

Should I redo the LG video watch then?

Play one of my videos in Plex/web for 30 seconds.

Stop Playback.

Download the Logs zip file

Attach.

Review time

Ok so for the LG file, 2nd pass:

Plex webapp (local):

  • Direct play : CPU under 5% ; no problem ; no glitch nor crash
  • Transcode (1080p@12mbps) : buffering every 10 sec for 15sec, CPU @85% and tautulli says transcoding speed is at 0.3 ; no glitch nor crash
  • Server didn’t crash afterward

more or less the same experience as the previous test

logs:
Plex Media Server Logs_2022-12-18_04-24-53.zip (271.9 KB)