MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Library Management (https://www.mobileread.com/forums/forumdisplay.php?f=236)
-   -   Unable to open database file (https://www.mobileread.com/forums/showthread.php?t=189205)

wladdy 08-27-2012 04:54 PM

Unable to open database file
 
Whenever I try to update any piece of metadata in any of my books, I get the following error message:

Quote:

calibre, version 0.8.66
ERROR: Failed to set data: Could not set data, click Show Details to see why.

Traceback (most recent call last):
File "site-packages/calibre/gui2/library/models.py", line 872, in setData
File "site-packages/calibre/gui2/library/models.py", line 940, in _set_data
File "site-packages/calibre/library/database2.py", line 2124, in set
File "site-packages/calibre/library/database2.py", line 2392, in set_authors
File "site-packages/calibre/library/database2.py", line 2335, in _set_authors
File "site-packages/calibre/library/sqlite.py", line 314, in run
DatabaseException: unable to open database file
RemoteTraceback (most recent call last):
File "site-packages/calibre/library/sqlite.py", line 271, in run
OperationalError: unable to open database file
Furthermore, whenever I click on 'Click to open' button next to 'Path:", nothing happens. However, if I double-click on a given book in the main lister, it does open.

Finally, when I do Library Maintenance/Check library, I simply get no response, as if I had pressed on nothing.

It seems like I got a serious database issue, but I have not idea how to fix it. Any help would be greatly appreciated. Thanks in advance. W.

PS - I am running version 0.8.66 on Mac OS X Mountain Lion.

kovidgoyal 08-27-2012 04:56 PM

Go to your calibre library folder and delete/rename the metadata.db file. Then start calibre and follow the instructions here: http://manual.calibre-ebook.com/faq....n-app-is-blank

wladdy 08-28-2012 02:46 AM

Thanks for the prompt reply, Kovid.

Unfortunately, your suggestion did not help. I exited Calibre and deleted 'metadata.db' (I also had a 'metadata_pre_restore.db' and a 'metadata_db_prefs_backup.json', that I deleted as well).
Upon re-opening Calibre, I was asked whether I wanted to rebuild my corrupted database or open an empty one. The accompanying error message was:

Quote:

calibre, version 0.8.66
Corrupted database: The library database at /Volumes/Everyday Companion 1.5 TB/---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 192, in initialize_db
File "site-packages/calibre/library/database2.py", line 198, in __init__
File "site-packages/calibre/library/database2.py", line 152, in connect
File "site-packages/calibre/library/database2.py", line 545, in initialize_database
File "site-packages/calibre/library/sqlite.py", line 314, in run
DatabaseException: unable to open database file
RemoteTraceback (most recent call last):
File "site-packages/calibre/library/sqlite.py", line 271, in run
OperationalError: unable to open database file
I click 'Yes' and initiate a rebuild process that takes a few hours on my MacBook Air (the library has over 16000 books). The rebuild process seems to succeed with no apparent interruptions, yet when it's over I'm back to square one, with exactly the same symptoms that I described in my first post.

Do I have any options left to salvage my library and its metadata or is my only choice to create a fresh empty library and reimport all the 16k+ books from the current Calibre database folder?

Thanks in advance. W.

kovidgoyal 08-28-2012 02:56 AM

You need to figure out what is preventing the db file from being opened. I'd guess it because you have your db on a networked drive or you have some ativirus program that is locking it.

wladdy 08-28-2012 05:29 AM

Thanks Kovid, but the database in on a local external USB drive over which I have full read/write privileges and my Mac is without any 3rd party antivirus.

Could you maybe suggest some other leads that I could investigate?

Also, if I can't find anything and must reimport all the books into a fresh library (losing, I suppose, all my metadata in the process), should I simply go to 'Add book... (assumes every ebook file is a different book)', select the folder of the old library and just let Calibre work for a few hours? Is there something else that I need to be aware of?

Thanks a lot! W.

kovidgoyal 08-28-2012 05:33 AM

Yes the add books is all you need to do,and you wont lose metadata doing it.

Though if you make your library in the same place, you'll likely suffer from the same problem again.

wladdy 08-28-2012 06:04 AM

I ran Mac OS X's Disk Utility on the external hard drive to scan it and repair it, and it did the trick!

Thanks a lot Kovid for pointing me in the right direction, responding so quickly and starting this great software! Bye for now. W.


All times are GMT -4. The time now is 09:23 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.