![]() |
#1 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 28554
Join Date: Mar 2013
Device: Kindle Keyboard, KPW2
|
![]()
Hello everyone,
My Windows 7 computer (running a 250GB SSD) crashed for some reason and after a restart, Calibre throws up this message on opening: Code:
calibre, version 2.26.0 Corrupted database: The library database at C:\Users\John\Documents\Calibre Library appears to be corrupted. Do you want calibre to try and rebuild it automatically? The rebuild may not be completely successful. If you say No, a new empty calibre library will be created. Traceback (most recent call last): File "site-packages\calibre\gui2\main.py", line 278, in initialize_db File "site-packages\calibre\db\legacy.py", line 70, in __init__ File "site-packages\calibre\db\legacy.py", line 44, in create_backend File "site-packages\calibre\db\backend.py", line 354, in __init__ File "site-packages\calibre\db\backend.py", line 1077, in fget File "site-packages\calibre\db\backend.py", line 795, in conn File "site-packages\calibre\db\backend.py", line 253, in __init__ File "site-packages\calibre\db\backend.py", line 297, in execute File "c:\cygwin64\home\kovid\sw\build\apsw-3.8.2-r1\src\cursor.c", line 990, in APSWCursor_execute.sqlite3_prepare File "c:\cygwin64\home\kovid\sw\build\apsw-3.8.2-r1\src\statementcache.c", line 386, in sqlite3_prepare CorruptError: CorruptError: database disk image is malformed ![]() Many thanks for your time in advance. Last edited by adrenaline; 06-19-2015 at 04:57 PM. |
![]() |
![]() |
![]() |
#2 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Do a Restore Database, under Library Maintenance in the Library switcher toolbar dropdown.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 28554
Join Date: Mar 2013
Device: Kindle Keyboard, KPW2
|
Quote:
![]() Obviously that needs to be done on the main Calibre window after clicking "Yes"on this dialog box, right? ![]() Last edited by adrenaline; 06-19-2015 at 05:32 PM. |
|
![]() |
![]() |
![]() |
#4 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Actually, that dialog is a shortcut to doing exactly that.
![]() I couldn't be precisely clear on the details as I have always been careful to avoid corruption, so it's been a few years since the one time I had to do this. ![]() |
![]() |
![]() |
![]() |
#5 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 28554
Join Date: Mar 2013
Device: Kindle Keyboard, KPW2
|
Thanks again, eschwartz. Clicked on "Yes" and got this error message after the restore reached 100%:
Code:
calibre, version 2.26.0 ERROR: Failed: Restoring database failed, click Show details to see details Traceback (most recent call last): File "site-packages\calibre\db\restore.py", line 125, in run File "site-packages\calibre\db\restore.py", line 277, in replace_db WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'C:\\Users\\John\\Documents\\Calibre Library\\metadata.db' |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
That implies some other program has the file open and is locking it. Perhaps your antivirus is scanning it or something?
You might try running the restore via the command-line -- type the following into the command prompt: Code:
calibredb restore_database -r |
![]() |
![]() |
![]() |
#7 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 28554
Join Date: Mar 2013
Device: Kindle Keyboard, KPW2
|
Quote:
![]() Disabled Kaspersky Internet Security and MalwareBytes and tried restoring using command prompt. Code:
Restoring database succeeded old database saved as C:\Users\John\Documents\Calibre Library\metadata_pre_restore.db Some errors occurred. A detailed report was saved to calibre_db_restore_report.txt I see about 10 books with similar error message as this one: Code:
C:\Users\John\Documents\Calibre Library\American Academy Of Pediatrics\The American Academy of Pediatrics Guide (91) with error: Traceback (most recent call last): File "site-packages\calibre\db\restore.py", line 253, in restore_books File "site-packages\calibre\db\cache.py", line 57, in call_func_with_lock File "site-packages\calibre\db\cache.py", line 1983, in restore_book File "site-packages\calibre\db\backend.py", line 1707, in restore_book File "site-packages\calibre\db\backend.py", line 816, in executemany File "c:\cygwin64\home\kovid\sw\build\apsw-3.8.2-r1\src\cursor.c", line 231, in resetcursor ConstraintError: ConstraintError: UNIQUE constraint failed: data.book, data.format But wondering whether the other books in the library are okay and how I can prevent this from happening in the future (apart from the system crashing on its own). I make backups of the Calibre folder once in two weeks. Last edited by adrenaline; 06-19-2015 at 07:47 PM. |
|
![]() |
![]() |
![]() |
#8 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
That error is saying the books aren't "unique", that is, the book_id is the same as another. Sometimes seen when Dropbox or some other syncing service records an edit clash (in which case you end up with two "_______'s conflicting copy").
calibre requires each book have a unique internal book number and a restore will reject the duplicates. Note that it reported success. You can manually add those as new books if you need to. |
![]() |
![]() |
![]() |
#9 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 28554
Join Date: Mar 2013
Device: Kindle Keyboard, KPW2
|
Great, thanks so much for explaining the issue, eschwartz!
![]() Greatly appreciate your help ![]() |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Import an old Calibre library with corrupted database | Beanxx | Library Management | 3 | 05-08-2015 04:12 PM |
My library is corrupted. | CCLady | Calibre | 23 | 07-28-2012 09:34 PM |
903 Corrupted library | Raisan | PocketBook | 1 | 04-09-2011 09:20 AM |
Calibre library corrupted - slightly freaked out! | chilady1 | Calibre | 6 | 12-08-2010 08:56 PM |
Library corrupted | rozie123 | Sony Reader | 1 | 05-26-2009 07:02 AM |