Plex Server not starting

Used to have a nicely running plex server. Then it quit and I don’t know the circumstances around that.
I have been reading for the last week and tried, what feels like, every possible solution proposed by the staff, from database fixes, to validating paths, ownership… Uninstalled and reinstalled.

But where I’m at is on Ubuntu 20.04 standard install, no mods to the systemd service file.

It just won’t start.
Installed from repository v1.22.3.4392-d7c624def

Apr 24 22:28:52 Plex systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Apr 24 22:28:52 Plex systemd[1]: plexmediaserver.service: Failed with result 'signal'.
-- The unit plexmediaserver.service has entered the 'failed' state with result 'signal'.
-- Subject: A start job for unit plexmediaserver.service has failed
-- A start job for unit plexmediaserver.service has finished with a failure.
sudo find / -name plexmediaserver.service -print
/etc/systemd/system/multi-user.target.wants/plexmediaserver.service
/lib/systemd/system/plexmediaserver.service
find: ‘/sys/kernel/security/integrity’: Permission denied
find: ‘/sys/kernel/security/apparmor’: Permission denied
find: ‘/sys/kernel/debug’: Permission denied
/usr/lib/plexmediaserver/lib/plexmediaserver.service

Based on everything I’ve read, it feels like I’m beating a dead horse, but I’m at a loss.
How do I get this thing running again?

I this the right place to get help?

Right place to get help.

  1. since it’s stopped,
  2. sudo bash
  3. cd “/var/lib/plexmediaserver/Library/Application Support/Plex Media Server”
  4. tar cfz /tmp/PlexLogs.tar.gz ./Logs
  5. Attach that PlexLogs.tar.gz to your reply here.

It will let me see what’s happening with your server

Much thanks. But it hasn’t logged anything since it ran last…

PlexLogs.tar.gz (1.4 MB)

May I confirm these are the right logs?

Oct 12, 2020 18:59:28.222 [0x7f5c267fc700] WARN - [Notify] Received unexpected inotify event: 8192
Oct 12, 2020 18:59:28.222 [0x7f5c267fc700] WARN - [Notify] Received unexpected inotify event: 8192

Oct 12, 2020 ?

Is this the last time the server ran?

Regarding the “unexpected inotify event”, that’s the server attempting to setup directory monitoring and running out of slots (Linux default is 8192). This is easily increased.

Do you have a configuration override in use (override.conf) ?

I’ll await your reply before advancing further.

Yes, that is the last time it ran.
BTW, it’s running in an lxc container on proxmox.

Yes, on the override.conf, but just created it this week troubleshooting.

[Service]
#Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/mnt/Plex"

I was trying to point to the media store just to see if that’s what was missing…

That said…

sudo sysctl fs.inotify
fs.inotify.max_queued_events = 8388608
fs.inotify.max_user_instances = 65536
fs.inotify.max_user_watches = 4194304

Telling me things like this, Proxmox & container, are important.
Is there anything else changed? UID/GID being used ? (not plex:plex ?)
Can you get me the current logs, wherever they might be?

Sorry for the miss.
I’m using plex:plex.
Did not change UID/GID, just whatever was assigned when I fired up the container. (I think that’s what you are asking).

Are you looking for the syslog/dmesg from the container?

Those parameters you’re showing me are:

  1. The override is not active. The # in column 1 makes it a comment

  2. Those inotify configuration values are huge. Do you really have 4 million directories containing media? All of fs.inotify uses non-paged kernel (locked) memory. If you don’t have enough memory, PMS will never run.

  3. My fs.inotify configuration is:

[chuck@lizum ~.501]$ sudo sysctl fs.inotify
fs.inotify.max_queued_events = 16384
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 262144
[chuck@lizum ~.502]$ 
  1. The only one we ever worry about is max_user_watches .

  2. 128 users is usually 117 more than we need but it’s the default so we let it alone.

  3. The same ratio is true for queued events. If there are more than 16K events queued, something is seriously wrong with the host not having enough CPU power to handle the load.

  4. Your fs.inotify customization is using about 12GB of memory unto itself. Do you have that much memory to spare in the host?

How ‘married’ are you to this instantiation of the server? I ask because, given the amount of time which has elapsed since it last ran, and all the changes to the scanners (new movie and TV scanners & agents), I wonder if you might be better served by starting over ?

Correct, should have just deleted the file.

Same values on the host. it was running like this before.

Potentially. Utilizing a 3rdGen i7 with 32G… But it was running quite nicely before.

Yes

I’m with you at this point. If you can point me to Plex authored directions to backup and restore (just the Plex databases I think) on a fresh instance, I’ll get started tonight.

Regarding backing up Proxmox, we don’t have any because Proxmox isn’t an officially supported distro.

I’ve been trying to make time to learn it for cases such as yours but about the best I can do is direct you to their forums. I would think/hope you can use the basic tar commands from the command line shell when you ssh into it.

I have only an installation guide for PMS on Proxmox which was donated by a user

If I backup the Plex db’s and restore, that should keep my library in tact, no?
I’m sure there’s probably a schema upgrade, but that’s all I’m looking for.

If you keep the “Plex Media Server” directory, where you see the “Metadata”, “Media”, “Plug-in Support”, and “Preferences.xml” directories and file, as a tar ball then you have a mirror backup. You can restore that later if you want or just use the new instance.

1 Like

off-topic: if you don’t mind, just out of curiosity. What Linux certification do you have?

who are you asking?
Me none, completely home grown baby.

@CostaHT

I am a private man.

Please allow it to suffice that my B.S. is Electrical Engineering, my M.S. is Computer Engineering, and Ph.D. is in a technology which is interwoven with daily life for many people.

In anticipation of your next question, “What am I doing here?”, I offer this:

I’m here because I was physically disabled 9 years ago and forced to leave the aviation & aerospace industry. My disability did not dampen my desires nor the enjoyment I get from helping others. I do this as my way to continue contributing and to keep my mind sharp as I ease into retirement.

2 Likes

That’s awesome!!!

I wouldn’t ask, but I would definitely think about it haha

1 Like

@PedullaPlex

Now that we’re back on track :wink:

Please do the following:

  1. https://app.plex.tv
  2. Settings - Authorized Devices - Server (dropdown)
  3. REMOVE the server
  4. Sign out of Plex/tv (upper right corner)

Return to the local system and completely remove the existing installation. If there is an option to purge all the local data , please do so. You want a completely fresh installation.

Next, Start fresh.
Keep to the defaults
Define one library section
Get it running and evaluate from there.

If you can’t make the default installation start then I need refer you to whomever did the package for ProxMox. We don’t do any packaging for it.

Cleared all the old server (devices).
Spun up a new container (privileged btw), installed from repository, after setting up the source.
All up and running.
Now I’ll work on getting my shares back on line and moving over the config… but tomorrow.
Thanks for the help, I’ll follow up with what worked and didn’t.

BTW, I get why you asked about UID:GID. The new normal is to create a new container as unprivileged which whacks everything up. I just went priv… till I figure out how to make that work.

Did this to the “old” system and restored on the new working system and I’m back to the same error.

Something in these directories is causing plexmediaserver to fail startup. (obvious)

But at least I’m getting logs now. From the Plex Media Server.log

Apr 29, 2021 23:49:04.617 [0x7f2448146700] INFO - Plex Media Server v1.22.3.4392-d7c624def - Ubuntu PC x86_64 - build: linux-x86_64 debian - GMT 00:00
Apr 29, 2021 23:49:04.617 [0x7f2448146700] INFO - Linux version: 20.04.2 LTS (Focal Fossa), language: C
Apr 29, 2021 23:49:04.617 [0x7f2448146700] INFO - Processor         Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Apr 29, 2021 23:49:04.617 [0x7f2448146700] INFO - /usr/lib/plexmediaserver/Plex Media Server
Apr 29, 2021 23:49:04.618 [0x7f244894abc0] INFO - SQLITE3:(nil), 283, recovered 23 frames from WAL file /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Apr 29, 2021 23:49:04.618 [0x7f244894abc0] ERROR - SQLITE3:(nil), 11, database corruption at line 66053 of [bf8c1b2b7a]
Apr 29, 2021 23:49:04.618 [0x7f244894abc0] ERROR - SQLITE3:(nil), 11, database disk image is malformed in "PRAGMA cache_size=2000"
Apr 29, 2021 23:49:04.619 [0x7f244894abc0] ERROR - Database corruption: sqlite3_statement_backend::prepare: database disk image is malformed for SQL: PRAGMA cache_size=2000

Please advise.