|
|
#1 |
|
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
|
Hey folks and Kovid,
Firstly, I want to just say, this is an immaculate piece of software, and I have been using this for literal years. It's by far one of my most prized digital assets. Every few months, I backup and archive my entire calibre library, using the following command: Code:
calibre-debug --export-all-calibre-data [/path/to/empty/dir] all The last time I ran this command and it worked well was on 4 Oct 2025. I decided to run the export/backup again today, and everything appeared to be working alright, however, after the standard plugin errors, which are inconsequential, it hit the metadata.db file which is usually backs-up first, and begins the file countdown, but now it just hangs at the metadata.db. It's now been running for about 2 hours, usually by now it completes, but it's still stuck at the metadata.db file. Here's the output of my error when I run the command: Code:
$ calibre-debug --export-all-calibre-data /home/shayaknyc/ayp/Calibre-Backup-20260126/ all
Exporting libraries: /home/shayaknyc/win-d/Users/shaya/Documents/Calibre Library to: /home/shayaknyc/ayp/Calibre-Backup-20260126/
Failed to initialize plugin: '/home/shaya/.config/calibre/plugins/ANOBII.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 202, in exec_module
File "calibre/customize/zipplugin.py", line 198, in get_code
File "calibre_plugins.ANOBII.__init__", line 39
cached_cover_url_is_reliable = True
^
TabError: inconsistent use of tabs and spaces in indentation
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/Barnes & Noble.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 209, in exec_module
File "calibre_plugins.barnes_noble.__init__", line 11, in <module>
from urllib import quote
ImportError: cannot import name 'quote' from 'urllib' (/opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/urllib/__init__.pyc)
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/DOC Input.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 329, in load
calibre.customize.InvalidPlugin: The plugin at /home/shayaknyc/.config/calibre/plugins/DOC Input.zip cannot be used on linux
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/KoboBooks.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 209, in exec_module
File "calibre_plugins.kobobooks.__init__", line 10, in <module>
import time, re, HTMLParser
ModuleNotFoundError: No module named 'HTMLParser'
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/Read MP3 AudioBook metadata.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 209, in exec_module
File "calibre_plugins.audiobookmetadatareader.__init__", line 8, in <module>
from common import DEBUG
ModuleNotFoundError: No module named 'common'
/home/shayaknyc/win-d/Users/shaya/Documents/Calibre Library 0 2
metadata.db 0 2824
Other than this, the software works great and I have no problems with this at all. This is the first time I've come across an issue like this, and I would greatly appreciate any insight or advice to resolve this so I may continue backing up my precious library. Thank you in advance! |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,918
Karma: 29228280
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Press ctrl+C that should interrupt it and get you a stack trace.
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
|
Here's the full output with the stacktrace:
Code:
$ calibre-debug --export-all-calibre-data /home/shayaknyc/ayp/Calibre-Backup-20260126/ all
Exporting libraries: /home/shayaknyc/win-d/Users/shaya/Documents/Calibre Library to: /home/shayaknyc/ayp/Calibre-Backup-20260126/
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/ANOBII.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 202, in exec_module
File "calibre/customize/zipplugin.py", line 198, in get_code
File "calibre_plugins.ANOBII.__init__", line 39
cached_cover_url_is_reliable = True
^
TabError: inconsistent use of tabs and spaces in indentation
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/Barnes & Noble.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 209, in exec_module
File "calibre_plugins.barnes_noble.__init__", line 11, in <module>
from urllib import quote
ImportError: cannot import name 'quote' from 'urllib' (/opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/urllib/__init__.pyc)
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/DOC Input.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 329, in load
calibre.customize.InvalidPlugin: The plugin at /home/shayaknyc/.config/calibre/plugins/DOC Input.zip cannot be used on linux
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/KoboBooks.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 209, in exec_module
File "calibre_plugins.kobobooks.__init__", line 10, in <module>
import time, re, HTMLParser
ModuleNotFoundError: No module named 'HTMLParser'
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/Read MP3 AudioBook metadata.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 209, in exec_module
File "calibre_plugins.audiobookmetadatareader.__init__", line 8, in <module>
from common import DEBUG
ModuleNotFoundError: No module named 'common'
/home/shayaknyc/win-d/Users/shaya/Documents/Calibre Library 0 2
metadata.db 0 2824
^CTraceback (most recent call last):
File "calibre/db/backend.py", line 2721, in _backup_database
apsw.BusyError: not an error
During handling of the above exception, another exception occurred:
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 554, in run_exporter
File "calibre/utils/exim.py", line 213, in export
File "calibre/db/cache.py", line 86, in call_func_with_lock
File "calibre/db/cache.py", line 3169, in export_library
File "calibre/db/backend.py", line 2726, in backup_database
File "calibre/db/backend.py", line 2720, in _backup_database
File "contextlib.py", line 446, in __exit__
KeyboardInterrupt
|
|
|
|
|
|
#4 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,918
Karma: 29228280
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That looks like something else has opened the calibre database and hence you are getting busy errors from sqlite.
|
|
|
|
|
|
#5 | |
|
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
|
Quote:
Code:
$ pwd /home/shayaknyc/win-d/Users/shaya/Documents/Calibre Library $ sudo lsof metadata.db [sudo] password for shayaknyc: $ |
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,918
Karma: 29228280
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
See if that helps: https://github.com/kovidgoyal/calibr...0f70adda71720a
|
|
|
|
|
|
#7 | |
|
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
|
Quote:
Edit: is the assumption for me to reinstall calibre? |
|
|
|
|
|
|
#8 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,918
Karma: 29228280
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Wait for the next release or run calibre from source as described in: https://manual.calibre-ebook.com/develop.html
|
|
|
|
|
|
#9 |
|
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
|
Ok, so I cloned the repo, and set the CALIBRE_DEVELOP_FROM variable to the full path for the src directory. Presumably, any subsequent usage of the calibre-debug command should utilize this source tree for the python scripts, yeah? If so, the command still appears to hang in exactly the same place:
Code:
$ echo $CALIBRE_DEVELOP_FROM
/home/shayaknyc/git/calibre/src
$ calibre-debug --export-all-calibre-data /home/shayaknyc/ayp/Calibre-Backup-20260127 all
Exporting libraries: /home/shayaknyc/win-d/Users/shaya/Documents/Calibre Library to: /home/shayaknyc/ayp/Calibre-Backup-20260127
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/ANOBII.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 202, in exec_module
File "calibre/customize/zipplugin.py", line 198, in get_code
File "calibre_plugins.ANOBII.__init__", line 39
cached_cover_url_is_reliable = True
^
TabError: inconsistent use of tabs and spaces in indentation
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/Barnes & Noble.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 209, in exec_module
File "calibre_plugins.barnes_noble.__init__", line 11, in <module>
from urllib import quote
ImportError: cannot import name 'quote' from 'urllib' (/opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/urllib/__init__.pyc)
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/DOC Input.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 329, in load
calibre.customize.InvalidPlugin: The plugin at /home/shaya/.config/calibre/plugins/DOC Input.zip cannot be used on linux
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/KoboBooks.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 209, in exec_module
File "calibre_plugins.kobobooks.__init__", line 10, in <module>
import time, re, HTMLParser
ModuleNotFoundError: No module named 'HTMLParser'
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/Read MP3 AudioBook metadata.zip'
Traceback (most recent call last):
File "calibre/customize/ui.py", line 833, in initialize_plugins
File "calibre/customize/ui.py", line 87, in load_plugin
File "calibre/customize/zipplugin.py", line 310, in load
File "importlib/__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "calibre/customize/zipplugin.py", line 209, in exec_module
File "calibre_plugins.audiobookmetadatareader.__init__", line 8, in <module>
from common import DEBUG
ModuleNotFoundError: No module named 'common'
/home/shayaknyc/win-d/Users/shaya/Documents/Calibre Library 0 2
metadata.db 0 2824
^CTraceback (most recent call last):
File "calibre/db/backend.py", line 2721, in _backup_database
apsw.BusyError: not an error
During handling of the above exception, another exception occurred:
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 554, in run_exporter
File "calibre/utils/exim.py", line 213, in export
File "calibre/db/cache.py", line 86, in call_func_with_lock
File "calibre/db/cache.py", line 3169, in export_library
File "calibre/db/backend.py", line 2726, in backup_database
File "calibre/db/backend.py", line 2720, in _backup_database
File "contextlib.py", line 446, in __exit__
KeyboardInterrupt
|
|
|
|
|
|
#10 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,918
Karma: 29228280
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Stick a print statement in there to check if you are indeed running from source.
|
|
|
|
|
|
#11 |
|
Enthusiast
![]() Posts: 48
Karma: 10
Join Date: Sep 2012
Device: Kobo Aura
|
I added the print statement to the __init__.py file and despite the environment variable, running the calibredb command, as per the documentation in the link, did not display the print message.
Edit: for clarity, I edited ../calibre/src/calibre/__init__.py and added print("Hello, world!") to line 16 of that file, after all the import statements, and before the first if condition. Then, I set the environment variable CALIBRE_DEVELOP_FROM to the full path /home/shayaknyc/git/calibre/src and executing echo $CALIBRE_DEVELOP_FROM displays the proper full path to the src directory. I then execute command calibredb and this is the output: Code:
calibredb
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/ANOBII.zip'
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/Barnes & Noble.zip'
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/DOC Input.zip'
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/KoboBooks.zip'
Failed to initialize plugin: '/home/shayaknyc/.config/calibre/plugins/Read MP3 AudioBook metadata.zip'
Usage: calibredb command [options] [arguments]
calibredb is the command line interface to the calibre books database.
command is one of:
list
add
remove
add_format
remove_format
show_metadata
set_metadata
export
catalog
saved_searches
add_custom_column
custom_columns
remove_custom_column
set_custom
restore_database
check_library
list_categories
backup_metadata
clone
embed_metadata
search
fts_index
fts_search
For help on an individual command: calibredb command --help
Whenever you pass arguments to calibredb that have spaces in them, enclose the arguments in quotation marks. For example: "/some path/with spaces"
Options:
GLOBAL OPTIONS:
--library-path=LIBRARY_PATH, --with-library=LIBRARY_PATH
Path to the calibre library. Default is to use the
path stored in the settings. You can also connect to a
calibre Content server to perform actions on remote
libraries. To do so use a URL of the form:
http://hostname:port/#library_id for example,
http://localhost:8080/#mylibrary. library_id is the
library id of the library you want to connect to on
the Content server. You can use the special library_id
value of - to get a list of library ids available on
the server. For details on how to setup access via a
Content server, see https://manual.calibre-
ebook.com/generated/en/calibredb.html.
-h, --help show this help message and exit
--version show program's version number and exit
--username=USERNAME
Username for connecting to a calibre Content server
--password=PASSWORD
Password for connecting to a calibre Content server.
To read the password from standard input, use the
special value: <stdin>. To read the password from a
file, use: <f:/path/to/file> (i.e. <f: followed by the
full path to the file and a trailing >). The angle
brackets in the above are required, remember to escape
them or use quotes for your shell.
--timeout=TIMEOUT The timeout, in seconds, when connecting to a calibre
library over the network. The default is two minutes.
Created by Kovid Goyal <kovid@kovidgoyal.net>
Last edited by shayaknyc; Today at 03:46 PM. |
|
|
|
![]() |
| Tags |
| backup, export |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Export/import all calibre data | deleted_account23 | Library Management | 1 | 07-16-2024 01:38 PM |
| Calibre 5.7.2 Hangs When Restarted In Debug Mode | baslow | Calibre | 9 | 12-17-2020 06:07 PM |
| Cannot modify selected data within Export Calibre data | Pholipe | Library Management | 1 | 09-05-2019 12:34 PM |
| Export Calibre Data | GeckoFriend | Library Management | 4 | 03-27-2018 04:15 PM |
| Calibre Hangs when downloading Metadata | Rudyman | Library Management | 9 | 08-19-2011 12:17 PM |