Server Version#: 1.13.8.5395
Player Version#: web client 3.67.1
Hi,
I’m having difficulty repairing my database. I am unable to delete a library from my database and until i rolled back my database using Time Machine (osx) i was unable to mark a show as watched, but since rolling it back that part is now fixed.
when i run the command to delete the library i get the following response in my logs:
Oct 05, 2018 19:52:19.833 [0x70000bf47000] DEBUG - Activity: registered new activity 49f42cf8-76bf-4a5e-bf0e-3723161867fa - Deleting Library
Oct 05, 2018 19:52:19.834 [0x70000c2dc000] DEBUG - Completed: [127.0.0.1:52897] 200 DELETE /library/sections/1?async=1 (9 live) GZIP 14ms 371 bytes (pipelined: 6)
Oct 05, 2018 19:52:19.835 [0x70000c465000] DEBUG - Activity: updated activity 49f42cf8-76bf-4a5e-bf0e-3723161867fa - completed 0% - Deleting Library
Oct 05, 2018 19:52:20.824 [0x70000c465000] ERROR - SQLITE3:0x70000c0cf590, 11, database corruption at line 59437 of [fc49f556e4]
Oct 05, 2018 19:52:20.824 [0x70000c465000] ERROR - SQLITE3:0x70000c0cf590, 11, database corruption at line 59479 of [fc49f556e4]
Oct 05, 2018 19:52:20.824 [0x70000c465000] ERROR - SQLITE3:0x70000c0cf590, 11, statement aborts at 35: [delete from taggings where id in (select taggings.id from taggings join metadata_items on metadata_items.id=taggings.metadata_item_id where metadata_items.library_section_id=?)] databa
Oct 05, 2018 19:52:20.824 [0x70000c465000] ERROR - Exception inside transaction (inside=1) (…/Library/Scanner/LibrarySection.cpp:314): sqlite3_statement_backend::loadOne: database disk image is malformed
Oct 05, 2018 19:52:20.939 [0x70000c465000] ERROR - Thread: Uncaught exception running async task which was spawned by thread 0x70000bf47000: sqlite3_statement_backend::loadOne: database disk image is malformed
I have tried to run the script to repair the database from here
I’ve made a number attempts at repairing it, and often errors. Whilst preparing this post i closed my plex server down and ran the script again and this time no errors were observed: (response below from Terminal)
wearefamily:~ davidlaker$ cd ~/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/
wearefamily:Databases davidlaker$ cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
wearefamily:Databases davidlaker$ sqlite3 com.plexapp.plugins.library.db “DROP index ‘index_title_sort_naturalsort’”
wearefamily:Databases davidlaker$ sqlite3 com.plexapp.plugins.library.db “DELETE from schema_migrations where version=‘20180501000000’”
wearefamily:Databases davidlaker$ sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
wearefamily:Databases davidlaker$ rm com.plexapp.plugins.library.db
wearefamily:Databases davidlaker$ sqlite3 com.plexapp.plugins.library.db < dump.sql
But on loading plex it crashes:
Oct 05, 2018 20:10:09.013 [0x700006f69000] INFO - Plex Media Server v1.13.8.5395-10d48da0d - Apple Mac - build: darwin-x86_64 macosx - GMT 01:00
Oct 05, 2018 20:10:09.014 [0x700006f69000] INFO - MacOSX version: 10.13.6, language: en-GB
Oct 05, 2018 20:10:09.014 [0x700006f69000] INFO - Processor Intel® Core™ i5-2415M CPU @ 2.30GHz
Oct 05, 2018 20:10:09.014 [0x700006f69000] INFO - /Applications/Plex Media Server.app/Contents/MacOS/Plex Media Server
Oct 05, 2018 20:10:09.260 [0x70000727b000] DEBUG - BPQ: [Idle] -> [Starting]
Oct 05, 2018 20:10:09.268 [0x70000727b000] DEBUG - FeatureManager: Using cached data for features list
Oct 05, 2018 20:10:09.269 [0x70000727b000] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.13.0, threadsafe=1
Oct 05, 2018 20:10:09.283 [0x70000727b000] DEBUG - Running migrations. (EPG 0)
Oct 05, 2018 20:10:09.284 [0x70000727b000] ERROR - SQLITE3:0x70000727a590, 1, no such table: schema_migrations
Oct 05, 2018 20:10:09.284 [0x70000727b000] ERROR - Database corruption: sqlite3_statement_backend::prepare: no such table: schema_migrations for SQL: select version from schema_migrations order by version
Oct 05, 2018 20:10:09.284 [0x70000727b000] ERROR - Error: Unable to set up server: sqlite3_statement_backend::prepare: no such table: schema_migrations for SQL: select version from schema_migrations order by version (N4soci10soci_errorE)
Can anyone assist please, much appreciated.
. Over the weekend I’ll try and look at the sql dump with my limited experience of fixing my websites database in phpmyadmin.