Unknown Username, Unknown Group

For years I have been installing the updates on my Ubuntu server (18.04.1) without issue. Then recently (in the past 6 weeks) I had to start deleting the ‘plex’ user before the install or it would break (saying it already exists). Now, I am unable to update. Nothing has changed on my side (other than normal Ubuntu security patches). Now it tells me the user I have defined as the startup doesn’t exist. This is not true. It does exist and is running the the last version of Plex Server that I could get installed.

Preparing to unpack plexmediaserver_1.19.1.2630-72c16a276_amd64.deb …
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Error: Unknown username "plexmedia " used in “/etc/systemd/system/plexmediaserver.service.d/override.conf”.
PlexMediaServer install: Error: Unknown group "plexmedia " used in “/etc/systemd/system/plexmediaserver.service.d/override.conf”.
PlexMediaServer install:
PlexMediaServer install: Pre-installation Validation failed.
PlexMediaServer install: Configuration information discovered:
PlexMediaServer install: Installation Type: New
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: video
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /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: Pre-installation Validation complete. Errors: 2, Warnings: 0
dpkg: error processing archive plexmediaserver_1.19.1.2630-72c16a276_amd64.deb (–install):
new plexmediaserver package pre-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.27-3ubuntu1) …
Errors were encountered while processing:
plexmediaserver_1.19.1.2630-72c16a276_amd64.deb

The installation script is telling you that it found plexmedia but couldn’t lookup the UID & GID.

In that situation, it does as it did, which is what systemd will do, and ignore it.

what should be happening. Which version are you upgrading from?

May I see your override file’s contents?
Also, may I see the definition lines for plex and plexmedia from /etc/passwd?

Thanks ChuckPA,

I am upgrading over version 1.18.9.2578

Override file:

[Service]

User=plexmedia
Group=plexmedia

UMask=0002

passwd:

plexmedia:x:1000:1000:PlexMedia:/home/plexmedia:/bin/bash

Plex is not there since I deleted it (as stated that was the only way to get the previous few updates to install). This is what it looked like a few days before from a backup:

plex:x:997:997::/var/lib/plexmediaserver:/usr/sbin/nologin

What are you installing this on / in?

Of all the cases I’ve tested against, this is the first failure.
I need to understand what’s happening here.

If user plex doesn’t exist, it will be forcibly created. ( a requirement )

Would you mind grabbing the /tmp/plexinstaller.log file please?
That will tell me everything pre-install found.

Not sure I understand the first question.

I don’t see a log in /tmp. I did a quick search in some other common areas and couldn’t find it.

You rebooted after the install?
The plexinstaller.log is written to /tmp. I use it to pass information from preinstall to postinstall. Most distros have /tmp as a ramfs (all contents lost at reboot).

Would you mind rerunning the install again then grabbing the file?

I restarted and re-ran the install. Still nothing in /tmp

The following packages will be upgraded:
plexmediaserver
1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0 B/90.9 MB of archives.
After this operation, 150 kB of additional disk space will be used.
Get:1 /home/plexmedia/Shared/plexmediaserver_1.19.1.2630-72c16a276_amd64.deb plexmediaserver amd64 1.19.1.2630-72c16a276 [90.9 MB]
(Reading database … 337189 files and directories currently installed.)
Preparing to unpack …/plexmediaserver_1.19.1.2630-72c16a276_amd64.deb …
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Error: Unknown username "plexmedia " used in “/etc/systemd/system/plexmediaserver.service.d/override.conf”.
PlexMediaServer install: Error: Unknown group "plexmedia " used in “/etc/systemd/system/plexmediaserver.service.d/override.conf”.
PlexMediaServer install:
PlexMediaServer install: Pre-installation Validation failed.
PlexMediaServer install: Configuration information discovered:
PlexMediaServer install: Installation Type: New
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: video
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /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: Pre-installation Validation complete. Errors: 2, Warnings: 0
dpkg: error processing archive /home/plexmedia/Shared/plexmediaserver_1.19.1.2630-72c16a276_amd64.deb (–unpack):
new plexmediaserver package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/home/plexmedia/Shared/plexmediaserver_1.19.1.2630-72c16a276_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

plexmedia@mediaserver:~/Shared$ ls -l /tmp
total 0
prwx------ 1 emby emby 0 Apr 8 10:07 clr-debug-pipe-564-929767-in
prwx------ 1 emby emby 0 Apr 8 10:07 clr-debug-pipe-564-929767-out
srw------- 1 emby emby 0 Apr 8 10:07 dotnet-diagnostic-564-929767-socket
drwxr-xr-x 2 plexmedia plexmedia 60 Apr 8 07:33 hsperfdata_plexmedia
drwxr-xr-x 2 root root 60 Apr 8 07:33 hsperfdata_root
drwxrwxr-x 2 plexmedia plexmedia 40 Apr 8 07:33 pms-9ac55f3e-1847-4cfe-9645-c3247a4afac4
drwx------ 3 root root 60 Apr 8 07:33 snap.canonical-livepatch
drwx------ 3 root root 60 Apr 8 07:33 systemd-private-ceb0995d9dd74ddf969ca37f12d7a15d-ModemManager.service-Iurnec
drwx------ 3 root root 60 Apr 8 07:33 systemd-private-ceb0995d9dd74ddf969ca37f12d7a15d-systemd-resolved.service-eHpgj8
drwx------ 3 root root 60 Apr 8 07:33 systemd-private-ceb0995d9dd74ddf969ca37f12d7a15d-systemd-timesyncd.service-Zs3l0u
drwxrwxr-x 3 plexmedia plexmedia 60 Apr 8 09:47 Transcode
-rw-r–r-- 1 root root 0 Apr 8 10:56 webminstats.lastrun

Any other thoughts on this issue? I’d like to stay somewhat current but cannot at this point. Thanks.

Still an issue but I did work around it by temporarily allowing Plex to run as the default user. I then switched it back, updated and restarted the service.

I am very explicit in what I report.

Preparing to unpack …/plexmediaserver_1.19.1.2630-72c16a276_amd64.deb …
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Error: Unknown username "plexmedia " used in “/etc/systemd/system/plexmediaserver.service.d/override.conf”.
PlexMediaServer install: Error: Unknown group "plexmedia " used in “/etc/systemd/system/plexmediaserver.service.d/override.conf”.
PlexMediaServer install:

Notice the trailing SPACE within the quotes?
Was the file modified with a Windows text editor ?
Is there an invisible TAB character at the end of the line?

what does the override.conf show?

PS: Apologies for the delay. I did not receive notification until just now.

PPS: If I do not reply to issues in a timely manner, please @chuckpa ping me. Thanks.

DOH! I bet that is it. There are spaces at the end of the names in the overide.conf.

I’ll test it when I get the next release but I’m pretty sure you nailed it. Sometimes it takes another set of eyes. Thank you!

That’s why I put quotes around all the values. If there’s anything strange, quotes make it MUCH more visible.