12-04-2017, 08:11 PM | #1 |
Junior Member
Posts: 4
Karma: 45500
Join Date: Dec 2017
Device: Kindle Voyage
|
CantOpenError
Used Calibre for several years without issue. Now multiple errors when trying to add books, or tick a custom Yes/No field, or download metadata, etc., etc.
Running WIN10 Pro installed on SSD C-drive. Calibre library located on local D-drive. The "metadata.db" and "metadata_db_prefs_backup.json" files are both living in the Calibre library folder. No syncing programs in use. Windows Defender is only antivirus running. Ample free space on all drives. Typical Errors: ERROR: Errors while adding ERROR: Failed to set data ERROR: Unhandled exception (IOError:[Errno 9] Bad file descriptor) "Restore database" tool from the Calibre library toolbar icon fails. No doubt these issues all stem from the same anomaly, i.e., "CantOpenError. " Desperate for solution. See error details below from trying to add a book: ---------------------------------------------------------------------- Failed to add the book: Microsoft Access 2010 VBA Macro Programming 2012 D:\Downloads\Microsoft Access 2010 VBA Macro Programming 2012\Microsoft Access 2010 VBA Macro Programming 2012.pdf With error: Traceback (most recent call last): File "site-packages\calibre\gui2\add.py", line 399, in add_book File "site-packages\calibre\db\legacy.py", line 224, in create_book_entry File "site-packages\calibre\db\cache.py", line 63, in call_func_with_lock File "site-packages\calibre\db\cache.py", line 1556, in create_book_entry File "site-packages\calibre\db\backend.py", line 844, in execute File "c:\t\t\apsw-j6gj96\apsw-3.13.0-r1\src\cursor.c", line 236, in resetcursor CantOpenError: CantOpenError: unable to open database file |
12-04-2017, 10:30 PM | #2 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Something, most likely an antivirus program is blocking calibre from opening the metadata.db file in its library folder.
|
12-04-2017, 10:54 PM | #3 |
Junior Member
Posts: 4
Karma: 45500
Join Date: Dec 2017
Device: Kindle Voyage
|
CantOpenError
Thanks for responding, however that's not much help. As I said, the only antivirus I am running is Windows Defender which is pretty much baked into Windows 10. The only way to disable it is to install a third party antivirus. I can't think of any other thing that could be blocking the opening of the metadata.db file.
|
12-05-2017, 12:17 AM | #4 | ||
null operator (he/him)
Posts: 20,553
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
BR |
||
12-05-2017, 02:34 AM | #5 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Hm. I never seen Windows Defender blocking calibre (today and in the past). Maybe something else is going wrong.
|
12-05-2017, 02:55 AM | #6 | |
Junior Member
Posts: 4
Karma: 45500
Join Date: Dec 2017
Device: Kindle Voyage
|
Quote:
See attached screenshots of Calibre2 and app folders: I'm convinced that Defender is not blocking the metadata.db file, and I doubt that the Safe Mode/CALIBRE_OVERRIDE_DATABASE_PATH solution would resolve anything, as I the library is not on a network drive. There must be some way I can cleanly reinstall Calibre and get the correct Calibre2 folder structure and content. But every time I try, the install dir comes up this same way. Very frustrating! What am I doing wrong? |
|
12-05-2017, 03:19 AM | #7 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Nothing wrong with this structure.
Here you will find some hints for a clean install: https://manual.calibre-ebook.com/faq...is-not-working I would suggest to run calibre first in debug mode. Maybe this will give you a bit more detail information. |
12-05-2017, 03:37 AM | #8 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The folder layout is correct. It was changed in calibre 3.x
The cantopenerror literally means that sqlite issued an open() system call for the metadata.db file and it failed. That can happen only because: 1) The library path points to a non-existing directory/drive/etc. 2) Something is blocking access 3) permissions on the file/directory are screwed up I suggest you start with a new library, run calibre from a command prompt as calibre --with-library c:\library making sure that the folder c:\library exists and is writable by your user account. If that works you know it is something wrong with the old library folder, if it doesn't you know it is something blocking calibre. |
12-05-2017, 04:00 AM | #9 | |
null operator (he/him)
Posts: 20,553
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
- why am I not surprised you use X2, I was about to post this
@rfcdvc45 - The install structure changed with version 3.0 I too doubt Defender is the culprit, but given its easy to exclude the calibre folder why not put that possibility to bed. What it's more likely to be is a 3rd party program that runs at start up, or a Windows shell extension, running in Safe Mode will eliminate many of those. And I've seen this a few times -- "blah blah' doesn't happen if I run calibre in admin mode -- I have no explanation for that, other than a Windows problem, IIRC in at least one instance it may have been solved with a system file scan. And on a couple of occasions 'weird' problems have manifested in the 64 bit version but not in the 32 bit version, on the same machine - I have no explanation for that either. This is from the "calibre freezes/crashes" FAQ: Quote:
|
|
12-05-2017, 04:30 AM | #10 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
|
12-05-2017, 10:31 AM | #11 | |
Well trained by Cats
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
I would look at some 'helper utilities' that you may have installed. Note: they don't need to be of the Malware kind, they just don't play nice. |
|
12-05-2017, 04:20 PM | #12 | |
Junior Member
Posts: 4
Karma: 45500
Join Date: Dec 2017
Device: Kindle Voyage
|
CantOpenError Solved!
Quote:
You guys at MobileRead rock! Couldn't have done it without your help. |
|
12-05-2017, 05:53 PM | #13 |
null operator (he/him)
Posts: 20,553
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@rfcdvc45 - thanks for letting us know, karma coming your way
I have WU set to 60 days after the "suitable for business" version ships, so I'm still on 1703. BR |
12-06-2017, 03:12 AM | #14 |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
@rfcdvc45 - never mind, I have this as well activated with exceptions for calibre and forgot it after I made the set up. Thanks for keep us informed.
|
Tags |
cantopenerror, corrupt database, failed to set data |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help!!!! CantOpenError: unable to open database file | cbbs70a | Library Management | 2 | 06-11-2015 11:11 AM |