![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Oct 2012
Device: Sony PRS-500
|
![]()
I have a serious problem with Calibre 0.9.2 on my Win7 laptop.
I have attempted to reconstruct from notes the following as my attempted recovery sequence but cannot guarantee the order of commands in detail. I was actively using Calibre when the laptop crashed. I suspect something caused a hard disk problem which caused Windows to reboot. I do not know if it was caused by Windows, Calibre or the laptop hardware as the laptop boot complained it could not find the Operating System but Windows correctly started after a power-off and power-on. I then used the standard Windows Check Disk on reboot to both: Automatically fix file system errors, and; Scan for and attempt recovery of bad sectors. Then I tried to run Calibre but I got a calibre.exe is not responding error. I then tried calibre-debug.exe -g calibre 0.9.2 Windows-7-6.1.7601-SP1 <'Windows', '7', '6.1.7601'> Python 2.7.3 Windows: <'7', '6.1.7601', 'SP1', 'Multiprocessor Free'> Starting up... Catostrophic failure initializing GUI, bailing out... I also got a popup window containing the following information: calibre, version 0.9.2 ERROR: Failed: Restoring database failed, click Show details to see details Traceback (most recent call last): File "site-packages\calibre\library\restore.py", line 116, in run File "site-packages\calibre\library\restore.py", line 279, in replace_db WindowsError: [Error 32] The process cannot access the file because it is being used by another process I thought that the calibre installation might be corrupt so I used the file calibre-0.9.2.msi to perform a repair. At some point calibre asked me the following: Choose a location for your new calibre e-book library In doubt of the correct answer, I cancelled out and it has never been asked again so I am not sure which piece of software was asking it as I have performed the calibre installation repair more than once. Then I tried the following command: calibredb restore_database --really-do-it Restoring database succeeded old database saved as C:\Users\Steve\Calibre Library\metadata_pre_restore.db Some errors occurred. A detailed report was saved to calibre_db_restore_report.txt This showed three different categories of minor problem: One instance of: File "site-packages\calibre\library\restore.py", line 159, in scan_library File "site-packages\calibre\library\restore.py", line 181, in process_dir File "site-packages\calibre\ebooks\metadata\opf2.py", line 564, in __init__ File "xpath.pxi", line 455, in lxml.etree.XPath.__call__ (src/lxml/lxml.etree.c:115107) File "apihelpers.pxi", line 37, in lxml.etree._documentOrRaise (src/lxml/lxml.etree.c:11215) TypeError: Invalid input object: NoneType Two instances of: File "site-packages\calibre\library\restore.py", line 245, in restore_books File "site-packages\calibre\library\restore.py", line 268, in restore_book File "site-packages\calibre\library\sqlite.py", line 313, in run IntegrityError: columns book, format are not unique Eleven instances of: File "site-packages\calibre\library\restore.py", line 245, in restore_books File "site-packages\calibre\library\restore.py", line 259, in restore_book File "site-packages\calibre\library\database2.py", line 3352, in create_book_entry File "site-packages\calibre\library\sqlite.py", line 313, in run IntegrityError: PRIMARY KEY must be unique Not bad for a database that before the crash contained more than ten thousand books and nothing to indicate any other problems. However, calibre still will not start so I tried another database repair command: C:\Users\Steve\Calibre Library> calibre-debug --reinitialise-db metadata.db Python function terminated unexpectedly disk I/O error RemoteTraceback (most recent call last): File "site-packages\calibre\library\sqlite.py", line 248, in run File "site-packages\calibre\library\sqlite.py", line 226, in connect OperationalError: disk I/O error (Error Code: 1) Traceback (most recent call last): File "site.py", line 132, in main File "site.py", line 109, in run_entry_point File "site-packages\calibre\library\debug.py", line 260, in main File "site-packages\calibre\library\debug.py", line 260, in main File "site-packages\calibre\library\sqlite.py", line 366, in connect calibre.library.sqlite.DatabaseException: disk I/O error RemoteTraceback (most recent call last): File "site-packages\calibre\library\sqlite.py", line 248, in run File "site-packages\calibre\library\sqlite.py", line 226, in connect OperationalError: disk I/O error (Error Code: 1) The metadata.db and metadata_pre_restore.db are both the same size (20,660 KB), but if I examine them with SQLite Database Browser 2.0 b1.exe metadata_pre_restore.db shows content (although it only contains about 4000 books) but metadata.db appears to be empty. When I try to run calibre it still hangs and error.txt contains the following: Python function terminated unexpectedly disk I/O error RemoteTraceback (most recent call last): File "site-packages\calibre\library\sqlite.py", line 248, in run File "site-packages\calibre\library\sqlite.py", line 226, in connect OperationalError: disk I/O error (Error Code: 1) However, I can copy metadata.db using Windows Explorer so I do not understand the error or what I can do next. Is it an sqlite error and what does it mean? The permissions appear to be identical for both metadata .db files, so I cannot think of any more fixes to try without more knowledge of the errors and expected recovery behaviour. Thanks, and I apologize for the length of this account of a so-far unsuccessful recovery. |
![]() |
![]() |
![]() |
#2 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Oct 2012
Device: Sony PRS-500
|
REBUILD DATABASE RESOLVED
====================== Spoiler:
SOLUTION -------- For a successful database rebuild, deleting the metadata.db was essential before doing the database rebuild. The following failed to delete or rename this file, so was destined to be unsuccessful with whatever was the cause of this problem. However, I have not determined whether the two ways of rebuild the database are exactly equivalent (although I assume they are). calibredb restore_database --really-do-it In addition, it appears the the term restore_database is misleading because it is really a rebuild_database operation as it does not recover the database from a single archive file. Last edited by theducks; 10-14-2012 at 10:08 AM. Reason: wrap HUGE paste in spoiler |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Sorry, but your post is a horror for reading. A better way is to use Spoiler for your log listings. Then it is better to see what is a log and what is something what you wrote as comment or question.
If Calibre is not able to override the metadata.db then your OS is blocking the file. These mainly happen when an application is crashing without unlock the file. In this case you need to shut down the user profile and restart again. Then you can rename or delete the metadata.db and start Calibre again and rebuild the database. Last edited by Divingduck; 10-14-2012 at 07:47 AM. |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Oct 2012
Device: Sony PRS-500
|
Thanks for the Spoiler link but it looks like there is a serious learning curve to improve the log with the tags. What I really need is some form of utility to capture the data as I encounter the bug.
I think that my problems were caused by Calibre running in the System Tray which means that closing Calibre and restarting it was not sufficient. I have learned the lesson to log out and log back in to clear all running applications. However, it is good to know that I do not have to scrabble around for a lock file like I have to do with VMware and other virtualisation software. |
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,909
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with editing metadata | rrvult | Library Management | 20 | 11-26-2012 07:25 AM |
Using Calibre 8.38 - Problem after editing metadata | mitch13 | Library Management | 2 | 03-01-2012 10:57 PM |
Please help me debug problem with Calibre crashing when downloading metadata. | kacir | Development | 1 | 09-10-2011 05:17 PM |
problem with metadata | FranSmith | Calibre | 17 | 01-23-2011 11:54 AM |
Problem with Metadata Plugboard | cheveguerra | Calibre | 3 | 10-05-2010 12:00 PM |