Branch/Commit: Master
OS: Ubuntu Server 16.04
What you did: Nothing
What happened: Got errors
What you expected: Not get errors? :P
Logs:
2016-08-20 00:10:26 INFO CHECKVERSION :: Checking for updates using GIT AADatabaseError: database disk image is malformed AA sql_results = self.connection.cursor().execute(query) AA File "/opt/sickrage/sickbeard/db.py", line 106, in _execute AA sql_results = self._execute(query, args, fetchall=fetchall, fetchone=fetchone) AA File "/opt/sickrage/sickbeard/db.py", line 257, in action AATraceback (most recent call last): 2016-08-20 00:06:53 ERROR SEARCHQUEUE-DAILY-SEARCH :: [ExtraTorrent] :: [4e8b9ee] Fatal error executing query: database disk image is malformed 2016-08-20 00:06:51 INFO SEARCHQUEUE-DAILY-SEARCH :: Beginning daily search for new episodes
Thanks for the issue report! Before a real human comes by, please make sure your report has all the below criteria checked
and for readabilityPlease make sure you also read how to create an issue and followed all of the steps.
The title should describe your issue. Having "SR not working" or "I get this bug" for 100 issues, isn't really helpful. We will close issues if there isn't enough information.
Sometimes the devs may seem like grunts and respond with short answers. This isn't (always) because the dev hates you, but because he's on mobile or busy fixing bugs. If something isn't clear, please let us know, and this bot may get updated to automatically answer you.
Thanks!
Whatever medium (HDD/SSD/microSD) you're running sickrage from is probably slowly dying due to too many read/writes.
Try fsck on linux or chdsk on windows.
The Db seems to be corrupt.
Just start a new/fresh one and you should be up and running again. (or restore a backup if you made one.:) )
https://github.com/SickRage/SickRage/issues/1723#issuecomment-217791677
@neoatomic Why does it happen?, anything i can do to prevent it from happening again?
Cant say sadly. Maybe running 2 instances at the same time.? Or copying/moving the files.?
Or did you use the db with another fork.?
If it happens again than see if you can check the log what SR was doing.
Just generate metadata files for your shows, so you can build a new db quickly, and make backups till you are sure the problem is gone.
Power outtage, disk failure, etc
For those of you running into this issue, you may be able to recover your database like this :
/opt/sickrage for me) and make a backup of the corrupted databasecp sickbeard.db sickbeard.db.backup
sudo apt install sqlite3
sqlite3 sickbeard.db
sqlite> .mode insert
sqlite> .output sickbeard_dump.sql
sqlite> .dump
sqlite> .exit
rm sickbeard.db
sqlite3 sickbeard.db < sickbeard.sql
And that fixed it for me.
I guess this problem can happen if the device shutdown while database is updating, so doing this technique will almost certainly end up in a loss of information but for me loosing one or two info about a fetch was worth it :wink:
small typo though :
sqlite3 sickbeard.db < sickbeard_dump.sql
other than that, it worked for me ! Thanks :)
Most helpful comment
For those of you running into this issue, you may be able to recover your database like this :
/opt/sickragefor me) and make a backup of the corrupted databaseAnd that fixed it for me.
I guess this problem can happen if the device shutdown while database is updating, so doing this technique will almost certainly end up in a loss of information but for me loosing one or two info about a fetch was worth it :wink: