Add "database disk image is malformed" solution

JonnyWong16
2016-11-21 09:57:46 -08:00
parent f07730cc5d
commit 7035d03206

@@ -18,6 +18,7 @@
* [When trying to install the GeoLite2 database, I get the error "Uncaught ReferenceError: confirmAjaxCall is not defined."](#general-q15)
* [PlexPy says "There was an error communicating with your Plex Server", and the logs say "Status code 401".](#general-q16)
* [I can't connect to my Plex server with "Use SSL" checked.](#general-q17)
* [My PlexPy database got corrupted: "DatabaseError: database disk image is malformed."](#general-q18)
## Activity and History Logging
@@ -171,6 +172,22 @@ If you cannot load the Plex Web interface, then you may have a DNS rebinding iss
Otherwise, you may have to set secure connections to "Preferred" in your Plex server settings and uncheck the "Use SSL" box in the PlexPy settings. PlexPy will then connect to your Plex server directly without SSL using the address `http://LOCAL-IP-ADDRESS:32400`.
#### <a name="general-q18">Q:</a> My PlexPy database got corrupted: "DatabaseError: database disk image is malformed."
**A:** The easiest way to fix this would be restoring a older version of the database from the backup directory. Alternatively, you can try to fix is using the steps below, or using the [SQLite command line instructions here](http://froebe.net/blog/2015/05/27/error-sqlite-database-is-malformed-solved/).
1. Backup your PlexPy database (`plexpy.db`) by making a copy and saving it somewhere safe.
2. Open your database with [DB Brwoser for SQLite](http://sqlitebrowser.org/).
3. Go to the "Execute SQL" tab and run `pragma integrity_check;` ([screenshot](http://i.imgur.com/06CBhMc.png)). If it does not say "ok" then you need to repair your database.
4. Go to "File > Export > Database to SQL file..."
5. Check the box that says "Multiple rows (VALUES) per INSERT statement ([screenshot](http://i.imgur.com/3GXfQw6.png)).
6. Click "OK" and save the `.sql` file on your computer.
7. Go to "File > Close Database".
8. Go to "File > Import > Database from SQL file..."
9. Select the `.sql` file you saved from step 4, and save the new file as `plexpy.db`.
10. Go to the "Execute SQL" tab and run `pragma integrity_check;` and it should say "ok".
11. Go to "File > Write Changes" and "File > Close Database".
12. Replace your PlexPy database (`plexpy.db`) file with this new one.
---
### Activity and History Logging