1.23.2.4656 update makes PMS inaccessible until restart

The last scheduled trim run on the SSD in the NUC was yesterday:

root@nuc:~# systemctl status fstrim.service
● fstrim.service - Discard unused blocks on filesystems from /etc/fstab
   Loaded: loaded (/lib/systemd/system/fstrim.service; static; vendor preset: enabled)
   Active: inactive (dead) since Mon 2021-07-12 00:00:25 PST; 2 days ago
     Docs: man:fstrim(8)
 Main PID: 32133 (code=exited, status=0/SUCCESS)

Jul 12 00:00:00 nuc systemd[1]: Starting Discard unused blocks on filesystems from /etc/fstab...
Jul 12 00:00:25 nuc fstrim[32133]: /mnt/storage: 124.3 GiB (133443178496 bytes) trimmed on /dev/disk/by-id/ata-Samsung_SSD_860_EVO_2TB_S3YUNB0K800736V-part1
Jul 12 00:00:25 nuc fstrim[32133]: /var: 3.9 GiB (4199301120 bytes) trimmed on /dev/nvme0n1p3
Jul 12 00:00:25 nuc fstrim[32133]: /tmp: 208.2 MiB (218300416 bytes) trimmed on /dev/nvme0n1p5
Jul 12 00:00:25 nuc fstrim[32133]: /home: 96.5 GiB (103631847424 bytes) trimmed on /dev/nvme0n1p6
Jul 12 00:00:25 nuc fstrim[32133]: /boot/efi: 493.7 MiB (517681152 bytes) trimmed on /dev/nvme0n1p1
Jul 12 00:00:25 nuc fstrim[32133]: /: 325.4 MiB (341172224 bytes) trimmed on /dev/nvme0n1p2
Jul 12 00:00:25 nuc systemd[1]: fstrim.service: Succeeded.
Jul 12 00:00:25 nuc systemd[1]: Started Discard unused blocks on filesystems from /etc/fstab.

I never have SLOW QUERY unless i just beat the CR*P out of the DB and the CPU is now overloaded adding more media.

It’s really difficult to make it happen.

How old is that SSD? What percentage of life is remaining? What’s the SSD make and P/N?

This CPU is nowhere close from being overloaded at any point. There’s got to be something going on here.

The whole NUC (and all its components) is less than a year old. I’m using a WD Black SN750 250GB NVMe SSD (WDS250G3X0C-00SJG0). Here’s its SMART info:

root@nuc:~# smartctl --all /dev/nvme0n1
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.0-0.bpo.7-amd64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       WDS250G3X0C-00SJG0
Serial Number:                      2029AE801958
Firmware Version:                   111110WD
PCI Vendor/Subsystem ID:            0x15b7
IEEE OUI Identifier:                0x001b44
Total NVM Capacity:                 250,059,350,016 [250 GB]
Unallocated NVM Capacity:           0
Controller ID:                      8215
NVMe Version:                       1.3
Number of Namespaces:               1
Namespace 1 Size/Capacity:          250,059,350,016 [250 GB]
Namespace 1 Formatted LBA Size:     512
Namespace 1 IEEE EUI-64:            001b44 8b49849dbe
Local Time is:                      Wed Jul 14 07:46:00 2021 PST
Firmware Updates (0x14):            2 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Log Page Attributes (0x0e):         Cmd_Eff_Lg Ext_Get_Lg Telmtry_Lg
Maximum Data Transfer Size:         128 Pages
Warning  Comp. Temp. Threshold:     84 Celsius
Critical Comp. Temp. Threshold:     88 Celsius
Namespace 1 Features (0x02):        NA_Fields

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     5.00W       -        -    0  0  0  0        0       0
 1 +     3.50W       -        -    1  1  1  1        0       0
 2 +     3.00W       -        -    2  2  2  2        0       0
 3 -   0.0700W       -        -    3  3  3  3     4000   10000
 4 -   0.0025W       -        -    4  4  4  4     4000   40000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         2
 1 -    4096       0         1

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        33 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    2%
Data Units Read:                    2,086,050 [1.06 TB]
Data Units Written:                 12,783,878 [6.54 TB]
Host Read Commands:                 27,438,090
Host Write Commands:                46,410,089
Controller Busy Time:               192
Power Cycles:                       178
Power On Hours:                     1,445
Unsafe Shutdowns:                   108
Media and Data Integrity Errors:    0
Error Information Log Entries:      1
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0

Error Information (NVMe Log 0x01, 16 of 256 entries)
No Errors Logged

If it’s not the CPU, and not the SSD, then it has to be media - other I/O.

There are only 3 pieces here:

  1. CPU not maxed on a single-thread (I hope)
  2. The database isn’t so large the link lists are too long (which takes time with SSD or HDD)
  3. The database and metadata are all local on the SSD. Media doesn’t cause SLOW QUERY.

It makes no sense for a bare machine installation to be this way.

It truly has me baffled.

3rd-party plug-ins ?

What do you mean “media / other I/O”? Like you mentioned in #3, the media being in my Synology NAS and accessed by the NUC via NFS would not cause this, right?

Do I need to monitor and check if my any of the threads of my CPU are being maxed out?

Is there a workaround to the long link lists because of a small DB?

No third party plugins at all. I use docker on the NUC but I only have a couple of containers. Can rsnapshot interfere? I have it scheduled to backup my OS dir (including /home) but that happens only at night.

@ChuckPa how do I fix the update issue in the NUC?

“update issue” ??

Confused here. Have I forgotten something?

If you check my original post in this thread, my main issue is that PMS is inaccessible after it gets updated automatically by the plexupdate script whenever there’s a new version that’s out. After the update, the install logs say everything is good and the service is active and started but PMS is still inaccessible until I manually restart the service. This only happens in the NUC PMS. I have the same update script in my Debian box and it never had this issue.

Is that the ’ MrWorf’s script to get and install the update?

while not a major issue, do you see the problem in your override file?

/etc/systemd/system/plexmediaserver.service.d/override.conf:4: Failed to parse mode value, ignoring: 0002 # this must be octal - See warning below

There is a typing error in there somewhere.

The package control scripts

  1. Get current run status
  2. Stop the package
  3. Install the update
  4. Restart if previously running

So what is Debian 10 doing that all others before it don’t?

i don’t understand. I don’t know what it’s hanging up on.

I will look at this tomorrow. I need to recreate if I can

Yes, that’s MrWorf’s script.

Yes, I do have that issue for the override files of both boxes (both have Debian 10 OS) and I don’t know how to fix it. This is what I have:

# This is needed to change the default umask
UMask=0002    # this must be octal    - See warning below

I already tried using Umask and 002 but it still gives out that error. But I figured that I don’t have the correct syntax?

Well, they’re both Debian 10 boxes. One is a NUC and one is a custom-made box with an ASRock board. The update runs around 6AM, I believe, and the NUC is just idle at that state since no one is using Plex/Roon on the server. The plexupdate logs shows success everywhere. And the weird thing is, during the last version release, I decided to manually run plexupdate and it worked just fine (no issues).

How do I correctly test if the umask syntax is working anyway? When I restart plexmediaserver.service and check its staus, I really can’t reproduce the error.

Kevin,

Debian 10.9 - all updates & restarted

No UMask errors

Recommend deleting the line, save the file, open again and add again.

You check umask by examining the files written.

Umask = 002 writes text file perms set a 664 (masks off the low (other) write bit)
Umask = 022 writes text file perms set to 644 (masks off group and other write bit)

(exclusive NAND operation)

Ok, I’ll do that. But for what it’s worth, when I restart the service while keeping it at “UMask=0002”, I can’t reproduce the error. So I don’t know when does the error really appear.

Before editing the file (UMask=0002):

root@epsilon:~# systemctl status plexmediaserver.service
● 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: active (running) since Tue 2021-07-20 00:18:23 PST; 3s ago
  Process: 30467 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERV
 Main PID: 30469 (Plex Media Serv)
    Tasks: 66 (limit: 4915)
   Memory: 94.9M
   CGroup: /system.slice/plexmediaserver.service
           ├─30469 /usr/lib/plexmediaserver/Plex Media Server
           ├─30494 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-bc4dd58bb/Framework.bundle/Contents/Resourc
           ├─30540 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Res
           └─30585 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-bc4dd58bb/Framework.bundle/Contents/Re

Jul 20 00:18:23 epsilon systemd[1]: Starting Plex Media Server...
Jul 20 00:18:23 epsilon systemd[1]: Started Plex Media Server.

After editing the file (UMask=002):

root@epsilon:~# systemctl status plexmediaserver.service
● 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: active (running) since Tue 2021-07-20 02:15:58 PST; 55s ago
  Process: 10679 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERV
 Main PID: 10681 (Plex Media Serv)
    Tasks: 65 (limit: 4915)
   Memory: 102.3M
   CGroup: /system.slice/plexmediaserver.service
           ├─10681 /usr/lib/plexmediaserver/Plex Media Server
           ├─10708 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-bc4dd58bb/Framework.bundle/Contents/Resourc
           ├─10759 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Res
           └─10810 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-bc4dd58bb/Framework.bundle/Contents/Re

Jul 20 02:15:58 epsilon systemd[1]: Starting Plex Media Server...
Jul 20 02:15:58 epsilon systemd[1]: Started Plex Media Server.

Not really seeing the error before or after.

Which version of Debian? I tested using 10.9

Are they changing systemd ?

How it shows up in previous logs but not now is a problem because it also points to underlying reasons it won’t work when restarted by that same script but works when restarted by hand.

I’ve tested on two Debian 10.10 boxes.

Here’s what I see with that dpkg command:

root@nuc:~# dpkg -l | grep systemd
ii  dbus-user-session                    1.12.20-0+deb10u1                       amd64        simple interprocess messaging system (systemd --user int                  egration)
ii  libnss-systemd:amd64                 241-7~deb10u7                           amd64        nss module providing dynamic user and group name resolut                  ion
ii  libpam-systemd:amd64                 241-7~deb10u7                           amd64        system and service manager - PAM module
ii  libsystemd0:amd64                    241-7~deb10u7                           amd64        systemd utility library
ii  systemd                              241-7~deb10u7                           amd64        system and service manager
ii  systemd-sysv                         241-7~deb10u7                           amd64        system and service manager - SysV links

Could it be the underlying cause of the update issue? So using UMask=002 should solve it?

Umask is not required at all UNLESS you want to alter the “Group” permissions for files PMS writes.

Group access is only of use when

  1. PMS records media (writing as plex:plex) and you don’t want to change the ownership/permissions in order to play anything.

  2. PMS optimizes media , where the same “write permissions” apply.

Otherwise, you can simply remove it from the override. Doing so gives you the system default of 022

Ok. Here we go again with the issue. There is a new version and plexupdate triggered again a few hours ago. Here are the logs:

Jul 20 06:25:03 nuc plexupdate: Retrieving list of available distributions
Jul 20 06:25:04 nuc plexupdate: Downloading release "plexmediaserver_1.23.5.4841-549599676_amd64.deb"
Jul 20 06:25:06 nuc plexupdate: File downloaded
Jul 20 06:25:06 nuc plexupdate: (Reading database ... 104347 files and directories currently installed.)
Jul 20 06:25:06 nuc plexupdate: Preparing to unpack .../plexmediaserver_1.23.5.4841-549599676_amd64.deb ...
Jul 20 06:25:06 nuc systemd[1]: Stopping Plex Media Server...
Jul 20 06:25:07 nuc systemd[1]: plexmediaserver.service: Succeeded.
Jul 20 06:25:07 nuc systemd[1]: Stopped Plex Media Server.
Jul 20 06:25:07 nuc plexupdate: PlexMediaServer install: Pre-installation Validation.
Jul 20 06:25:07 nuc root: PlexMediaServer install: Pre-installation Validation.
Jul 20 06:25:07 nuc plexupdate: PlexMediaServer install: Pre-installation Validation complete.
Jul 20 06:25:07 nuc logger[28426]: PlexMediaServer install: Pre-installation Validation complete.
Jul 20 06:25:07 nuc plexupdate: Unpacking plexmediaserver (1.23.5.4841-549599676) over (1.23.5.4801-bc4dd58bb) ...
Jul 20 06:25:12 nuc plexupdate: Setting up plexmediaserver (1.23.5.4841-549599676) ...
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install: PlexMediaServer-1.23.5.4841-549599676 - Installation starting.
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install: Now installing based on:
Jul 20 06:25:12 nuc logger[28612]: PlexMediaServer install: Now installing based on:
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Installation Type:   Update
Jul 20 06:25:12 nuc logger[28619]: PlexMediaServer install:   Installation Type:   Update
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Process Control:     systemd
Jul 20 06:25:12 nuc logger[28621]: PlexMediaServer install:   Process Control:     systemd
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Plex User:           plex
Jul 20 06:25:12 nuc logger[28623]: PlexMediaServer install:   Plex User:           plex
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Plex Group:          plex
Jul 20 06:25:12 nuc logger[28625]: PlexMediaServer install:   Plex Group:          plex
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Video Group:         render
Jul 20 06:25:12 nuc logger[28627]: PlexMediaServer install:   Video Group:         render
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Metadata Dir:        /home/plex/Library/Application Support
Jul 20 06:25:12 nuc logger[28629]: PlexMediaServer install:   Metadata Dir:        /home/plex/Library/Application Support
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Temp Directory:      /home/plex/Transcode
Jul 20 06:25:12 nuc logger[28631]: PlexMediaServer install:   Temp Directory:      /home/plex/Transcode
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
Jul 20 06:25:12 nuc logger[28633]: PlexMediaServer install:   Lang Encoding:       en_US.UTF-8
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Config file used:    /etc/systemd/system/plexmediaserver.service.d/override.conf
Jul 20 06:25:12 nuc logger[28645]: PlexMediaServer install:   Config file used:    /etc/systemd/system/plexmediaserver.service.d/override.conf
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Intel i915 Hardware: Found
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Nvidia GPU card:     Not Found
Jul 20 06:25:12 nuc logger[28649]: PlexMediaServer install:   Nvidia GPU card:     Not Found
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:
Jul 20 06:25:12 nuc logger[28651]: PlexMediaServer install:
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   OpenCL:              Installed
Jul 20 06:25:12 nuc logger[28653]: PlexMediaServer install:   OpenCL:              Installed
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Intel Gmmlib:        Installed
Jul 20 06:25:12 nuc logger[28655]: PlexMediaServer install:   Intel Gmmlib:        Installed
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Intel IGC Core:      Installed
Jul 20 06:25:12 nuc logger[28657]: PlexMediaServer install:   Intel IGC Core:      Installed
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Intel IGC OpenCL:    Installed
Jul 20 06:25:12 nuc logger[28659]: PlexMediaServer install:   Intel IGC OpenCL:    Installed
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Intel OpenCL:        Installed
Jul 20 06:25:12 nuc logger[28661]: PlexMediaServer install:   Intel OpenCL:        Installed
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Intel OCLoc:         Installed
Jul 20 06:25:12 nuc logger[28663]: PlexMediaServer install:   Intel OCLoc:         Installed
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:   Intel Zero GPU:      Installed
Jul 20 06:25:12 nuc logger[28665]: PlexMediaServer install:   Intel Zero GPU:      Installed
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install:
Jul 20 06:25:12 nuc logger[28667]: PlexMediaServer install:
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install: Completing final configuration.
Jul 20 06:25:12 nuc logger[28669]: PlexMediaServer install: Completing final configuration.
Jul 20 06:25:12 nuc systemd[1]: Reloading.
Jul 20 06:25:12 nuc systemd-udevd[28710]: Using default interface naming scheme 'v240'.
Jul 20 06:25:12 nuc systemd-udevd[28719]: Using default interface naming scheme 'v240'.
Jul 20 06:25:12 nuc systemd[1]: /lib/systemd/system/smbd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/samba/smbd.pid → /run/samba/smbd.pid; please update the unit file accordingly.
Jul 20 06:25:12 nuc systemd[1]: /lib/systemd/system/nmbd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/samba/nmbd.pid → /run/samba/nmbd.pid; please update the unit file accordingly.
Jul 20 06:25:12 nuc systemd[1]: /lib/systemd/system/rpc-statd.service:13: PIDFile= references path below legacy directory /var/run/, updating /var/run/rpc.statd.pid → /run/rpc.statd.pid; please update the unit file accordingly.
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install: Starting Plex Media Server.
Jul 20 06:25:12 nuc logger[28798]: PlexMediaServer install: Starting Plex Media Server.
Jul 20 06:25:12 nuc systemd[1]: Starting Plex Media Server...
Jul 20 06:25:12 nuc systemd[1]: Started Plex Media Server.
Jul 20 06:25:12 nuc plexupdate: PlexMediaServer install: PlexMediaServer-1.23.5.4841-549599676 - Installation successful.  Errors: 0, Warnings: 0
Jul 20 06:25:12 nuc logger[28816]: PlexMediaServer install: PlexMediaServer-1.23.5.4841-549599676 - Installation successful.  Errors: 0, Warnings: 0
Jul 20 06:25:12 nuc plexupdate: Processing triggers for mime-support (3.62) ...
Jul 20 06:25:14 nuc ModemManager[614]: <info>  [base-manager] couldn't check support for device '/sys/devices/pci0000:00/0000:00:1f.6': not supported by any plugin
Jul 20 06:37:04 nuc systemd[1]: Starting Daily apt upgrade and clean activities...

I don’t see the UMask issue in the logs anymore so I guess the change we did earlier fixed that but that wasn’t the cause of the update issue. It’s 11:46AM now and I just noticed that the NUC PMS is down again. I restarted it and PMS went back online. Any more ideas?

I am clueless.

The moment you remove that script from the equation, PMS works.

All things being equal; Remove one item and software works again does point to the item which was removed.

Why? I have no clue.

Is it doing something stupid with STDOUT / STDERR ?

I have no idea since this is a headless server and is remote to me. What baffles me is if I run the script manually to do the update, it doesn’t reproduce the issue. I’ll try and contact MrWorf and see if he can help me with this but since that script seems to be abandoned I’m not really keeping my hopes high.

Is there any other way to do automatic updates for PMS in Linux installation? i remember you can integrate it with apt but not if you use beta versions.

Normal apt uses public repositories.

By Plex design, Beta/PlexPass is manual.

The amount of delay between beta and public is HOW LONG?

The question must be asked: What is the real gain here?

  1. Automatic updates through the OS
    -or-
  2. Latest Plex version - those with issues included.

It’s a decision only you can make.

Cake? or Dinner? Please choose one :slight_smile: