View Single Post
Old 01-23-2024, 04:31 AM   #1
Rascaltoo
Junior Member
Rascaltoo began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jun 2022
Location: Georgia, USA
Device: none
Restoring database failed with error

I am using Windows 11 on an MSI-Raider, kept up to date, as well as calibre-64 bit 7.4.0, but I also had the issue on the previous version (since it was my own mess up).

Corrupted library recovery help needed, through something of my own doing.

I was (stupidly) unaware that you can't have the Library backed up on OneDrive even with the files 'physically' on the computer. I removed them from there and they are now stored locally in my C drive.

Calibre started crashing on me (I assume from the reason above) and I would just start it up again, until it wouldn't even open while also trying possible fixes like re-installing, restarting in safe mode, running it on debug, etc.
These were some of the errors messages I received:

Spoiler:

Code:
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 95, in <module>
  File "site.py", line 90, in main
  File "site.py", line 50, in run_entry_point
  File "calibre\utils\ipc\worker.py", line 215, in main
  File "calibre\utils\ipc\worker.py", line 150, in arbitrary_n
  File "calibre_plugins.fanficfare_plugin.jobs", line 140, in do_download_worker
TypeError: 'NoneType' object is not iterable


as well as:

Spoiler:

Code:
calibre, version 7.4.0
ERROR: Startup error: There was an error during calibre startup. Parts of calibre may not function. Click "Show details" to learn more.

Traceback (most recent call last):
  File "calibre\gui2\tag_browser\model.py", line 1283, in _get_category_nodes
  File "calibre\db\cache.py", line 1549, in get_categories
  File "calibre\db\categories.py", line 232, in get_categories
  File "calibre\db\fields.py", line 194, in get_categories
  File "calibre\db\categories.py", line 32, in __init__
AttributeError: 'NoneType' object has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre\gui2\main.py", line 312, in initialize_db_stage2
  File "calibre\gui2\main.py", line 255, in start_gui
  File "calibre\gui2\ui.py", line 366, in initialize
  File "calibre\gui2\tag_browser\ui.py", line 122, in init_tag_browser_mixin
  File "calibre\gui2\tag_browser\view.py", line 392, in set_database
  File "calibre\gui2\tag_browser\model.py", line 438, in set_database
  File "calibre\gui2\tag_browser\model.py", line 513, in _run_rebuild
  File "calibre\gui2\tag_browser\model.py", line 518, in _rebuild_node_tree
  File "calibre\gui2\tag_browser\model.py", line 1289, in _get_category_nodes
  File "calibre\db\cache.py", line 1549, in get_categories
  File "calibre\db\categories.py", line 232, in get_categories
  File "calibre\db\fields.py", line 192, in get_categories
  File "calibre\db\fields.py", line 742, in category_sort_value
TypeError: 'str' object does not support item assignment


I used sfc/scannow and it repaired something, but crashing still continued.

I found some threads here about fixing the corrupted database, so I deleted the metedata.db file to restore library through the program, but that also crashed as well. Also found the command line way and used the following:
Code:
calibredb --with-library=C:\Calibre_Library restore_database -r
It froze on me a few times at various stages 16%, 36%, then at around 12% again so I used the Windows Memory Diagnostic and memtest86 to no error messages. When I ran the command line restore database again today, it finally reached the end to this error message:

Spoiler:

Code:
Starting restoring preferences and column metadata ... 0%
Cannot restore preferences. Backup file not found. ... 100%
Restoring database failed with error:
Traceback (most recent call last):
  File "calibre\db\restore.py", line 156, in run
  File "calibre\db\restore.py", line 266, in create_cc_metadata
  File "calibre\ebooks\metadata\book\base.py", line 137, in __getattribute__
TypeError: 'bool' object does not support the context manager protocol


I was unable to find threads about this specific error message so I'm wondering if there's a fix, if there's a way to restore my database (if at all possible) or if I screwed myself too thoroughly.

Thank you for any and all available help!
Rascaltoo is offline   Reply With Quote