Database Corruption

Server Version#: 1.14.1.5488
Player Version#: 3.77.4

I’ve noticed in my logs that I am getting the database corruption errors:

Soci Exception handled: sqlite3_statement_backend::loadOne: database disk image is malformed

The system seems to be working fine otherwise.

I took a copy of the DB and ran the fix that is in the forums but am not getting a clean result:

sqlite3 com.plexapp.plugins.library.db “DROP index ‘index_title_sort_naturalsort’”
sqlite3 com.plexapp.plugins.library.db “DELETE from schema_migrations where version=‘20180501000000’”
sqlite3 com.plexapp.plugins.library.db “PRAGMA integrity_check”
wrong # of entries in index index_statistics_media_on_timespan
wrong # of entries in index index_statistics_media_on_device_id
wrong # of entries in index index_statistics_media_on_account_id
wrong # of entries in index index_statistics_bandwidth_on_timespan
wrong # of entries in index index_statistics_bandwidth_on_device_id
wrong # of entries in index index_statistics_bandwidth_on_account_id

Any ideas what to investigate?

Thanks.

That is only the check. You didn’t run the actual fix.

D’Oh!

Yeah, the fixes worked. I was ocncerned with the “Wrong # of entries” statements and was thinking it was something unusual.

All fixed up now and logs are rolling clean.

Thanks.

I need help and can’t create a new post… when i run the DB checks and i get to this line:

sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort'"

An error is returned: Error: no such index: index_title_sort_naturalsort

I have a 300+MB database and plex is on the lates public release. I’m a plexpass member. Any help is appreciated.

PS: I ran the rest of the steps and then the repair, after the re-creation of the DB, it’s 4KB! :frowning:

the dump.sql is 297MB.

Thanks in advanced… i’m stuck without a working Plex server…

What happens if you just run the last step?

sqlite3 com.plexapp.plugins.library.db "PRAGMA integrity_check"

It returns this:

*** in database main ***
Page 34796: btreeInitPage() returns error code 11
Page 34795: btreeInitPage() returns error code 11
Page 34794: btreeInitPage() returns error code 11
Page 34793: btreeInitPage() returns error code 11
Page 34792: btreeInitPage() returns error code 11
Page 34791: btreeInitPage() returns error code 11
Page 34790: btreeInitPage() returns error code 11
Page 34789: btreeInitPage() returns error code 11
Error: database disk image is malformed

And then i run the repair steps and that’s when it’s 4KB in size. :frowning:

That is not an error I am familiar with.

Can you PM me a zip of your DB file so I can take a look?

Longshot: are there older backups in the ./Plex Media Server/Plug-in Support/Databases directory you can try an integrity check against?

If there are copy them to another location and try doing the checks against them.

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