Unable to install PMS 1.7.5 (non container) on Ubuntu

server-linux

#1

This discussion was created from comments split from: Can't install Plex 1.7.5 on Ubuntu 16.04.


#2

I'm still having a problem

Setting up plexmediaserver (1.7.6.4058-8fa494d15) ...
Usage: usermod [options] LOGIN

Options:
-c, --comment COMMENT new value of the GECOS field
-d, --home HOME_DIR new home directory for the user account
....truncated the rest of the usermod help menu.....
dpkg: error processing package plexmediaserver (--install):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
plexmediaserve

on Ubuntu 16.10... doesn't matter if I move udevadm... is this related to the other problem or something new?


#3

@nathangl said:
I'm still having a problem

Setting up plexmediaserver (1.7.6.4058-8fa494d15) ...
Usage: usermod [options] LOGIN

Options:
-c, --comment COMMENT new value of the GECOS field
-d, --home HOME_DIR new home directory for the user account
....truncated the rest of the usermod help menu.....
dpkg: error processing package plexmediaserver (--install):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
plexmediaserve

on Ubuntu 16.10... doesn't matter if I move udevadm... is this related to the other problem or something new?

What you're showing doesn't appear to be related to anything done with postinst.

What has been changed with plex username on your system? Can you please show me grep plex /etc/passwd ; grep plex /etc/group


#4

plex:x:124:133::/var/lib/plexmediaserver:/bin/bash
plex:x:133:

haven't made any changes to the system.. can't figure it out..


#5

Thanks for that output.

You don't have a video group, do you? No graphics adapters?

[chuck@lizum ~/ubuntu.125]$ grep plex /etc/passwd /etc/group
/etc/passwd:plex:x:1029:1027:RPM Created PlexUser:/var/lib/plexmediaserver:/sbin/nologin
/etc/group:video:x:39:plex
/etc/group:plex:x:1027:
[chuck@lizum ~/ubuntu.126]$ 

#6

I do..

video:x:44:nathan

Tried adding plex but still had the same issues with install..


#7

I do not mean to be pedantic but need ask:

  1. Is this a clean Ubuntu 16.10 install or an upgrade?
  2. PMS is still in /var/lib/plexmediaserver ?
  3. Is this in a LXC or Docker ?

I have tried every way I know to this point short of LXC and docker and cannot replicate the problem hence my questions.


#8

My > @ChuckPA said:

I do not mean to be pedantic but need ask:

  1. Is this a clean Ubuntu 16.10 install or an upgrade?
  2. PMS is still in /var/lib/plexmediaserver ?
  3. Is this in a LXC or Docker ?

I have tried every way I know to this point short of LXC and docker and cannot replicate the problem hence my questions.

No problem. I was incorrect I'm just running 16.04 I was mistaken that I had upgraded. PMS is still in /var/lib/plexmediaserver correct, and there is no LXC/Docker.


#9

@nathangl

There is something VERY strange about your machine. You are running as root when doing this ? (sorry, just being ABSOLUTE pedantic).

To date, I've not encountered this for anyone unless there is a host-level corruption


#10

Thanks for splitting into new topic. Secondly, definitely running as root. Yeah I am perplexed by this, all upgrades have always gone smoothly and it was the first time when upgrading to 1.7.5 that I experienced this. On 16.04 LTS as mentioned in the other thread. I haven't changed anything with my system aside from the usual updates...


#11

I tried everything I could to replicate your problem. Between my efforts and all the other Ubuntu users who aren't in a Container, you're the first I've seen to have the issue where usermod complains as it does. Usermod works by manipulating the files themselves directly. It's not a complex program.

One of these two statements in postinst is failing

[chuck@lizum ~/ubuntu.148]$ grep usermod *
postinst:     usermod -a -G "$USER" "$USER"
postinst:     usermod -a -G ${VGROUP} ${PUSER}
[chuck@lizum ~/ubuntu.149]$ 

Since you don't see this error, we can safely (?) conclude it's not $USER

if ! getent group "$USER" >/dev/null; then
groupadd "$USER"
usermod -a -G "$USER" "$USER"
fi

Therefore it must be below this point.

Do you have any of these old files laying around?

OVERRIDE=/etc/systemd/system/plexmediaserver.service.d/override.conf
OLDSERVICE=/etc/systemd/system/plexmediaserver.service
OLDINIT=/etc/default/plexmediaserver

If so, please check for the Plex username. I'm starting to suspect a degenerate case the dev and I didn't plan on. (which is REALLY weird)

# If the user added a username override we check for that instead of defaulting to user plex
if [ "`cat /proc/1/comm`" = "systemd" ]; then
  if [ -f $OVERRIDE ]; then
    if [ "`grep "^User=" $OVERRIDE|wc -l`" = "1" ]; then
      PUSER="`grep "^User" $OVERRIDE|cut -d= -f2`"
    fi
  elif [ -f $OLDSERVICE ]; then
    if [ "`grep "^User=" $OLDSERVICE|wc -l`" = "1" ]; then
      PUSER="`grep "^User" $OLDSERVICE|cut -d= -f2`"
    fi
  fi
elif [ -f $OLDINIT ]; then
  if [ "`grep "^User=" $OLDINIT|wc -l`" = "1" ]; then
    PUSER="`grep "^export PLEX_MEDIA_SERVER_USER=" $OLDINIT|cut -d= -f2`"
  fi
fi


#12

Was just going through the postinst script. I have the override.conf file. The logic it follows on my system is as follows:

  • it has systemd in /proc/1/comm and the override file exists but this is the structure within it, so the User = returns 3

Environment=PLEX_MEDIA_SERVER_NewTmp=""
User=
new_plex_username
nathan
Group=
new_plex_group
nathan

I can see now that the cut -d= -f2 is returning a blank because the username is on the next line... I'm not sure why this error occured but I can only assume if I remove the override file or change the User= to User=plex this should go through successfully?


#13

fyi confirmed that setting User=plex in the override file fixes the problem... not sure when the override.conf changed but I know I did not make that change..


#14

In any case it is much appreciated for your assistance thank you!!!!


#15

Please mark the answer and close the thread?


#16

Commenting here before closing this out,

User=newusername
Group=newgroupname

Empty entries are not allowed as it will result in the error condition shown above


#17

@nathangl said:
Was just going through the postinst script. I have the override.conf file. The logic it follows on my system is as follows:

it has systemd in /proc/1/comm and the override file exists but this is the structure within it, so the User = returns 3

Environment=PLEX_MEDIA_SERVER_NewTmp=""
User=
new_plex_username
nathan
Group=
new_plex_group
nathan

I can see now that the cut -d= -f2 is returning a blank because the username is on the next line... I'm not sure why this error occured but I can only assume if I remove the override file or change the User= to User=plex this should go through successfully?

I did what Nathan said.

I simply added plex in front of 'User=' on the same line. Kept everything the same.
My config did not have anything extra.

This is what it looks like now, and the install worked.

Environment=PLEX_MEDIA_SERVER_NewTmp=""
User=plex
new_plex_username
Group=
new_plex_group


#18

@bencmeyer said:

This is what it looks like now, and the install worked.
Environment=PLEX_MEDIA_SERVER_NewTmp=""
User=plex
new_plex_username <---------- REMOVE THIS .. it will spit errors every time
Group= <------- FIX This Group=new_group_name_on_same_line
new_plex_group