Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 02-04-2026, 02:47 PM   #31
shayaknyc
Connoisseur
shayaknyc began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
That's a different error. You need to open the libraryin the calibre program so that calibre knows about it. Once you do so you wont have that error any more.
Ok, so I loaded Calibre GUI in the VM and pointed it to the Calibre-Subset library (see attached screenshot)

However, after it loads the library correctly, I run the same export command and this is what I got:
Code:
$ calibre-debug --export-all-calibre-data /home/shayaknyc/Calibre-Backup-20260202 /home/shayaknyc/Calibre-Subset
Traceback (most recent call last):
  File "runpy.py", line 198, in _run_module_as_main
  File "runpy.py", line 88, in _run_code
  File "site.py", line 47, in <module>
  File "site.py", line 43, in main
  File "calibre/debug.py", line 308, in main
  File "calibre/utils/exim.py", line 552, in run_exporter
KeyError: '/home/shaya/Calibre-Subset'
$
Attached Thumbnails
Click image for larger version

Name:	Calibre-Ubuntu-VM-Screenshot.png
Views:	129
Size:	161.0 KB
ID:	220733  
shayaknyc is offline   Reply With Quote
Old 02-05-2026, 12:16 AM   #32
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: 46,450
Karma: 29634066
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont see how that's possible unless your GUI and CLI commands are accessing different config directories. In any case I have already removed the constraint that export has to work with known libraries for the next release.
kovidgoyal is online now   Reply With Quote
Old 02-05-2026, 12:50 PM   #33
shayaknyc
Connoisseur
shayaknyc began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
I dont see how that's possible unless your GUI and CLI commands are accessing different config directories. In any case I have already removed the constraint that export has to work with known libraries for the next release.
I mean, this doesn't make any sense. Fresh Ubuntu VM, fresh calibre install, same library I shared with you, which you did not seem to have a problem with. So, I'm not at all sure what's causing this behavior....
shayaknyc is offline   Reply With Quote
Old 02-07-2026, 12:15 PM   #34
shayaknyc
Connoisseur
shayaknyc began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
Just updated to v9.2.1 and same deal. Just hangs at metadata.db.

At this point, I give up. A little disappointing since I scripted the backup and had it activate on a cron.

For clarity, so I can make sure I can continue to backup properly, so long as I continue to back up the ~/.config/calibre directory along with the library directory, I could "restore" manually?
shayaknyc is offline   Reply With Quote
Old 02-07-2026, 02:07 PM   #35
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: 84,614
Karma: 153744815
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 shayaknyc View Post
Just updated to v9.2.1 and same deal. Just hangs at metadata.db.

At this point, I give up. A little disappointing since I scripted the backup and had it activate on a cron.

For clarity, so I can make sure I can continue to backup properly, so long as I continue to back up the ~/.config/calibre directory along with the library directory, I could "restore" manually?
Turn off the cron job. You don't need it Use the Backup plugin for calibre to backup your configuration directory when you exit calibre.
JSWolf is online now   Reply With Quote
Old 02-07-2026, 02:49 PM   #36
shayaknyc
Connoisseur
shayaknyc began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
Quote:
Originally Posted by JSWolf View Post
Turn off the cron job. You don't need it Use the Backup plugin for calibre to backup your configuration directory when you exit calibre.
Where can I find this Backup Plugin?
shayaknyc is offline   Reply With Quote
Old 02-07-2026, 02:59 PM   #37
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: 84,614
Karma: 153744815
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 shayaknyc View Post
Where can I find this Backup Plugin?
In Preferences > Plugins > Get new plugins, in the search box, search for backup and the plugin is called Backup configuration folder(s).
JSWolf is online now   Reply With Quote
Old 02-07-2026, 03:02 PM   #38
shayaknyc
Connoisseur
shayaknyc began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
Quote:
Originally Posted by JSWolf View Post
In Preferences > Plugins > Get new plugins, in the search box, search for backup and the plugin is called Backup configuration folder(s).
Ah, I see it. This is only a partial backup solution however. The command I was using backed up the config AND library in a multi-file archive which was super easy to restore via GUI.

Backing up the two folders I specified on a schedule, essentially does the same thing but with a manual restoration process.
shayaknyc is offline   Reply With Quote
Old 02-08-2026, 09:15 AM   #39
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: 84,614
Karma: 153744815
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 shayaknyc View Post
Ah, I see it. This is only a partial backup solution however. The command I was using backed up the config AND library in a multi-file archive which was super easy to restore via GUI.

Backing up the two folders I specified on a schedule, essentially does the same thing but with a manual restoration process.
The plugin is only for backing up the configuration. However, your way has one flaw. when you have a cron job scheduled, you cannot be using calibre at that time.
JSWolf is online now   Reply With Quote
Old 02-09-2026, 11:49 AM   #40
shayaknyc
Connoisseur
shayaknyc began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
Quote:
Originally Posted by JSWolf View Post
The plugin is only for backing up the configuration. However, your way has one flaw. when you have a cron job scheduled, you cannot be using calibre at that time.
The script checks for any file-locks or if calibre is running and stops and sends a notification to let me know it was unable to complete.

I appreciate your help!
shayaknyc is offline   Reply With Quote
Old 08-09-2026, 06:00 PM   #41
shayaknyc
Connoisseur
shayaknyc began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
I think I have some clarity on this issue, as it still persists. I decided to try running my backup script inside a docker container running calibre from lscr.io/linuxserver/calibre:latest. The calibre-debug executable hangs at exactly the same place - the metadata.db file. Mine is 15.5mb large, and does have a number of custom columns/fields - would this perhaps be the culprit for why it just hangs at that stage? I can confirm that the Calibre GUI is not running when I execute the backup command inside the container.

Any insights would be very helpful! Thank you!

Edit: confirming that the Calibre Library directory is on an ext4 partition. It consistently fails at the metadata.db file. Wonder if there's a way to run a repair?

Last edited by shayaknyc; 08-09-2026 at 06:28 PM. Reason: additional details
shayaknyc is offline   Reply With Quote
Old 08-09-2026, 11:57 PM   #42
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: 46,450
Karma: 29634066
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No size is irrelevant. As for repairing, you can always dump it to sqlite and rebuild from that, or use calibredb restore_database to rebuild it completely from OPF files, but read the help of that command to see its limitations.
kovidgoyal is online now   Reply With Quote
Old 08-10-2026, 04:34 PM   #43
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: 84,614
Karma: 153744815
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 shayaknyc View Post
I think I have some clarity on this issue, as it still persists. I decided to try running my backup script inside a docker container running calibre from lscr.io/linuxserver/calibre:latest. The calibre-debug executable hangs at exactly the same place - the metadata.db file. Mine is 15.5mb large, and does have a number of custom columns/fields - would this perhaps be the culprit for why it just hangs at that stage? I can confirm that the Calibre GUI is not running when I execute the backup command inside the container.

Any insights would be very helpful! Thank you!

Edit: confirming that the Calibre Library directory is on an ext4 partition. It consistently fails at the metadata.db file. Wonder if there's a way to run a repair?
Since I'm not going to read back in this thread, are you running calibre from the official calibre site or are you running calibre from a repository?
JSWolf is online now   Reply With Quote
Old 08-20-2026, 12:16 PM   #44
shayaknyc
Connoisseur
shayaknyc began at the beginning.
 
Posts: 65
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
Quote:
Originally Posted by JSWolf View Post
Since I'm not going to read back in this thread, are you running calibre from the official calibre site or are you running calibre from a repository?
Originally, I was just running this locally. I had a backup script I would run every 12 weeks or so, that would automatically create a date-named folder, perform the export, and run a hash against all the files. One day, this just stopped working. This thread was my attempt at trying to figure out what could be causing this issue.

I've tried sandboxing the environment, running a debug instance, all of them failed at the same place during the export. I decided, let me try a "clean" environment and run calibre command-line entirely within the container, and just map the external volume into the container. It failed at the same spot - backing up the metadata.db file.

Quote:
Originally Posted by kovidgoyal View Post
No size is irrelevant. As for repairing, you can always dump it to sqlite and rebuild from that, or use calibredb restore_database to rebuild it completely from OPF files, but read the help of that command to see its limitations.
Before I run this command, I'll backup the metadata.db file. I also clicked on Calibre Library>Library Maintenance>Check Library and the results came back that everything is good. So, I'm not sure that doing a restore_database will solve this issue.
shayaknyc is offline   Reply With Quote
Reply

Tags
backup, export


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Export/import all calibre data deleted_account23 Library Management 1 07-16-2024 12:38 PM
Calibre 5.7.2 Hangs When Restarted In Debug Mode baslow Calibre 9 12-17-2020 05:07 PM
Cannot modify selected data within Export Calibre data Pholipe Library Management 1 09-05-2019 11:34 AM
Export Calibre Data GeckoFriend Library Management 4 03-27-2018 03:15 PM
Calibre Hangs when downloading Metadata Rudyman Library Management 9 08-19-2011 11:17 AM


All times are GMT -4. The time now is 07:26 PM.


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