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 08-22-2022, 07:14 AM   #1
Adam KH
Member
Adam KH began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2020
Device: none
Corrupt Metadata Library

I have a problem with the metadatabase on one of my libraries. I use multiple libraries and “switch” those libraries when I need to process the books in each library.

This has not caused a problem until recently when the response time on metadata opening and update slowed to a crawl with one library.

I have converted all the libraries bar one back to to Portable Calbre which has been fine.

The problem library contains 45,000 books. I run a library check but it returns no errors. I recently imported 5,000 books from into a new library and that resulted in approximately 200 books with out any metadata (I used the import of folders and subfolders which should contain the book, cover and OPF file.

Is there are way of resolving this as importing into Calibre portable will probably take 2 or 3 days with questionable results.

All my books are contained on a USB drive and backed up to a NAS.

Thanks
Adam KH is offline   Reply With Quote
Old 08-22-2022, 10:14 AM   #2
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: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Please say the Calibre has never connected to the NAS copy.
That can cause corruption. Not MIGHT, but WHEN.

As to moving (working) Libraries from one drive to another. That is correct (x)COPY using the OS. Xcopy is run from a command prompt and tends to run faster)

Rules:
1) the destination Library folder is empty (or only has the 2 original files that get overwritten)
2) Calibre (server too) is shut down
theducks is offline   Reply With Quote
Advert
Old 08-22-2022, 05:24 PM   #3
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,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Have you run any checks on the external usb drive - could be a flaky drive, cable or interface.

BR
BetterRed is online now   Reply With Quote
Old 08-22-2022, 09:01 PM   #4
Adam KH
Member
Adam KH began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2020
Device: none
Quote:
Originally Posted by theducks View Post
Please say the Calibre has never connected to the NAS copy.
That can cause corruption. Not MIGHT, but WHEN.

As to moving (working) Libraries from one drive to another. That is correct (x)COPY using the OS. Xcopy is run from a command prompt and tends to run faster)

Rules:
1) the destination Library folder is empty (or only has the 2 original files that get overwritten)
2) Calibre (server too) is shut down
No Calibre is not connected to the NAS Copy i9t is ony connected to the Library held on a USB Drive.

I use Goodsynch to copy the Library from the USB drive to the NAS. I only do this when Calibre is closed.
Adam KH is offline   Reply With Quote
Old 08-22-2022, 09:13 PM   #5
Adam KH
Member
Adam KH began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2020
Device: none
Restored from NAS

Yesterday I:

Converted all the other Libraries to Calibre portable. I had previously been using Calibre Portable for all Libraries.

I restored the NAS backup of the Large Library (using Goodsynch) to the USB Drive and ran that Library from Calibre on the PC.

I did a Check Library from Calibre and now errors were found (which was the same result I had from a Library Check on 18 August).

I did however note that 1 book added on 18 August did not have the correct Metadata but on 18 August I had deleted that book via Calibre).

My concern now is:

1. Are there orphan books in the Library Folder that are not in the metadata library?

2. How can I identify those orphan books?

The Check Library did not identify any orphan books.

The Library performance is still very slow.

Last edited by Adam KH; 08-22-2022 at 09:16 PM. Reason: New comment
Adam KH is offline   Reply With Quote
Advert
Old 08-22-2022, 10:03 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,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Adam KH View Post
Yesterday I:

Converted all the other Libraries to Calibre portable. I had previously been using Calibre Portable for all Libraries.
What does this 'convert' mean?

The version 6.3 calibre.exe files in my c:\program files\calibre 2 and in d:\calibre\portables\version6\calibre are identical, as is everything else. The essential difference is that portable expects the configuration data and libraries to be within the install folder. The calibre-portable.exe program is a wrapper that reflects that setup to calibre.exe.

I often access the same libraries from installed and portable calibre by dropping symlinks to the library folders into the portable install folder.

Quote:
Originally Posted by Adam KH View Post
I restored the NAS backup of the Large Library (using Goodsynch) to the USB Drive and ran that Library from Calibre on the PC.

I did a Check Library from Calibre and now errors were found (which was the same result I had from a Library Check on 18 August).

I did however note that 1 book added on 18 August did not have the correct Metadata but on 18 August I had deleted that book via Calibre).

My concern now is:

1. Are there orphan books in the Library Folder that are not in the metadata library?

2. How can I identify those orphan books?

The Check Library did not identify any orphan books.

The Library performance is still very slow.
FTR - I also use Goodsynch.

What does that last sentence mean - slow at what? Scrolling the list of books, viewing a book, updating metadata?

Do you have another drive to which you can copy the Large Library?

If you copy the Large Library\metadata.db file to an empty folder on your system drive you could have calibre access that folder as a library - that might give you a clue as whether the problem is database or device related.

Oh, and how is the USB drive formatted?

BR
BetterRed is online now   Reply With Quote
Old 08-23-2022, 12:42 AM   #7
Adam KH
Member
Adam KH began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2020
Device: none
Quote:
Originally Posted by BetterRed View Post
Have you run any checks on the external usb drive - could be a flaky drive, cable or interface.

BR
Yes, I use Hard Disk Sentinel 5.61 Pro to monitor all my drives.
I ran a short self test with no errors found. I did not run an extended self test because it is a 4TB drive and that would take 10 hours. A seek time test showed an average of 18ms. The SMART indicators show no warnings.
Adam KH is offline   Reply With Quote
Old 08-23-2022, 01:28 AM   #8
Adam KH
Member
Adam KH began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2020
Device: none
Quote:
Originally Posted by BetterRed View Post
What does this 'convert' mean?

.....

FTR - I also use Goodsynch.

What does that last sentence mean - slow at what? Scrolling the list of books, viewing a book, updating metadata?

Do you have another drive to which you can copy the Large Library?

If you copy the Large Library\metadata.db file to an empty folder on your system drive you could have calibre access that folder as a library - that might give you a clue as whether the problem is database or device related.

Oh, and how is the USB drive formatted?

BR
The external drive is a Samsung 4TB drive formatted to NTFS. The library in question is 674GB. I only have 432GB available on my secondary 1TB internal drive.

The USB Drive is set for "Quick Removal" which disables write caching on the disk.

It is slow in scrolling and opening the Metadata and especially slow at saving the metadata.

I do have an alternate USB drive. I normally backup to a secondary USB drive every two months. Back up to my QNAP NAS occurs every time I add new books or update a book's metadata. Once per week I back up to a Synology NAS. I have OCD on losing data!

All backups are done using Goodsynch.

Tonight I will first change the USB cable and if that makes no difference I will try the Secondary USB back up. I will also carry out tests on the USB port. I will then try a different USB port.

The secondary backup was last carried out two months ago which is well before I encountered performance issues. If there is a change in performance it would then point to a failing USB drive.

Last edited by Adam KH; 08-23-2022 at 01:29 AM. Reason: deleted final sentence which was incomplete
Adam KH is offline   Reply With Quote
Old 08-23-2022, 02:15 AM   #9
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,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Adam KH View Post
/
It is slow in scrolling and opening the Metadata and especially slow at saving the metadata.
That suggests it's a database related issue. When calibre is running the library metadata is memory resident, writes of the book folder metadata.opf (backup) files are done in a separate low priority thread (lazy writes) - if you do a bulk change that affects a 1,000 books those writes won't impact performance.

Do you have any custom columns that use file system template functions, such as formats_modtimes, formats_paths etc.

Did you try copying the Large Library database to an empty folder on another drive and then access that library via calibre - yes, it will work without the author and title folders.

BR
BetterRed is online now   Reply With Quote
Old 08-23-2022, 05:11 AM   #10
Adam KH
Member
Adam KH began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2020
Device: none
Quote:
Originally Posted by BetterRed View Post
That suggests it's a database related issue. ....

BR
I copied 5,000 books to another folder (Authors A-C) and imported into a new database using "Add from Folders and Sub-folders". That resulted in at least 80 (if not more) without updated metadata. They came in with the date of import.

I select one, switched back to the original Library, searched for it and it correctly showed the metadata for the book. On opening the containing folder for the book there was no OPF file just the cover and the epub book.

I checked a second book and again no OPF file.

I need to find a resolution for this or find books which do not have an OPF file in their folder.
Adam KH is offline   Reply With Quote
Old 08-23-2022, 06:04 AM   #11
Adam KH
Member
Adam KH began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2020
Device: none
I checked the number of OPF files in the library and this was 41,157 but the metadata say that there are 41,265 books. So I am missing 108 OPF files.

Last edited by Adam KH; 08-23-2022 at 06:04 AM. Reason: missed out word
Adam KH is offline   Reply With Quote
Old 08-23-2022, 06:10 AM   #12
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,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
backup_metadata

The primary purpose of the metadata.opf files in the book title folders is to enable a corrupted database to be restored. They can also be used when books are added from a folder that was/is a calibre library folder.

Missing OPF file in the Book folders will not effect performance.

BR
BetterRed is online now   Reply With Quote
Old 08-23-2022, 06:41 AM   #13
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,611
Karma: 7891011
Join Date: Sep 2020
Device: none
Is FTS indexing enabled?
Comfy.n is offline   Reply With Quote
Old 08-23-2022, 06:50 AM   #14
Adam KH
Member
Adam KH began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2020
Device: none
Quote:
Originally Posted by Comfy.n View Post
Is FTS indexing enabled?
Dont understand
Adam KH is offline   Reply With Quote
Old 08-23-2022, 06:56 AM   #15
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,611
Karma: 7891011
Join Date: Sep 2020
Device: none
see attached screenshot:

FTS (Full text search) indexing, even in slow speed, can cause a general slow response, depending on the system. IIRC, FTS indexing is on by default in Calibre recent versions. (edit: it isn't)

So you could try this: disable FTS indexing. (it's the FT icon on the left side of the gear icon in the search bar)
Attached Thumbnails
Click image for larger version

Name:	MWSnap0620 2022-08-23, 07_55_20.png
Views:	98
Size:	193.8 KB
ID:	196041  

Last edited by Comfy.n; 08-30-2022 at 02:11 AM.
Comfy.n is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What causes metadata.db to go corrupt? Geremia Library Management 2 11-29-2014 03:00 PM
corrupt metadata.db files Naloomi Library Management 19 02-23-2014 07:32 PM
Re-importing Library after corrupt metadata.db samhain Library Management 3 03-07-2011 01:57 PM
My Metadata file seems corrupt gandor62 Calibre 3 03-27-2010 08:40 PM
corrupt metadata.db and redoing library Dopedangel Calibre 6 01-01-2010 04:49 PM


All times are GMT -4. The time now is 07:03 AM.


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