Plex Server going into Server Setup mode

Not sure if the database got corrupted but now my Plex server is not available on plex.tv, but it is running. If I go to localhost:32400/web it starts a “Server Setup” walk-through. The computer was offline after a power outage so I started it up today, plex started fine and did not report errors in the log. I was unable to reach the service from plex.tv via web or my phone. I ran an update to 1.5.5 to make sure I was on the latest version and it was still unavailable from web or my app. When I connected from my local network it gave me a Server Setup walk-through.

Server version: 1.5.5.3634-995f1dead
OS: Ubuntu 16.10
Clients, w/ versions, if applicable: web

If I look in “/plex/Plex Media Server/Media/localhost” the directory is 52GB in size, so my media files are still there. The Cache folder is 1.7GB and the Metadata folder is 7.2GB so it seems all of the content is still on disk. Maybe a config issue?

The most direct, and quickest, method of putting you back online is:

  1. Stop PMS
  2. Open a terminal window
  3. sudo sh
  4. cd “/var/lib/plexmediaserver/Library/Application Support/Plex Media Server”
  5. mv Preferences.xml Preferences.xml.orig
  6. Start PMS (leave the terminal window open after doing this)
  7. Go to your browser http://127.0.0.1:32400/web
  8. Follow the first-run setup wizard but do not create any library sections . Yours will be waiting for you when you get to the Dashboard
  9. Set any other preferences you wish in the wizard
  10. Complete the wizard.

I followed the steps, but the Wizard did not show up. Instead my screen has “The dashboard is empty
Add libraries with your media to make the most of Plex Media Server” and it looks like a regular plex page but without any content.

It looks like I have 2 servers listed now with the same name. One is available and the other is unavailable.

I found part of the problem. The package repo for Ubuntu using systemd does not honor the paths set in /etc/default/plexmediaserver

Instead, it statically sets them.

/etc/systemd/system/plexmediaserver.service
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support" Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6 Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp Environment=LD_LIBRARY_PATH=/usr/lib/plexmediaserver ExecStartPre=/bin/sh -c '/usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"' ExecStart=/bin/sh -c '/usr/lib/plexmediaserver/Plex\ Media\ Server'

My plex directory is at /plex

It doesn’t include a setting for user and I’m using a different username so it is trying to run plex as user plex and is failing. I tried just putting in the value from /etc/defaults/plexmediaserver but it is not working.

Environment=PLEX_MEDIA_SERVER_USER=alternate-user-name

This change (from Ubuntu using init then upstart and finally systemd where they are now) coincides with Redhat and was put in place with Ubuntu 16.04

To accommodate this, we added full support for for the standard SystemD user-environment override file. This allows you to change the environment variables you see in /lib/systemd/system/plexmediaserver.service as well as the User, Group, and you may even change the default Umask.

If your Library directory full path is /plex/Library/Application Support , then do the following:

As root:

  1. create directory /etc/systemd/system/plexmediaserver.service.d
  2. in it, create the file override.conf with the following contents
[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/plex/Library/Application Support"

Once saved, activate it with:

  1. sudo systemctl reload-daemon
  2. sudo systemctl restart plexmediaserver

The previous /etc/defaults mechanism has been abandoned. It was an unfortunate and abrupt change which required a lot of jumping through hoops by myself and the team.

There should be only

  1. /lib/systemd/system/plexmediaserver.service
  2. /etc/systemd/system/plexmediaserver.service.d/override.conf

The other file /etc/systemd/system/plexmediaserver.service file (an artifact of their migration tool) should be deleted.

Ok, looks like I also needed to update the plex user in overrides.conf

Now it looks like this:

/etc/systemd/system/plexmediaserver.service.d/override.conf [Service] Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/plex" Environment=PLEX_MEDIA_SERVER_USER=myuser User=myuser Group=myuser

And I’m getting the setup screen so I’ll follow your steps from above.

From your console text above, it looks like you’re showing me the contents of the override.conf file.
You do not need Environment=PLEX_MEDIA_SERVER_USER=myuser. This became obsolete as of Ubuntu 16. Also note, the format for an Environment string is Envionment="variable=value" (quote everything after the =). SystemD uses the contents of the string literally and parses further when inserting into the environment.

To give you something to go by, here is what I use personally

[chuck@lizum ~.104]$ cat /etc/systemd/system/plexmediaserver.service.d/override.conf 
#
#
# Put plexdir in /home/plexdir
#
#
[Service]

Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plexdir/Library/Application Support"

[chuck@lizum ~.105]$ 

A few things to confirm / verify:

  1. /plex/Plex Media Server/Preferences.xml exists and this is what you currently are trying to define.
  2. Double checking ownership of everything in /plex and below is owned by myuser (sudo chown -R /plex myuser:myuser)

Everything is good now, Chuck! Thanks!

Outstanding!