Server Version#: Plex Media Server v1.15.4.919-8e2884e4b - Ubuntu PC x86_64 - build: linux-x86_64 debian
Player Version#: N/A
When trying to load some plex media this morning, I received a friendly error message in my Plex logs:
Apr 19, 2019 06:47:39.269 [0x7f951b5d5700] INFO - Plex Media Server v1.15.4.919-8e2884e4b - Ubuntu PC x86_64 - build: linux-x86_64 debian - GMT -07:00
Apr 19, 2019 06:47:39.269 [0x7f951b5d5700] INFO - Linux version: 18.04.2 LTS (Bionic Beaver), language: en-US
Apr 19, 2019 06:47:39.269 [0x7f951b5d5700] INFO - Processor AMD Ryzen 7 1700 Eight-Core Processor
Apr 19, 2019 06:47:39.269 [0x7f951b5d5700] INFO - /usr/lib/plexmediaserver/Plex Media Server
Apr 19, 2019 06:47:39.267 [0x7f95288f8780] DEBUG - BPQ: [Idle] ā [Starting]
Apr 19, 2019 06:47:39.267 [0x7f95288f8780] VERBOSE - BPQ: delaying processing 120 second(s)
Apr 19, 2019 06:47:39.270 [0x7f95288f8780] DEBUG - FeatureManager: Using cached data for features list
Apr 19, 2019 06:47:39.271 [0x7f95288f8780] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.26.0, threadsafe=1
Apr 19, 2019 06:47:39.302 [0x7f95288f8780] DEBUG - Running migrations. (EPG 0)
Apr 19, 2019 06:47:39.304 [0x7f95288f8780] ERROR - SQLITE3:(nil), 11, database corruption at line 65066 of [bf8c1b2b7a]
Apr 19, 2019 06:47:39.304 [0x7f95288f8780] ERROR - SQLITE3:(nil), 11, statement aborts at 10: [select max(max(metadata_items.changed_at),max(metadata_items.resources_changed_at)) from metadata_items] database disk image is malformed
Apr 19, 2019 06:47:39.305 [0x7f95288f8780] ERROR - Database corruption: sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 19, 2019 06:47:39.305 [0x7f95288f8780] ERROR - Error: Unable to set up server: sqlite3_statement_backend::loadOne: database disk image is malformed (N4soci10soci_errorE)
I have not run out of disk space and I was watching media last night without issue. How do I go about resolving this issue? I hadnāt touched my Plex server at all (configuration wise, just having Plex scan for new media). Now I canāt start up the service
Rebuilding the server would create a new UUID and a new database filewould it not? Recreating the library would not necessarily create a new database files.
Looking through the logs today, I found the specific table that it is causing it to become corrupt/fail:
Apr 20, 2019 16:48:00.928 [0x7ff177fff700] ERROR - SQLITE3:(nil), 11, database corruption at line 68035 of [bf8c1b2b7a]
Apr 20, 2019 16:48:00.928 [0x7ff177fff700] ERROR - SQLITE3:(nil), 11, statement aborts at 3: [SELECT value FROM 'main'.'fts4_metadata_titles_stat' WHERE id=?] database disk image is malformed
Apr 20, 2019 16:48:00.928 [0x7ff177fff700] ERROR - SQLITE3:(nil), 11, statement aborts at 10: [update metadata_items set extra_data=? where metadata_type=? and library_section_id=? and `index`=?] database disk image is malformed
Apr 20, 2019 16:48:00.928 [0x7ff177fff700] ERROR - Exception inside transaction (inside=1) (../Library/MetadataCollection.cpp:236): sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 20, 2019 16:48:00.928 [0x7ff177fff700] ERROR - JobManager: Caught an exception notifying process 18245: sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 20, 2019 17:03:07.068 [0x7ff0e4ff1700] ERROR - SQLITE3:(nil), 11, database corruption at line 68035 of [bf8c1b2b7a]
Apr 20, 2019 17:03:07.068 [0x7ff0e4ff1700] ERROR - SQLITE3:(nil), 11, statement aborts at 3: [SELECT value FROM 'main'.'fts4_metadata_titles_stat' WHERE id=?] database disk image is malformed
Apr 20, 2019 17:03:07.068 [0x7ff0e4ff1700] ERROR - Exception inside transaction (inside=1) (../Library/MetadataItem.cpp:958): sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 20, 2019 17:03:07.068 [0x7ff0e4ff1700] ERROR - Exception loading item 'Various Artists' from bundle: sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 20, 2019 17:08:00.319 [0x7ff177fff700] ERROR - SQLITE3:(nil), 11, database corruption at line 68035 of [bf8c1b2b7a]
Apr 20, 2019 17:08:00.319 [0x7ff177fff700] ERROR - SQLITE3:(nil), 11, statement aborts at 3: [SELECT value FROM 'main'.'fts4_metadata_titles_stat' WHERE id=?] database disk image is malformed
Apr 20, 2019 17:08:00.319 [0x7ff177fff700] ERROR - SQLITE3:(nil), 11, statement aborts at 10: [update metadata_items set extra_data=? where metadata_type=? and library_section_id=? and `index`=?] database disk image is malformed
Apr 20, 2019 17:08:00.319 [0x7ff177fff700] ERROR - Exception inside transaction (inside=1) (../Library/MetadataCollection.cpp:236): sqlite3_statement_backend::loadOne: database disk image is malformed
Apr 20, 2019 17:08:00.319 [0x7ff177fff700] ERROR - JobManager: Caught an exception notifying process 19668: sqlite3_statement_backend::loadOne: database disk image is malformed
I am not sure what you are referring to.
The main Plex database file is damaged. It cannot be repaired anymore, so you must erase it. This will remove all libraries.
However, your server will retain its machine ID, so sharees to whom you granted access to the whole server will retain their access. However,if you only granted access to selected libraries, you will have to edit each user and grant them access to the newly created libraries.
If your database is getting damaged all the time, it may have to do with your storage.
You must never move the folder with the database files to a network share. Keep it always local in the server machine.
So simply removing all files within:
/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases
Is sufficient?
I havenāt moved anything to network shares, the library content itself (the shows/movies) are on a network share, but all of Plexās package contents, configuration, etc, are all local.
If you use āmobileā (external) hard drives, these often have very aggressive power saving behaviour which cannot be overridden by the OS. It may sometimes lead to difficulties with the database.