“Database corrupted” but instructions fail

Server Version#: 1.22.3.4392

Reading Repair a Corrupt Database | Plex Support the first step after copying that database is sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort’” which fails with Error: no such index: index_title_sort_naturalsort

Are there updated instructions somewhere? (Plex appears to be working fine, but is reporting the database is corrupted.)

No, as the command I am using is the first command in the “run a repair” section on that page (after the copy command).

Run a Repair

Even if the integrity check doesn’t return errors, it can still sometimes help to try and repair the database. In order to try and “repair” the database, you can perform a dump followed by a restore to get it back to normal. Run the following commands in the Command Prompt in order.

  1. copy com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
  2. sqlite3 com.plexapp.plugins.library.db “DROP index ‘index_title_sort_naturalsort’”

You can no long use the standalone sqlite3 for this step and with regard to database repair it is a bit redundant since the .dump and restore does that step anyway.

That seems like it is the solution, I just need to find the equivalent path on the Synology.

Which I have not been able to find. Ideas where this is on the Synology install?

On Synology, due to how it’s structured, the safer mechanism is to use one of the backup copies.

Plex (share) / Library / Application Support / Plex Media Server / Plug-in Support/ Databases

  1. Stop Plex
  2. Rename com.plexapp.plugins.library.dbbad.com.plexapp.plugins.library.db
  3. Rename the most recent backup to be com.plexapp.plugins.library.db
  4. Now make a copy of it.
  5. Right -click this copy → Properties and change ownership to “plex”. (just in case you need another backup)
  6. Start Plex
  7. Scan files for all libraries
  8. Refresh Metadata for all libraries

doesn’t this assume the backup is not corrupted?

This seems to be necessary far too often. Why are the tools to repair the database not on the Synology?

Yes, I did read the thread and then could not find the tool, which then resulted in:

so do the tools exist on Synology to try to repair or not? and if so, where are they?

1 Like

Do the tools exist on Synology? From my research, if you downloaded plex from the package manager it should be: "/volume1/@appstore/Plex Media Server/Plex Media Server"

But what I am trying to find: Is if you use the plex docker image to run it as a container (on Synology) do the tools exist? Is the ‘Plex Media Server’ executable and other tools downloaded to the config mapped path for the container? Or are these tools not available to the docker container/image?

DSM 6

"/var/packages/Plex Media Server/target/Plex SQLite"

DSM 7

"/var/packages/PlexMediaServer/target/Plex SQLite"

chuck@ds418:/var/packages/PlexMediaServer$ cd target
chuck@ds418:/var/packages/PlexMediaServer/target$ ls -la
total 25288
drwxr-xr-x  5 PlexMediaServer PlexMediaServer     4096 Jun  1 11:44  .
drwxr-xr-x  4 root            root                4096 Jun  3 22:07  ..
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer   764376 May 27 03:40  CrashUploader
drwxr-xr-x  2 PlexMediaServer PlexMediaServer     4096 May 27 03:46  lib
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer   256440 May 27 03:11 'Plex Commercial Skipper'
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer  2666096 May 27 03:37 'Plex DLNA Server'
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer   108992 May 27 03:11 'Plex Media Fingerprinter'
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer  3902760 May 27 03:41 'Plex Media Scanner'
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer 14678808 May 27 03:46 'Plex Media Server'
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer   605328 May 27 03:11 'Plex Relay'
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer    11240 May 27 03:11 'Plex Script Host'
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer    10464 May 27 03:11 'Plex SQLite'
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer   268624 May 27 03:11 'Plex Transcoder'
-rwxr-xr-x  1 PlexMediaServer PlexMediaServer  2588112 May 27 03:11 'Plex Tuner Service'
drwxr-xr-x 10 PlexMediaServer PlexMediaServer     4096 Jun  1 11:44  Resources
drwxr-xr-x  3 PlexMediaServer PlexMediaServer     4096 Jun  1 11:44  ui
chuck@ds418:/var/packages/PlexMediaServer/target$ 

In Docker, container shell command line, "/usr/lib/plexmediaserver/Plex SQLite"

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