Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 08-27-2012, 03:54 PM   #1
wladdy
Enthusiast
wladdy began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Oct 2010
Device: iPad / Kindle DX
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.
wladdy is offline   Reply With Quote
Old 08-27-2012, 03:56 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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
kovidgoyal is offline   Reply With Quote
Advert
Old 08-28-2012, 01:46 AM   #3
wladdy
Enthusiast
wladdy began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Oct 2010
Device: iPad / Kindle DX
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.
wladdy is offline   Reply With Quote
Old 08-28-2012, 01:56 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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.
kovidgoyal is offline   Reply With Quote
Old 08-28-2012, 04:29 AM   #5
wladdy
Enthusiast
wladdy began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Oct 2010
Device: iPad / Kindle DX
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.
wladdy is offline   Reply With Quote
Advert
Old 08-28-2012, 04:33 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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.
kovidgoyal is offline   Reply With Quote
Old 08-28-2012, 05:04 AM   #7
wladdy
Enthusiast
wladdy began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Oct 2010
Device: iPad / Kindle DX
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.
wladdy is offline   Reply With Quote
Reply

Tags
corrupt, database, unable

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open any books Paulinafrica Amazon Kindle 42 03-19-2012 04:48 PM
unable to update your devices database.syncing cannot be completed? baronrus Kobo Reader 5 12-20-2010 10:25 AM
We are unable to update your device's database. Syncing cannot be completed. talios Kobo Reader 1 12-10-2010 03:16 AM
Unable to open database file JulieR Calibre 2 04-24-2009 04:40 AM
Unable to open file that is 8MB timyap Sony Reader 12 05-09-2008 09:51 AM


All times are GMT -4. The time now is 10:43 PM.


MobileRead.com is a privately owned, operated and funded community.