404 Upon Reinstall on Ubuntu 16.04

Hey there, so as the title is hinting at, I previously had a install of plex running for about a year and at some point something happened to my web app for my server. Tried to fix it but didn’t have any luck (honestly at this point it’s been so long I’m actually not sure what caused the problem to appear but basically I could access the web app via localhost on the machine but that was it). So in an attempt to finally fix this I tried to purge pms and reinstall buuuuuuuut now I have a bigger problem in that I can’t access plex at all anymore :expressionless:. I’ve tried looking around posts on this forum and others but nothing’s been working yet. Steps I tried to uninstall were:
sudo service plexmediaserver stop
dpkg -r plexmediaserver
sudo rm -R /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/

Then I restarted the computer and tried to reinstall by going to the Downloads section on the plex site and choosing the x64 Linux package and installing the deb with Ubuntu Software Center. After completion I navigate to localhost:32400/manage or localhost:32400/web/index.html or by navigating to applications>multimedia>Plex Media Server aaaaaaaaaannnnnnnnndddddd every time it says 404 /web/index.html not found

So thru digging around forums (not above trying any of these again, anything to get this working again pretty much lol) I’ve tried to remove the plex user also tried:
‪sudo rm -rf /var/lib/plexmediaserver‬
‪sudo mkdir /var/lib/plexmediaserver‬
‪sudo chown plex:plex /var/lib/plexmediaserve‬

I’m currently getting:

● plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/etc/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Thu 2018-09-27 09:25:41 UTC; 1min 17s ago
Process: 3192 ExecStart=/bin/sh -c /usr/lib/plexmediaserver/Plex\ Media\ Server (code=exited, status=255)
Process: 3188 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p "
Main PID: 3192 (code=exited, status=255)

Sep 27 09:25:36 rapidseedbox systemd[1]: plexmediaserver.service: Unit entered failed state.
Sep 27 09:25:36 rapidseedbox systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
Sep 27 09:25:41 rapidseedbox systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
Sep 27 09:25:41 rapidseedbox systemd[1]: Stopped Plex Media Server for Linux.
Sep 27 09:25:41 rapidseedbox systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Sep 27 09:25:41 rapidseedbox systemd[1]: Failed to start Plex Media Server for Linux.

But also not sure if that’s what’s causing everything ¯_(ツ)_/¯. Any help at all would be GREATLY appreciated. Anything to fill this plexless void I have now lol (also sorry for the book trying to include as much as I can)

Why do you have a full UNIT override in

/etc/systemd/system/plexmediaserver.service

what are the contents of this?

Mainly just a blind attempt to try and fix this by going off of existing forum posts before making my own :sweat:. Contents are:

[Unit]

Description=Plex Media Server for Linux

After=network.target

[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

Environment=LC_ALL=en_US.UTF-8

Environment=LANG=en_US.UTF-8

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’

Type=simple

User=plex

Group=plex

Restart=on-failure

RestartSec=5

StartLimitInterval=60s

StartLimitBurst=3

[Install]

WantedBy=multi-user.target

Which doesn’t seem to be working lol.

right, because it’s wrong and obsolete (pre BASH / SELinux updates of 2+ years ago)

  1. sudo rm -rf /etc/systemd/system/plexmediaserver.service
  2. sudo systemctl daemon-reload
  3. `sudo systemctl start plexmediaserver

Now if you get an error, it will be legitimate.

This will take a moment to start because of nothing having been created.

Also, make certain /var/lib/plexmediaserver is owned by plex:plex

1 Like

/var/lib/plexmediaserver is owned by plex:plex with 755 permissions. Removed the service and reloaded the daemon. But seems like I am getting the same error somehow.

● plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Thu 2018-09-27 16:29:37 UTC; 4s ago
Process: 5300 ExecStart=/bin/sh -c /usr/lib/plexmediaserver/Plex\ Media\ Server (code=exited, status=255)
Process: 5296 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p "
Main PID: 5300 (code=exited, status=255)

Sep 27 16:29:32 rapidseedbox systemd[1]: plexmediaserver.service: Unit entered failed state.
Sep 27 16:29:32 rapidseedbox systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
Sep 27 16:29:37 rapidseedbox systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
Sep 27 16:29:37 rapidseedbox systemd[1]: Stopped Plex Media Server for Linux.
Sep 27 16:29:37 rapidseedbox systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Sep 27 16:29:37 rapidseedbox systemd[1]: Failed to start Plex Media Server for Linux.
lines 1-13/13 (END)

Contents are:
[Unit]

Description=Plex Media Server for Linux

After=network.target

[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

Environment=LC_ALL=C

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’

Type=simple

User=plex

Group=plex

Restart=on-failure

RestartSec=5

StartLimitInterval=60s

StartLimitBurst=3

[Install]

WantedBy=multi-user.target

you failed to remove /etc/systemd/system/plexmediaserver.service and systemctl daemon-reload

Compare what you see there with /lib/systemd/system/plexmediaserver.service. It’s vastly different

I promise I did. I was able to get it working however, I checked to see if anything was also on port 32400 and returned that Apache was running something. Went thru all my enabled sites and there was nothing calling on that port. So I checked ports.conf and low and behold Apache was listening on port 32400. Removed the entry, restarted Apache and voila. Sorry for the headache, and thank you for the help.

plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabl
Active: active (running) since Thu 2018-09-27 17:14:20 UTC; 32min
Process: 386 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA
Main PID: 594 (sh)
CGroup: /system.slice/plexmediaserver.service
├─ 594 /bin/sh -c /usr/lib/plexmediaserver/Plex\ Media\ S
├─ 596 /usr/lib/plexmediaserver/Plex Media Server
├─ 2804 /usr/lib/plexmediaserver/Plex DLNA Server
├─ 2807 /usr/lib/plexmediaserver/Plex Tuner Service /usr/l
├─ 3775 Plex Plug-in [com.plexapp.system] /usr/lib/plexmed
├─18497 /usr/lib/plexmediaserver/Plex Media Scanner --scan
├─18579 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/pl
├─18905 Plex Plug-in [com.plexapp.agents.themoviedb] /usr/
├─19431 Plex Plug-in [com.plexapp.agents.localmedia] /usr/
├─19534 Plex Plug-in [com.plexapp.agents.thetvdb] /usr/lib
└─20964 Plex Plug-in [com.plexapp.agents.plexmusic] /usr/l

Sep 27 17:14:19 rapidseedbox systemd[1]: Starting Plex Media Server f
Sep 27 17:14:20 rapidseedbox systemd[1]: Started Plex Media Server fo
lines 1-20/20 (END)

What are you doing with Apache? PMS provide its own interface.

Kindly leave ALL other software away from PMS until such time as it is running as shipped. This includes any proxy / Apache interface to it.

You must change your Apache configuration. If that is where you have a proxy, Remove it.

PMS is not to be started by or prefaced by any other packages.

PMS uses port 32400 for access to it’s browser app. This is much like NAS boxes use 5000 or 8080.

There’s nothing with anything to pms outside of pms itself. There WAS something in ports.conf in Apache telling it to listen on plex’s port. Which prevented it to listen onto plex’s web interface. Which again has been removed thus allowing pms to work again. I did try to do a reverse proxy a while ago to make getting to my server via url slightly easier but as mentioned in my previous reply it’s not there. Pms IS working

With PMS working (processes are showing now)

Let’s reclaim it because this is the easiest.

  1. Stop PMS
  2. In /var/lib/plexmediaserver/Library/Application Support/Plex Media Server
    3 Rename Preferences.xml to Preferences.xml.old
  3. Start PMS
  4. Open http://127.0.0.1:32400/web
  5. You will be greeted by the welcome, sign in , and got it pages
  6. Proceed through the initial steps of setup EXCEPT DO NOT create new library sections. Skip this step
  7. Continue with the rest of the wizard
  8. Arrive at the dashboard
  9. Settings - Server - Reapply any custom settings you had.

Please let me know if it’s all operating now and properly assocated with your account.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.