MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Devices (https://www.mobileread.com/forums/forumdisplay.php?f=234)
-   -   CantOpenError: unable to open database file (https://www.mobileread.com/forums/showthread.php?t=295491)

Zepa77 03-12-2018 06:55 AM

CantOpenError: unable to open database file
 
Hi,

I've downloaded Kindle 1.17.44170, then downloaded my books, But when i drag them over to Calibre, I get the following error message. I am singularly nontechnical, so have no idea what to do about it. I assume I've done something wrong in the download, but can't figure out what.

calibre, version 3.19.0
ERROR: Errors while adding: Failed to add any books, click "Show details" for more information


----------------------------------------------------------------------
Failed to add the book: Devil Water
C:\Users\zepa7\AppData\Local\Temp\calibre_vkfgjj\p rehzx_add_books\0\B00IRIFYF8_EBOK.azw3
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 1566, in create_book_entry
File "site-packages\calibre\db\cache.py", line 1287, in set_metadata
File "site-packages\calibre\db\cache.py", line 1113, in update_path
File "site-packages\calibre\db\backend.py", line 1574, in update_path
File "site-packages\calibre\db\tables.py", line 135, in set_path
File "site-packages\calibre\db\backend.py", line 845, 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

pdurrant 03-12-2018 06:59 AM

It looks to me more like a calibre installation problem. But I don't know what.

Zepa77 03-12-2018 07:14 AM

It was a recent installation (few days ago) on a new 'clean' machine - does a re-install sound like a good idea?

kovidgoyal 03-12-2018 09:24 AM

That error is typically caused by an antivirus program blocking calibre from accessing its database. Either disable it or exclude the calibre library folder from its scans.

DoctorOhh 03-12-2018 09:24 AM

Quote:

Originally Posted by Zepa77 (Post 3668524)
I've downloaded Kindle 1.17.44170, then downloaded my books, But when i drag them over to Calibre, I get the following error message. I am singularly nontechnical, so have no idea what to do about it. I assume I've done something wrong in the download, but can't figure out what.
...~~~...
CantOpenError: CantOpenError: unable to open database file

Kovid has always said the following about this error.

Quote:

Originally Posted by kovidgoyal (Post 3621665)
Something, most likely an antivirus program is blocking calibre from opening the metadata.db file in its library folder.

One user solved it by the following:

Quote:

Originally Posted by rfcdvc45 (Post 3622081)
Thanks to all of you who helped me on this one. Yes, it was in fact something blocking the Calibre files, and yes, it was in fact Defender! Turns out it was a new feature in Defender that shipped with the latest Fall Creators Update v1709. The feature, which I had forgotten, and which I had enabled is called 'Controlled Folder Access.' It is supposed to help guard against potential ransomware attacks. Anyway, when I realized that this was the blocking agent, I created an exception for Calibre. Once unblocked, I created a new Calibre Library, copied back the book folders into it. And finally I had to use the 'Restore Database' tool in Calibre. Now all's well again.

You guys at MobileRead rock! Couldn't have done it without your help.


Zepa77 03-12-2018 11:58 AM

Hi All,

It was MacAfee (which came with the PC and which my partner did immediately tell me to remove..... I shall listen to her in future --- maybe :-) )

Thank you all very much; I don't think I have ever had such fast responses from a forum, especially one I only joined today! Brilliant.

Zepa77 03-12-2018 01:12 PM

Sigh.

Now I am just confused. Having added a few books successfully, I downloaded the remainder of my Amazon books, at which point they again started to get the same error message. The anti-virus is off, so I'm wondering what i did to 'break' calibre again and if I need to do the 'restore database' referred to by DoctorOhh above. However, can't find that. Apologies for being a pain, but this is bugging the heck out of me....

DNSB 03-12-2018 01:28 PM

Quote:

Originally Posted by Zepa77 (Post 3668708)
Sigh.

Now I am just confused. Having added a few books successfully, I downloaded the remainder of my Amazon books, at which point they again started to get the same error message. The anti-virus is off, so I'm wondering what i did to 'break' calibre again and if I need to do the 'restore database' referred to by DoctorOhh above. However, can't find that. Apologies for being a pain, but this is bugging the heck out of me....

You might want to check the Dealing with Kindle for PC/Mac 1.19 and KFX in calibre sticky.

pdurrant 03-12-2018 02:24 PM

Quote:

Originally Posted by Zepa77 (Post 3668708)
Sigh.

Now I am just confused. Having added a few books successfully, I downloaded the remainder of my Amazon books, at which point they again started to get the same error message. The anti-virus is off, so I'm wondering what i did to 'break' calibre again and if I need to do the 'restore database' referred to by DoctorOhh above. However, can't find that. Apologies for being a pain, but this is bugging the heck out of me....

Are you certain it's really the same error?

Are you certain your Anti-virus hasn't turned itself back on?

Zepa77 03-12-2018 06:11 PM

Quote:

Originally Posted by DNSB (Post 3668716)

That is the thread I started with, and it seemed to be going fine until..... (and so far as I can tell both Defender and McAfee are turned off).

calibre, version 3.19.0
ERROR: Errors while adding: Failed to add any books, click "Show details" for more information


----------------------------------------------------------------------
Failed to add the book: A Time of Hope (Part Five of The People of this Parish Saga)
C:\Users\zepa7\AppData\Local\Temp\calibre_4hijxg\5 6rraj_add_books\0\B00CDT5E3O_EBOK.mobi
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 1566, in create_book_entry
File "site-packages\calibre\db\cache.py", line 1287, in set_metadata
File "site-packages\calibre\db\cache.py", line 1113, in update_path
File "site-packages\calibre\db\backend.py", line 1574, in update_path
File "site-packages\calibre\db\tables.py", line 135, in set_path
File "site-packages\calibre\db\backend.py", line 845, 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

BetterRed 03-12-2018 06:21 PM

@Zepa77 - to get rid of McAfee entirely you may need to download and run a 'utility' from McAfee. I don't know whether that still applies, but it did the last time I needed to get rid of it from someone's system. Search the Web for "Remove McAfee".

BR

rwmcafee 03-12-2018 10:02 PM

And don't worry. It won't remove me. :rofl::offtopic:

PaceyIV 07-30-2018 03:55 PM

I have the same error when I use Calibre Portable on my PC on my NAS.

Quote:

calibre 3.28 Portable embedded-python: True is64bit: False
Windows-10-10.0.17134-SP0 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '10', '10.0.17134')
Python 2.7.12+
Windows: ('10', '10.0.17134', 'SP0', u'Multiprocessor Free')
Interface language: it
Successfully initialized third party plugins: DeDRM (6, 2, 1) && Find Duplicates (1, 6, 3) && Search The Internet (1, 7, 6) && Count Pages (1, 8, 2) && INMONDADORI (0, 2, 1)
Traceback (most recent call last):
File "site-packages\calibre\gui2\actions\add.py", line 285, in add_empty
File "site-packages\calibre\db\legacy.py", line 253, in import_book
File "site-packages\calibre\db\cache.py", line 1597, in add_books
File "site-packages\calibre\db\cache.py", line 63, in call_func_with_lock
File "site-packages\calibre\db\cache.py", line 1567, in create_book_entry
File "site-packages\calibre\db\cache.py", line 1287, in set_metadata
File "site-packages\calibre\db\cache.py", line 1113, in update_path
File "site-packages\calibre\db\backend.py", line 1572, in update_path
File "site-packages\calibre\db\tables.py", line 136, in set_path
File "site-packages\calibre\db\backend.py", line 843, in execute
File "c:\t\t\apsw-bdov6u\apsw-3.23.1-r1\src\cursor.c", line 236, in resetcursor
CantOpenError: CantOpenError: unable to open database file
I can modify database, setting for example custom column on existing record, but when I try to add new books I get this error. If I close Calibre and open it again I can see the book I've created.
If I import a book from file I get the same error. If I close Calibre and open it again I can see the book I've created but without the file.
If I copy the whole Calibre Portable directory into my disk I have no error, but I've always use Calibre Portable on that network disk without problem.

theducks 07-30-2018 11:46 PM

NAS and other networked drives are not supported (and iffy, if you ever got them to work).
Adding books in calibre is very complex (file system wise). You create folders, add 2 or 3 files (single book format), update the DB.

All this has to happen in order and quickly.

In your case, something is blocking or slowing down one of thos steps, so another fails.

PaceyIV 07-31-2018 10:13 AM

I can share a network drive from a virtual machine and use calibre inside it wirhout errors. In my previous setting I've used Debian 9 on a low power arm board. Calibre works in it. It was slow in the start and when I add sine books from file. Non I upgrade my server with a more power solution: an Intel celeron and I use u ubuntu server. Calibre starts more quickly now.
I can't believe It can't works.
The speed can't be a problem. Windows takes only more time to do the system callback.

Can you help me to lunch calibre with a debugger to check what is going wrong? I am a Visual Studio developer (VB.net, c# and c++).


All times are GMT -4. The time now is 04:18 PM.

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