Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-24-2019, 02:08 PM   #1
helibird
Member
helibird began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Feb 2019
Location: UK
Device: dell netbook
Unhappy Corrupt database and no metadata_pre_restore.db'

Help, I've screwed things up!
I opened Calibre, All books appeared OK with their metadata but when I tried to update one I got the following
calibre, version 3.30.0
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 1091, in setData
File "site-packages\calibre\gui2\library\models.py", line 1117, in _set_data
File "site-packages\calibre\gui2\library\models.py", line 1080, in set_custom_column_data
File "site-packages\calibre\db\legacy.py", line 659, in set_custom
File "site-packages\calibre\db\cache.py", line 1092, in set_field
File "site-packages\calibre\db\write.py", line 544, in set_books
File "site-packages\calibre\db\write.py", line 228, in one_one_in_other
File "site-packages\calibre\db\backend.py", line 855, in executemany
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 tried several times to restore the database and finally spotted I had another Calibre Library with one author.
I told it to forget this library but the database is still coming up corrupt.
The restore is coming up with
ERROR: Failed: Restoring database failed, click Show details to see details

Traceback (most recent call last):
File "site-packages\calibre\db\restore.py", line 127, in run
File "site-packages\calibre\db\restore.py", line 279, in replace_db
File "shutil.py", line 83, in copyfile
IOError: [Errno 2] No such file or directory: u'C:\\Users\\helen\\Documents\\MyBooks\\Calibre Library\\metadata_pre_restore.db'
and it is right there is no such file in either of the Calibre libraries
The restore creates a tiny db file and when I click to open Calibre it flashed up something and then closes. If I put the old db back I get back to the original postion - can see all my books but can't save anything!

I assume I will have to create a new blank library somewhere else and re import all my books (only about 3500 so not too bad).
Will I lose my user meta data (telling be which ones I've read and their rating).
Can someone poit me at where I can find instructions for the best way to get Calibre back up with minimal loss.
helibird is offline   Reply With Quote
Old 02-24-2019, 03:12 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 45,229
Karma: 168808723
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by helibird View Post
Help, I've screwed things up!
I opened Calibre, All books appeared OK with their metadata but when I tried to update one I got the following
c
Spoiler:
alibre, version 3.30.0
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 1091, in setData
File "site-packages\calibre\gui2\library\models.py", line 1117, in _set_data
File "site-packages\calibre\gui2\library\models.py", line 1080, in set_custom_column_data
File "site-packages\calibre\db\legacy.py", line 659, in set_custom
File "site-packages\calibre\db\cache.py", line 1092, in set_field
File "site-packages\calibre\db\write.py", line 544, in set_books
File "site-packages\calibre\db\write.py", line 228, in one_one_in_other
File "site-packages\calibre\db\backend.py", line 855, in executemany
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 tried several times to restore the database and finally spotted I had another Calibre Library with one author.
I told it to forget this library but the database is still coming up corrupt.
The restore is coming up with
Spoiler:
ERROR: Failed: Restoring database failed, click Show details to see details
Traceback (most recent call last):
File "site-packages\calibre\db\restore.py", line 127, in run
File "site-packages\calibre\db\restore.py", line 279, in replace_db
File "shutil.py", line 83, in copyfile
IOError: [Errno 2] No such file or directory: u'C:\\Users\\helen\\Documents\\MyBooks\\Calibre Library\\metadata_pre_restore.db'

and it is right there is no such file in either of the Calibre libraries
The restore creates a tiny db file and when I click to open Calibre it flashed up something and then closes. If I put the old db back I get back to the original postion - can see all my books but can't save anything!

I assume I will have to create a new blank library somewhere else and re import all my books (only about 3500 so not too bad).
Will I lose my user meta data (telling be which ones I've read and their rating).
Can someone poit me at where I can find instructions for the best way to get Calibre back up with minimal loss.
Before getting too involved with destroying and recreating your library, I would suggest checking your AV program. Several people have had issues with libraries in the Documents folder under Windows where their AV has attempted to protect those files.

You can also restart your computer in safe mode and then open calibre. This will keep other programs that may cause issues with calibre from running.

One you get the issue worked out, I would suggest copying your existing libraries out of the Documents folder (I placed mine in the root of my User directory after running into an issue with folder protection).
DNSB is offline   Reply With Quote
Advert
Old 02-24-2019, 03:27 PM   #3
helibird
Member
helibird began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Feb 2019
Location: UK
Device: dell netbook
I will try your suggestions

Thanks for relying. I only use Windows defender and it has been working for several years with Calibre. Also can't see how it would account for the missing file. However it is possible recent updates have changed something. I am running another scan now before I disable it. If that doesn't work I'll try clean boot.
Out of interest do you know if the metadata_pre_restore.db file is something that is there all the time or is it created during the restore process?
helibird is offline   Reply With Quote
Old 02-24-2019, 03:57 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,933
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Before you risk messing up your 100% recovery options, please WAIT for the jury to come up with ideas.

The original database was metadata.db

Where was it (full path)to this file?
Was this path also part of One Drive or some other cloud?
theducks is offline   Reply With Quote
Old 02-24-2019, 04:06 PM   #5
helibird
Member
helibird began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Feb 2019
Location: UK
Device: dell netbook
Thank you, Thank You David, You ARE a Genius. It was Windows Defender
Allowed app and is now OK.

Happy Helibird
helibird is offline   Reply With Quote
Advert
Old 02-24-2019, 04:14 PM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,657
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
It maybe Onedrive. A recent edition of Windows 10 (possibly 1803 or 1809) defaults to having OneDrive synchronise the Document, Desktop, and Pictures folders to the cloud. Synchronising a calibre library to the cloud is a no-no, see ==>> I am getting errors with my calibre library on a networked drive/NAS?

So you have two choices - keep the library in a location that Onedrive doesn't synch, or pause Onedrive when you're doing anything with calibre - including the command line tools, and the server etc.

As of version 3.30

Quote:
The default calibre library location is now not in My Documents but instead in the user home folder, to avoid issues with OneDrive auto-syncing calibre libraries.
But that only applies to new installations of course.

BR

Last edited by BetterRed; 02-24-2019 at 04:20 PM. Reason: remove Music and insert Desktop
BetterRed is offline   Reply With Quote
Old 02-24-2019, 04:26 PM   #7
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Glad you’ve solved the problem, but for goodness sake make backups of your library!
HarryT is offline   Reply With Quote
Old 02-25-2019, 09:36 AM   #8
helibird
Member
helibird began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Feb 2019
Location: UK
Device: dell netbook
Thanks everyone for your suggestions. Interesting info about icloud. I currently have it disabled but useful to know.
helibird is offline   Reply With Quote
Reply

Tags
corrupt, no pre_restore.db


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calibre corrupt error corrupt error database disk image is malformed didu812 Calibre 50 04-10-2024 08:51 AM
Aura HD Corrupt database? patrik Kobo Reader 34 01-13-2014 02:10 AM
a novel way to corrupt your database? paola Kobo Reader 20 07-27-2013 03:18 PM
Corrupt database tonyjbird Introduce Yourself 5 04-03-2012 06:26 AM
Corrupt database jjansen Calibre 4 10-26-2011 11:51 PM


All times are GMT -4. The time now is 11:22 AM.


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