Crashing due to Database corruption

Server Version#: PlexMediaServer-1.24.3.5033-757abe6b4-x86_64_DSM7
Player Version#: 1.35.1.2632-c6783c78
Synology DSM7

Hi all. I was trying to cleanup some shared folders on my NAS and accidentally tried to move PMS while it was running and playing a video. I cancelled it within just a few seconds but it seems to have corrupted my DB. I was trying to search for fixes but having no luck.

My server is crashing at startup. I’ve tried to full uninstall and reinstall but getting no luck from that. I’ve also tried to install a different version but no luck as well.

I have a DB backup from a few months back but I can’t get my server running to try and restore it. Is there any way I can salvage all my stuff or as a fresh restart my best bet. I believe these are the proper logs showing the crash but if you need something else please let me know and I’ll provide it as soon as I see your message. Thank you so much for your time.

Nov 01, 2021 20:36:41.897 [0x7f42694adb38] INFO - Plex Media Server v1.24.5.5173-8dcc73a59 - Synology DS920+ x86_64 - build: linux-x86_64 synology-dsm7 - GMT -06:00
Nov 01, 2021 20:36:41.897 [0x7f42694adb38] INFO - Linux version: DSM 7.0.41890-0, language: en-US
Nov 01, 2021 20:36:41.897 [0x7f42694adb38] INFO - Processor Intel(R) Celeron(R) J4125 CPU @ 2.00GHz
Nov 01, 2021 20:36:41.897 [0x7f42694adb38] INFO - Compiler is - Clang 11.0.1 (https://plex.tv e0c29d5827bc4eaaa2ceb882cbeed224b0960173)
Nov 01, 2021 20:36:41.897 [0x7f42694adb38] INFO - /volume1/@appstore/PlexMediaServer/Plex Media Server
Nov 01, 2021 20:36:41.896 [0x7f426cae96e8] DEBUG - BPQ: [Idle] -> [Starting]
Nov 01, 2021 20:36:41.896 [0x7f426cae96e8] DEBUG - FeatureManager: Using cached data for features list
Nov 01, 2021 20:36:41.897 [0x7f426cae96e8] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.35.5, threadsafe=1
Nov 01, 2021 20:36:41.904 [0x7f426cae96e8] DEBUG - Running migrations. (EPG 0)
Nov 01, 2021 20:36:41.904 [0x7f426cae96e8] ERROR - SQLITE3:0x80000001, 1, no such table: schema_migrations in "select version from schema_migrations order by version"
Nov 01, 2021 20:36:41.904 [0x7f426cae96e8] ERROR - Database corruption: sqlite3_statement_backend::prepare: no such table: schema_migrations for SQL: select version from schema_migrations order by version

Recovering is very straight forward.

  1. Stop Plex

  2. Open FileStation

  3. Navigate : PlexMediaServer/AppData/Plex Media Server/Plug-in Support/Databases

  4. Remove the com.plexapp.plugins.library.db-shm and com.plexapp.plugins.library.db-wal files. They are paired with the corrupted DB.

  5. Right-click your most recent backup copy (looking at the dates)

  6. “COPY” (you’re going to copy that file)

  7. Navigate up one level to “Plug-in Support”

  8. Now Right-Click → Paste (so it puts the copy there)

  9. Rename it to be com.plexapp.plugins.library.db

  10. Right-click → Cut

  11. Navigate back down into Databases

  12. In the white space , Right-click → PASTE - Overwrite.

(this will overwrite the corrupted com.plexapp.plugins.library.db)

  1. When complete,

  2. Start Plex

  3. Now update the database for each of your defined library sections

  • Scan Files
  • Refresh All Metadata
  1. With exception of the watched history, you’re back.
3 Likes

You’re always on the ball Chuck, thanks for your help and all you do for the community. We’re back up and spinning, although a few months behind. Good reminder to all to make regular backups (one of the most basic things anyone should be doing anyways).

You can set Schedule Tasks to make automatic backups.

Will be the first thing I do after I get up and running again.

So it looks like I had it backing up every 3 days. I’m unable to find the locations where the backups are saved. The backup directory listed in settings only has the 3 files you mentioned, no old backups. Any chance you could point me in the right direction please?

I leave my backup directory blank. (make sure to remove any spaces else it’ll mess up.)

My backups end up right next to the files

Odd. Mines set for the same but I have no extra files.

image

Will try to setup from scratch or read some more forums to figure out why mine aren’t saving.

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