Plex Server not starting

The bottom line here is the database is corrupted.
PMS won’t start when this happens because SQLITE3 won’t open it.

When you look in the Databases directory, do you see multiple copies of com.plexapp.plugins.library.db (the other copies have dates) ?

If true then you can ‘repair’ this by swapping a ‘backup’ copy in as the ‘current’ then scanning all the files again and refreshing the metadata.

If you only have the one file, the process is more detailed. That procedure is here

Here’s my databases.

chuck@papyplex:/var/lib/plexmediaserver/Plex Media Server/Plug-in Support/Databases$ ls -la
total 1576936
drwxr-xr-x 2 chuck chuck      4096 Apr 27 16:02 .
drwxr-xr-x 7 chuck chuck      4096 Apr 10 23:46 ..
-rw-r--r-- 1 chuck chuck  72605696 Apr 29 02:02 com.plexapp.plugins.library.blobs.db
-rw-r--r-- 1 chuck chuck  72605696 Apr 18 02:00 com.plexapp.plugins.library.blobs.db-2021-04-18
-rw-r--r-- 1 chuck chuck  72605696 Apr 21 02:03 com.plexapp.plugins.library.blobs.db-2021-04-21
-rw-r--r-- 1 chuck chuck  72605696 Apr 24 02:04 com.plexapp.plugins.library.blobs.db-2021-04-24
-rw-r--r-- 1 chuck chuck  72605696 Apr 27 04:40 com.plexapp.plugins.library.blobs.db-2021-04-27
-rw-r--r-- 1 chuck chuck    589824 Apr 29 02:02 com.plexapp.plugins.library.blobs.db-shm
-rw-r--r-- 1 chuck chuck  74308472 Apr 29 02:02 com.plexapp.plugins.library.blobs.db-wal
-rw-r--r-- 1 chuck chuck 194734080 Apr 30 00:44 com.plexapp.plugins.library.db
-rw-r--r-- 1 chuck chuck 190852096 Apr 18 02:00 com.plexapp.plugins.library.db-2021-04-18
-rw-r--r-- 1 chuck chuck 197273600 Apr 21 02:03 com.plexapp.plugins.library.db-2021-04-21
-rw-r--r-- 1 chuck chuck 194934784 Apr 24 02:04 com.plexapp.plugins.library.db-2021-04-24
-rw-r--r-- 1 chuck chuck 198458368 Apr 27 04:40 com.plexapp.plugins.library.db-2021-04-27
-rw-r--r-- 1 chuck chuck   1540096 Apr 30 01:02 com.plexapp.plugins.library.db-shm
-rw-r--r-- 1 chuck chuck 199030952 Apr 30 01:02 com.plexapp.plugins.library.db-wal
chuck@papyplex:/var/lib/plexmediaserver/Plex Media Server/Plug-in Support/Databases$ 

If I were to repair my database,

  1. Plex stopped
  2. sudo bash - elevate to root
  3. Rename 'com.plexapp.plugins.library.dbtocom.plexapp.plugins.library.db.bad`
  4. Rename com.plexapp.plugins.library.blobs.db-2021-04-27 to aom.plexapp.plugins.library.blobs.db

See how this swaps them?

Much thanks. Progress. Thank goodness for automatic backups! I had to rename/mv the shm and wal files as well. Now plexmediaserver starts, but web page is a xml/html dump.
The current log file after a reboot.

cat Plex\ Media\ Server.log 
Apr 30, 2021 16:07:19.646 [0x7f96fd207700] INFO - Plex Media Server v1.22.3.4392-d7c624def - Ubuntu PC x86_64 - build: linux-x86_64 debian - GMT 00:00
Apr 30, 2021 16:07:19.647 [0x7f96fd207700] INFO - Linux version: 20.04.2 LTS (Focal Fossa), language: C
Apr 30, 2021 16:07:19.647 [0x7f96fd207700] INFO - Processor         Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
Apr 30, 2021 16:07:19.647 [0x7f96fd207700] INFO - /usr/lib/plexmediaserver/Plex Media Server
Apr 30, 2021 16:07:20.255 [0x7f96f4036700] WARN - Unrecognized MediaProvider feature: availability
Apr 30, 2021 16:07:20.255 [0x7f96f4036700] WARN - Unrecognized MediaProvider feature: availability-platforms
Apr 30, 2021 16:07:20.255 [0x7f96f4036700] WARN - Unrecognized MediaProvider feature: universalSearch
Apr 30, 2021 16:07:21.551 [0x7f96f1831700] INFO - Refreshing paths watched by LibraryUpdateManager
Apr 30, 2021 16:07:33.740 [0x7f96f4036700] WARN - NAT: PMP, got an error: Not Supported by gateway.
Apr 30, 2021 16:07:34.051 [0x7f96f2833700] WARN - NAT: PMP, got an error: Not Supported by gateway.
Apr 30, 2021 16:07:34.051 [0x7f96f2833700] ERROR - Error issuing curl_easy_perform(handle): 3
Apr 30, 2021 16:07:34.051 [0x7f96f2833700] WARN - HTTP error requesting GET http://xxx.xxx.xxx.xxx:0/identity (3, URL using bad/illegal format or missing URL) ()

@PedullaPlex

Add /web to the end of that ?

You do not save any disk space by turning off DEBUG. Logs are fixed size.
Please leave DEBUG ON and VERBOSE OFF.
This makes diagnosing any future issues quicker.

oh boy, that’s embarrassing :confused:

1 Like

So it’s back up and running, but none of my libraries are showing up.
Wouldn’t the restoration of the database backup keep that in place?

Now I need the logs to see where it’s at.

Plus,

What changes have you made over the past 3 days?

I’m walking through this process again. There’s a couple of typo’s I get, but I want to understand the basic concepts:
1- Do I do this move with matching backups of the library.blobs.db and library.db?
2- Do I need to get rid of the db-shm & db-wal files?

PS. No other changes other than what has been documented in this thread.

1-Yes
2-No

Answered my own question. I’m a sucker for trial and error while maintaining breadcrumbs to get back.

That said, my library is back to at least the last known backup.

I’ll write a summary that may be useful to someone else down the line.

Summary Post

Let me be begin with expressing my appreciation for the outstanding support and patience from @ChuckPa

Initial Problem:

  • PlexMediaServer would not start.

Cause:

  • Unknown, probably a power outage that hosed the database. We’ve had some nasty weather this winter.

Efforts to resolve:

  • System Update to latest LTS OS (Ubuntu 20.04)
  • Associated PlexMediaServer updates via repository
  • Database recovery linked above.

What worked:

  • Rebuild the server (a container on proxmox, eazy-peazy)
  • Reattached my media stores using the same path as the old server
  • Removed the old server from https://app.plex.tv
  • Installed Plex using repository
  • Stop plexmediaserver
  • Copied old Plex Media Server directory to new server. (Everything under /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/ )
  • Copied backed up matching library.blob.db-sometimestamp and library.db-sometimestamp files to the working files (…db)
  • Made sure everything in and under the Plex Media Server directory was owned by plex:plex
  • Start plexmediaserver
  • Log back in
  • Joy

I used all the default install paths & methods with the exception of adding the repository and installing from there instead of from deb as described in the official install docs. So existing docs will cover all the path and file specifics I generalize in this summary.

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