Tuesday, April 21, 2020

Plex Media Server running on a Synology Server DS418play - Error

So, I have been running PMS for some time, and before it I ran on a smaller slower Synology box.

But today it decided to not work.

On my computer accessing Plex the error showed


There was an unexpected error loading this library
Please visit our forums if you continue to experience problems

On my LG Smart TV it said

something went wrong there was an error loading your home screen

I accessed the account and the logs, and through a million trillion line entries, there appeared to be an issue with the database. 

Apr 21, 2020 19:09:36.153 [0x7fe98abc3700] ERROR - SQLITE3:(nil), 11, database corruption at line 64817 of [bf8c1b2b7a]

So... how to fix.  There are a range of items in the web on how to correct/repair a sqlite database, but yeah, bollocks to that.

Plex tends to keep four backups of its databases.  So, assuming you are not unfortunately enough that all four are dead, then its pretty straight forward.

Web access to your synology server, and open the File Station app.  Then find the following location.

[Server name]>Plex>Library>Application Support>Plex Media Server>Plug in Support>Databases

Its quite deep.

In that folder is a ton of database files and their backups.

Now, the next thing you need to ensure is that the Plex server is not running.  Open Package Centre, click on installed, then the plex app, then the little arrow next to "open" which will allow you to select Stop.  Agree and let it shut down.

The above folder will clear out a few of the active database files. 

The file I had to deal with was com.plexapp.plugins.library.db

Really clear name, but thats it.  Long with that file, there are a four others of the same name but with the addition of a date at the end. 

I selected the above file and all four backups, and selected download.  This is to backup files so I don't mess things up. 

Then I deleted the above file.

Finally I got the backup file with the newest date, and removed its date, so it ultimately replaced the above file name directly. 

Started the plex app through the Package centre, and it all ran perfectly.

Obviously, if required, you can go further back into the backups to get the thing working. 

No comments: