All Libraries Suddenly Gone

Server Version#: 1.31.3.6868-28fc46b27_amd64
Player Version#: N/A

As of 16:00 MDT, while performing a regular scan, all my libraries are no longer available or showing up at all in Plex.

My logs seem to indicate an SQL error while updating metadata:

> 
> Apr 06, 2023 03:56:34.623 [0x7f5dec9a8b38] INFO - Analyzing database.
> Apr 06, 2023 03:56:34.625 [0x7f5dec9a8b38] INFO - Vacuuming database.
> Apr 06, 2023 03:56:34.648 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.649 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.650 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.651 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.652 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.653 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.654 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.655 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.656 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.657 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.658 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.659 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.661 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.662 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.663 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.666 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.668 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.670 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.672 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.673 [0x7f5dec9a8b38] DEBUG - Butler: optimized your database
> Apr 06, 2023 03:56:34.673 [0x7f5dec9a8b38] DEBUG - Blob Database: Collecting garbage.
> Apr 06, 2023 03:56:34.673 [0x7f5dec9a8b38] DEBUG - Blob Database: Collected 0 garbage blobs in 0.0 sec.
> Apr 06, 2023 03:56:34.673 [0x7f5dec9a8b38] DEBUG - Captured session 0.
> Apr 06, 2023 03:56:34.673 [0x7f5dec9a8b38] DEBUG - Captured session 1.
> Apr 06, 2023 03:56:34.710 [0x7f5dec9a8b38] INFO - SQLITE3:0x80000001, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
> Apr 06, 2023 03:56:34.711 [0x7f5dec9a8b38] DEBUG - Activity: registered new activity b44b1e0d-0175-4361-bc42-5b09eec55f5d - "Cleaning Bundles"
> Apr 06, 2023 03:56:34.712 [0x7f5dec9a8b38] DEBUG - Activity: updated activity b44b1e0d-0175-4361-bc42-5b09eec55f5d - completed -1.0% - Cleaning Bundles
> Apr 06, 2023 03:56:34.885 [0x7f5dec9a8b38] DEBUG - Activity: updated activity b44b1e0d-0175-4361-bc42-5b09eec55f5d - completed 75.0% - Cleaning Bundles
> Apr 06, 2023 03:56:34.912 [0x7f5dec9a8b38] DEBUG - Activity: updated activity b44b1e0d-0175-4361-bc42-5b09eec55f5d - completed 100.0% - Cleaning Bundles
> Apr 06, 2023 03:56:34.912 [0x7f5dec9a8b38] DEBUG - Deleted 63 media bundles.
> Apr 06, 2023 03:56:34.912 [0x7f5dec9a8b38] DEBUG - The butler cleaned 63 media bundles.
> Apr 06, 2023 03:56:34.912 [0x7f5dec9a8b38] DEBUG - Activity: updated activity b44b1e0d-0175-4361-bc42-5b09eec55f5d - completed 100.0% - Cleaning Bundles
> Apr 06, 2023 03:56:35.264 [0x7f5dec9a8b38] DEBUG - Activity: updated activity b44b1e0d-0175-4361-bc42-5b09eec55f5d - completed 25.0% - Cleaning Bundles
> Apr 06, 2023 03:56:35.825 [0x7f5dec9a8b38] DEBUG - Activity: updated activity b44b1e0d-0175-4361-bc42-5b09eec55f5d - completed 50.0% - Cleaning Bundles
> Apr 06, 2023 03:56:35.825 [0x7f5dec9a8b38] DEBUG - Deleted 879 metadata bundles.
> Apr 06, 2023 03:56:35.825 [0x7f5dec9a8b38] DEBUG - The butler cleaned 879 metadata bundles.
> Apr 06, 2023 03:56:35.825 [0x7f5dec9a8b38] DEBUG - Activity: Ended activity b44b1e0d-0175-4361-bc42-5b09eec55f5d.
> Apr 06, 2023 03:56:36.436 [0x7f5dec9a8b38] DEBUG - The butler looked at 3343 cache files and deleted 0 of them.
> Apr 06, 2023 03:56:36.436 [0x7f5dec9a8b38] DEBUG - The butler looked at 0 diagnostic files and deleted 0 of them.
> Apr 06, 2023 03:56:36.436 [0x7f5dec9a8b38] ERROR - Butler: Uncaught exception starting generator UpgradeMediaAnalysis: Vectors of size 0 are not allowed.
> Apr 06, 2023 03:56:36.436 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity 27571d96-d3a7-4fe0-8b32-98fb76edbf0e - "OptimizeDatabase" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 0.0% (0/1)
> Apr 06, 2023 03:56:36.437 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity 27571d96-d3a7-4fe0-8b32-98fb76edbf0e parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (1/1)
> Apr 06, 2023 03:56:36.437 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.438 [0x7f5dec9a8b38] DEBUG - Butler: Computed a set of 0 albums to get loudness analysis in 0ms.
> Apr 06, 2023 03:56:36.438 [0x7f5dec9a8b38] DEBUG - Butler: Adding new credits markers for 0 items
> Apr 06, 2023 03:56:36.438 [0x7f5dec9a8b38] DEBUG - Butler: Performing new intro detection for 0 items
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - [Butler] Activity: registered new activity 0c7a8b65-6641-4165-af3c-31f0dbc66eba - "Sonic Analysis"
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - [Butler] Activity: Ended activity 0c7a8b65-6641-4165-af3c-31f0dbc66eba.
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - [Butler] Computed a set of 0 batches of albums to get sonic analysis in 0ms.
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity 2c461053-9e16-48a8-b6b7-cd45ecdb546c - "GarbageCollectBlobs" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 50.0% (1/2)
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 50.0% - Butler tasks
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity 2c461053-9e16-48a8-b6b7-cd45ecdb546c parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (2/2)
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity c184780d-17b0-4aed-911a-8baeef2dc1cf - "CleanOldBundles" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 66.7% (2/3)
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 66.7% - Butler tasks
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity c184780d-17b0-4aed-911a-8baeef2dc1cf parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (3/3)
> Apr 06, 2023 03:56:36.439 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity dd0a6cdb-61b3-436c-9687-87d0e1a80084 - "CleanOldCacheFiles" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 75.0% (3/4)
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 75.0% - Butler tasks
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity dd0a6cdb-61b3-436c-9687-87d0e1a80084 parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (4/4)
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity c15bc9e7-ac28-4251-a05c-bb40d909cdfc - "ButlerTaskGenerateIntroMarkers" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 80.0% (4/5)
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 80.0% - Butler tasks
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity c15bc9e7-ac28-4251-a05c-bb40d909cdfc parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (5/5)
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - The butler generated 0 season intro markers
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity ca0fd165-70df-496d-89f0-b1cf456ab029 - "MusicAnalysis" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 83.3% (5/6)
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 83.3% - Butler tasks
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity ca0fd165-70df-496d-89f0-b1cf456ab029 parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (6/6)
> Apr 06, 2023 03:56:36.440 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Butler: Performed sonic analysis on 0 batches of albums.
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity 9c903be9-03ea-4da7-8446-bde7b502f72a - "GenerateBlurHashes" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 85.7% (6/7)
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 85.7% - Butler tasks
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity 9c903be9-03ea-4da7-8446-bde7b502f72a parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (7/7)
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - The butler generated 0 blur hashes.
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity eacfa265-d2d7-4ef3-8ef1-0daf4974e292 - "GenerateAutoTags" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 87.5% (7/8)
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 87.5% - Butler tasks
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity eacfa265-d2d7-4ef3-8ef1-0daf4974e292 parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (8/8)
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - The butler processed 0 files for autotag generation
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity 5f7362bc-0f22-416d-b859-84f563d6c1bd - "GenerateChapterThumbs" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 88.9% (8/9)
> Apr 06, 2023 03:56:36.441 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 88.9% - Butler tasks
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity 5f7362bc-0f22-416d-b859-84f563d6c1bd parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (9/9)
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - The butler generated chapter thumbnails for 0 files
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity ae81444f-8941-4778-a040-23091209726f - "ButlerTaskGenerateCreditsMarkers" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 90.0% (9/10)
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 90.0% - Butler tasks
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity ae81444f-8941-4778-a040-23091209726f parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (10/10)
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - The butler generated 0 credits markers
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity 39afe1b9-2abb-45c7-9984-fa4f633d0789 - "LoudnessAnalysis" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 90.9% (10/11)
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 90.9% - Butler tasks
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity 39afe1b9-2abb-45c7-9984-fa4f633d0789 parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (11/11)
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - The butler performed loudness analysis on 0 albums.
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity 4c88d087-3d04-450d-840a-386434c48bad - "DeepMediaAnalysis" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 91.7% (11/12)
> Apr 06, 2023 03:56:36.442 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 91.7% - Butler tasks
> Apr 06, 2023 03:56:36.455 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity 4c88d087-3d04-450d-840a-386434c48bad parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (12/12)
> Apr 06, 2023 03:56:36.455 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks
> Apr 06, 2023 03:56:36.455 [0x7f5dec9a8b38] DEBUG - The butler performed deep analysis on 0 files
> Apr 06, 2023 03:56:36.457 [0x7f5dec9a8b38] DEBUG - Activity: registered new sub-activity 7d0e26ba-bab1-4c50-91fe-296b767b1bf5 - "GarbageCollectLibraryMedia" parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 92.3% (12/13)
> Apr 06, 2023 03:56:36.457 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 92.3% - Butler tasks
> Apr 06, 2023 03:56:36.457 [0x7f5dec9a8b38] DEBUG - Activity: ended sub-activity 7d0e26ba-bab1-4c50-91fe-296b767b1bf5 parent: 4f4e27e6-b456-468e-8520-527022004e5d overall progress: 100.0% (13/13)
> Apr 06, 2023 03:56:36.457 [0x7f5dec9a8b38] DEBUG - Activity: updated activity 4f4e27e6-b456-468e-8520-527022004e5d - completed 100.0% - Butler tasks

Restarting plexmediaserver via service plexmediaserver restart does not work, nor does restarting the container itself.

Have I lost all my playlists, media, and metadata due to this SQL error? Do I need to try restoring a backup of my Plex Media Server folder?

Debian 9.13.

MODERATOR EDITED: </> formatting applied

As per @ChuckPa’s request, I will attach the logs.
Plex Media Server Logs_2023-04-06_04-35-37.zip (752.5 KB)

I get 0 Libraries on my Manage Libraries tab, as well:

Let’s start with trying to repair the DB .

If that doesn’t work, we’ll replace this DB with your most recent backup.

I have a command line tool, which runs in terminal as root (sudo)
which handles this for you.

There is a README file if you want to familiarize yourself with it first.

  1. Download the DBRepair.sh file to Linux
  2. chmod +x DBRepair.sh
  3. sudo ./DBRepair.sh

Once in the tool.

  1. STOP plex
  2. AUTO repair attempt (it will check, repair, and index if it can)
  3. If auto doesn’t work, use REPLACE
    – it will search your backups and find the first one which is valid.
    – It will ask you if you want to use it.
    – You say “yes” and it will make a backup of your current then put the selected backup in place.
    – When its complete and has verified, “Index” to regenerate the indexes
  4. BEFORE you leave the tool
 START plex and test it
  5. If that works, you can EXIT
  6. If not, REPLACE again and select the next older available backup
1 Like

That did not work; I still see 0 Libraries in my Plex “Manage Libraries” tab.

The script did, however, run successfully:

root@media2:~# ./DBRepair.sh



      Plex Media Server Database Repair Utility (Debian GNU/Linux 9 (stretch))
                       Version v1.0.3


Select

  1 - 'stop'      - Stop PMS
  2 - 'automatic' - database check, repair/optimize, and reindex in one step.
  3 - 'check'     - Perform integrity check of database
  4 - 'vacuum'    - Remove empty space from database
  5 - 'repair'    - Repair/Optimize  databases
  6 - 'reindex'   - Rebuild database database indexes
  7 - 'start'     - Start PMS

  8 - 'import'    - Import watch history from another database independent of Plex. (risky)
  9 - 'replace'   - Replace current databases with newest usable backup copy (interactive)
 10 - 'show'      - Show logfile
 11 - 'status'    - Report status of PMS (run-state and databases)
 12 - 'undo'      - Undo last successful command

 99 -  exit

Enter command # -or- command name (4 char min) : 1

Stopping PMS.
Stopped PMS.

Select

  1 - 'stop'      - Stop PMS
  2 - 'automatic' - database check, repair/optimize, and reindex in one step.
  3 - 'check'     - Perform integrity check of database
  4 - 'vacuum'    - Remove empty space from database
  5 - 'repair'    - Repair/Optimize  databases
  6 - 'reindex'   - Rebuild database database indexes
  7 - 'start'     - Start PMS

  8 - 'import'    - Import watch history from another database independent of Plex. (risky)
  9 - 'replace'   - Replace current databases with newest usable backup copy (interactive)
 10 - 'show'      - Show logfile
 11 - 'status'    - Report status of PMS (run-state and databases)
 12 - 'undo'      - Undo last successful command

 99 -  exit

Enter command # -or- command name (4 char min) : 2

Automatic Check,Repair,Index started.

Checking the PMS databases
Check complete.  PMS main database is OK.
Check complete.  PMS blobs database is OK.

Exporting current databases using timestamp: 2023-04-06_04.51.05
Exporting Main DB
Exporting Blobs DB
Successfully exported the main and blobs databases.  Proceeding to import into new databases.
Importing Main DB.
Importing Blobs DB.
Successfully imported databases.
Verifying databases integrity after importing.
Verification complete.  PMS main database is OK.
Verification complete.  PMS blobs database is OK.
Saving current databases with '-BACKUP-2023-04-06_04.51.05'
Making repaired databases active
Repair complete. Please check your library settings and contents for completeness.
Recommend:  Scan Files and Refresh all metadata for each library section.

Backing up of databases
Backup current databases with '-BACKUP-2023-04-06_04.51.06' timestamp.
Reindexing main database
Reindexing main database successful.
Reindexing blobs database
Reindexing blobs database successful.
Reindex complete.
Automatic Check, Repair/optimize, & Index successful.

Select

  1 - 'stop'      - Stop PMS
  2 - 'automatic' - database check, repair/optimize, and reindex in one step.
  3 - 'check'     - Perform integrity check of database
  4 - 'vacuum'    - Remove empty space from database
  5 - 'repair'    - Repair/Optimize  databases
  6 - 'reindex'   - Rebuild database database indexes
  7 - 'start'     - Start PMS

  8 - 'import'    - Import watch history from another database independent of Plex. (risky)
  9 - 'replace'   - Replace current databases with newest usable backup copy (interactive)
 10 - 'show'      - Show logfile
 11 - 'status'    - Report status of PMS (run-state and databases)
 12 - 'undo'      - Undo last successful command

 99 -  exit

Enter command # -or- command name (4 char min) : 7

Starting PMS.
Started PMS

Has Plex lost all my data?

Did you Replace to switch to use the newest available backup?

Your console session shows you used ‘auto’ to check the current and fix it (which is probably lost ) but your backup databases should still be intact.

Take your time here. the data is the most important.
don’t rush.

OK, that seemed to work. My libraries now show up :relieved:.

So what caused this, and how can I prevent this from happening in the future? This was a real scare, as I can’t do snapshots at the moment due to migrating to a new PVE node.

from the fragments I saw in the other thread, I’m of the impression that

While upgrading the DB (installing a new version) , some of which have VERY long upgrade times, PMS was forcibly shutdown (thinking it was hung or failed)

-or-

there was a power failure.

To prevent this in the future:

  1. Obviously have a UPS connected to the PMS server computer
    (Synology NAS boxes rarely need more than 750 KVA. Most are 450 KVA)

  2. Before abandoning an upgrade / first -start after installing new, check the CPU activity in ‘top’. You’ll see a single active thread in PMS when it’s upgrading
 ALSO, opening the PMS port in Plex web will tell you “503” (maintenance).

OK :saluting_face:. While I don’t recall ever abandoning an upgrade, I do have over 1 million songs in one of my libraries, so what you suggest could have happened.

I will mark this as solved.

Do you have a UPS on the PMS server ?

Awesome tool Chuck, that should be in the distro!

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