![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Mar 2025
Device: Kindle
|
Corrupted library
Hi. I've been using Calibre for more than 10 years without any single problem. Currently I'm using v.7.26
Today I opened it, like any other day, and I found an error saying that the library was corrupted and asking if I wanted to open a new library. I searched over the internet and I found a reply by Kovid suggesting to do a repair with calibredb repair_database -r. So I did, and it ended with "Restoring database succeeded", but the problem persisted. So, I opened Calibre and created a new library, and tried to switch to the old library. When I do that I get a different error, saying: UnicodeDecodeError: uft8 codec can't decode byte 0x8c in position 117: invalid start byte When I try to switch to the library a second time, then the error changes, and says that the library is corrupted and asks if I want Calibre to try and restore. So I say yes, it goes through all the books, with the blue progress bar... and after finishing, I get a message saying that the restore failed. When I click Show details, it starts like calibre, version 7.26.0 ERROR: Failed to repair library: Restoring database failed, click "Show details" to see details Traceback (most recent call last): File "calibre\db\restore.py", line 325, in replace_db PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'path_to_db\\metadata.db' -> 'path_to_db\\metadata_pre_restore.db' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "calibre\db\restore.py", line 156, in run File "calibre\db\restore.py", line 330, in replace_db PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'path_to_library\\metadata.db' I checked and there is no other process accessing metadata.db. Actually, when I try to do anything with the file, like moving, or renaming, Windows says that calibre.exe has the file open. In addition to those errors, there is an entry for each book like this calibre, version 7.26.0 ERROR: Failed to repair library: Restoring database failed, click "Show details" to see details Traceback (most recent call last): File "calibre\db\restore.py", line 325, in replace_db PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '\\\\bianconet\\public\\books\\ebooks\\metadata.db ' -> '\\\\bianconet\\public\\books\\ebooks\\metadata_pr e_restore.db' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "calibre\db\restore.py", line 156, in run File "calibre\db\restore.py", line 330, in replace_db PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '\\\\bianconet\\public\\books\\ebooks\\metadata.db ' ------------- Failed to restore: Francisco de Quevedo y Villegas/La vida del Buscon (313) Traceback (most recent call last): File "calibre\db\restore.py", line 302, in restore_books File "calibre\db\cache.py", line 85, in call_func_with_lock File "calibre\db\cache.py", line 2930, in restore_book File "calibre\db\cache.py", line 2150, in create_book_entry File "calibre\db\backend.py", line 1145, in execute File "C:\t\t\apsw-42s16m2x\src\cursor.c", line 240, in resetcursor apsw.ConstraintError: ConstraintError: UNIQUE constraint failed: books.id Am I hopeless? |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,249
Karma: 78869092
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Looking at the log I see
Code:
\\\\bianconet\\public\\books\\ebooks\\metadata.db This looks suspiciously like your library is located on a network share of some type. It's strongly advised that calibre libraries are located on LOCAL disks only. |
![]() |
![]() |
![]() |
#3 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Mar 2025
Device: Kindle
|
Got it. Thanks. I was not aware of that. Does that mean there is no way to recover my database?
|
![]() |
![]() |
![]() |
#4 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 443
Karma: 3367292
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
|
Quote:
Running a Calibre library on a remote or shared drive often works until it doesn't. It will fail eventually. Fine for a one-way backup, except google drive, never google, but that is all. It is likely the book files themselves are still OK. |
|
![]() |
![]() |
![]() |
#5 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,873
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The problem is most likely that some process is accessing the database on the system it's being stored on over the network. What you can try is setting the AV to ignore the directory tree your calibre libraries are stored on the other computer.
|
![]() |
![]() |
![]() |
Tags |
help calibre |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Corrupted Library | Dan__ | Library Management | 6 | 12-09-2024 06:14 AM |
Intact Library, metadata corrupted (half library not showing) | puxatudo | Library Management | 1 | 08-02-2022 09:06 AM |
My library is corrupted. | CCLady | Calibre | 23 | 07-28-2012 09:34 PM |
903 Corrupted library | Raisan | PocketBook | 1 | 04-09-2011 09:20 AM |
Library corrupted | rozie123 | Sony Reader | 1 | 05-26-2009 07:02 AM |