Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 05-28-2024, 09:15 AM   #1
diane55
Member
diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.
 
Posts: 22
Karma: 4897
Join Date: Dec 2012
Device: Kobo Glo
Impossible to restore the database

Hi,

OS : Windows 10
Calibre : 7.11.0

Today, I found that Calibre database - which is stored on an external disk (1) - is corrupted.
Yesterday, I have checked it via "Maintenance de la bibliothèque/ Vérifier la bibliothèque" : there was no error.

Quote:
Traceback (most recent call last):
File "calibre\db\backend.py", line 1560, in read_tables
File "calibre\db\tables.py", line 117, in read
File "C:\t\t\apsw-42s16m2x\src\cursor.c", line 240, in resetcursor
apsw.CorruptError: CorruptError: database disk image is malformed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "calibre\gui2\ui.py", line 951, in library_moved
File "calibre\db\legacy.py", line 196, in __init__
File "calibre\db\cache.py", line 431, in init
File "calibre\db\backend.py", line 1557, in read_tables
apsw.CorruptError: CorruptError: database disk image is malformed


But it is impossible to restore it
Quote:
Traceback (most recent call last):
File "calibre\db\restore.py", line 329, in replace_db
PermissionError: [WinError 32] Le processus ne peut pas accéder au fichier car ce fichier est utilisé par un autre processus(2): 'G:\\www\\metadata.db' -> 'G:\\xxx\\metadata_pre_restore.db'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "calibre\db\restore.py", line 160, in run
File "calibre\db\restore.py", line 334, in replace_db
PermissionError: [WinError 32] Le processus ne peut pas accéder au fichier car ce fichier est utilisé par un autre processus (2): 'G:\\xxx\\metadata.db'
(1) Unluckily, the backup (on another external disk) is corrupted too because I've made it from the first one which is already corrupted.
(2) translation
"The process is unable to access to the file which already is used by another process"

I've checked : no process was running except Calibre


Thank you in advance for your assistance.
Regards

Last edited by diane55; 05-28-2024 at 09:29 AM.
diane55 is offline   Reply With Quote
Old 05-28-2024, 09:29 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,370
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
It's most likely your AV getting in the way. I suggest you turn it off or set it to ignore your calibre library directory and all sub-directories.
JSWolf is offline   Reply With Quote
Old 05-28-2024, 09:42 AM   #3
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: 44,526
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Reboot in safe mode and do the restore or alternately use the command line calibredb tool to do the restore.
kovidgoyal is offline   Reply With Quote
Old 05-28-2024, 08:42 PM   #4
diane55
Member
diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.
 
Posts: 22
Karma: 4897
Join Date: Dec 2012
Device: Kobo Glo
Thank you for your suggestions.

Quote:
Originally Posted by JSWolf View Post
It's most likely your AV getting in the way. I suggest you turn it off or set it to ignore your calibre library directory and all sub-directories.
My AV was turned off when the restoring process was done.


Quote:
Originally Posted by kovidgoyal View Post
Reboot in safe mode and do the restore or alternately use the command line calibredb tool to do the restore.
Restoring in safe mode in uncessful with the same error message : no access to the file which already is used by another process...

Could you please indicate which command I have to write ? I never did it.
Thank you.
diane55 is offline   Reply With Quote
Old 05-28-2024, 10:57 PM   #5
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: 44,526
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibredb restore_database -r
kovidgoyal is offline   Reply With Quote
Old 05-29-2024, 12:44 AM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
What is the G: drive? Is it a network share? Is it connected to some cloud service such as onedrive or dropbox? If so then that is your problem. Copy the library onto a local disk and restore it there.
chaley is offline   Reply With Quote
Old 05-29-2024, 07:56 PM   #7
diane55
Member
diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.
 
Posts: 22
Karma: 4897
Join Date: Dec 2012
Device: Kobo Glo
Quote:
Originally Posted by chaley View Post
What is the G: drive? Is it a network share? Is it connected to some cloud service such as onedrive or dropbox? If so then that is your problem. Copy the library onto a local disk and restore it there.
G: is a local external disk


I have 2 libraries :
- a big one with ebooks (format : epubs) on internal disk D:
- a smaller one with audiobooks (format : zip or MP3) on local external disk G. It is this one which is corrupted.

I've processed the restoration of the audiobooks library. Using cmd, I entered the following command :
Code:
calibredb restore_database -r [g:\XXX\]
I've added [g:\XXX\] because I was unable to access to the library folder on G: with the command "cd g:"
Everytime, I got "g:" but immediately I came back to : "c:\users\***" !



The process was launched and runned for hours and...the final result is deceiving : the audiobooks' database in G : remains corrupted ! :-(


In addition, it appears that the restoration has been done not only for audiobooks, but for both libraries - ebooks and audiobooks.
The final message at the end of the process was :
Quote:
Restoring database succeeded, old database file saved as: metadata_pre_restore.db, this is saved in ....
I found 2 "metadata_pre_restore.db" files
- the first one in the ebooks library on D:
- the second one in the audiobooks library on G:

Maybe the command I used is not appropriate...

Last edited by diane55; 05-29-2024 at 08:39 PM.
diane55 is offline   Reply With Quote
Old 05-29-2024, 11:19 PM   #8
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: 44,526
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Then your library is not actually corrupted, but something on your computer is interfering with calibre.
kovidgoyal is offline   Reply With Quote
Old 05-30-2024, 05:32 AM   #9
diane55
Member
diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.
 
Posts: 22
Karma: 4897
Join Date: Dec 2012
Device: Kobo Glo
Thank you for your answer.
I think that the database is corrupted because of this message when I try uncessfully to open the library



I can't figure out what can interfere with calibre because I get this message even in safe mode at minimum configuration, without internet...
I continue to dig in the problem.

Thank you all for your assistance.
diane55 is offline   Reply With Quote
Old 05-30-2024, 05:53 AM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,370
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by diane55 View Post
Thank you for your answer.
I think that the database is corrupted because of this message when I try uncessfully to open the library



I can't figure out what can interfere with calibre because I get this message even in safe mode at minimum configuration, without internet...
I continue to dig in the problem.

Thank you all for your assistance.
You try ShowWhatProcessLocksFile and see what's locking the database. Download the latest 6.0 version and give it a go.

https://github.com/PolarGoose/ShowWhatProcessLocksFile
JSWolf is offline   Reply With Quote
Old 05-30-2024, 05:54 AM   #11
diane55
Member
diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.
 
Posts: 22
Karma: 4897
Join Date: Dec 2012
Device: Kobo Glo
I've created a new audios library and tried to import the audiobooks which are in the old libray. I have to do it one by one (the format is ZIP, RAR or MP3).

The cover works but not the opf. I have to recreate all the metadatas and it is a lot of work.
Too bad. I'll keep the library as it is, anyway the audiobooks are still there, sorted by author and series.



EDIT
Quote:
Originally Posted by JSWolf View Post
You try ShowWhatProcessLocksFile and see what's locking the database. Download the latest 6.0 version and give it a go.

https://github.com/PolarGoose/ShowWhatProcessLocksFile
I'll try this.
Thank you for the suggestion.

Last edited by diane55; 05-30-2024 at 07:34 AM.
diane55 is offline   Reply With Quote
Old 05-30-2024, 10:28 AM   #12
diane55
Member
diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.
 
Posts: 22
Karma: 4897
Join Date: Dec 2012
Device: Kobo Glo
Quote:
Download ShowWhatProcessLocksFile.msi.zip from the latest release.
Run the installer. The installer will install this program to the %AppData%\ShowWhatProcessLocksFile folder and add a Show what locks this file Windows File Explorer context menu element.
I'm trying to install ShowWhatProcessLocksFile but do not know how to do it :-(
In the ZIP file, there is no installer.exe.
The subfolder Installer of the folder SRC contains :
- HeatWaveConvert.log (text document)
- Installer.wixproj (file)
- Product.wxs (file)

I do not know what to do with these files
diane55 is offline   Reply With Quote
Old 05-30-2024, 10:59 AM   #13
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 12,342
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
You downloaded the wrong thing
Latest (under Releases)
https://github.com/PolarGoose/ShowWh...eases/tag/v6.0
has ShowWhatProcessLocksFile.msi.zip

Unzipping gives a windows .msi which should install.


Edit: The "Latest" / Releases are invisible on some browsers or on some script blocking settings.

Last edited by Quoth; 05-30-2024 at 11:02 AM.
Quoth is offline   Reply With Quote
Old 05-30-2024, 06:51 PM   #14
diane55
Member
diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.diane55 is fluent in JavaScript as well as Klingon.
 
Posts: 22
Karma: 4897
Join Date: Dec 2012
Device: Kobo Glo
Finally, I've installed PowerToys and activated File Locksmith.

It shows that Calibre is the only process working on the database.



I give up.

Thank you all for your patience and assistance.
diane55 is offline   Reply With Quote
Old 05-30-2024, 07:13 PM   #15
jmurphy
Zealot
jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.jmurphy ought to be getting tired of karma fortunes by now.
 
Posts: 106
Karma: 1133068
Join Date: Sep 2007
Device: ipaq
Quote:
Originally Posted by diane55 View Post

I've added [g:\XXX\] because I was unable to access to the library folder on G: with the command "cd g:"
Everytime, I got "g:" but immediately I came back to : "c:\users\***" !


You need to change drives first:
Code:
g:
cd xxx
or

Code:
CD /D G:\xxx
jmurphy is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I restore the database to backup? - database disk image is malformed lumping-sugar66 Kobo Reader 7 09-10-2024 12:57 PM
restore database franklekens Kobo Reader 32 06-02-2024 07:28 PM
Aura Restore the database Ksquared Kobo Reader 2 09-17-2016 09:04 AM
Restore Database? BookJunkieLI Library Management 6 08-15-2014 07:10 PM
restore database help mabee Calibre 13 01-11-2011 03:16 PM


All times are GMT -4. The time now is 08:58 PM.


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