Ankihub crashes on opening

Before the error happened, I was…
[Syncing]

Error message (don't change this)
Anki 23.12.1 (1a1d4d54)  (ao)
Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: macOS-12.7-x86_64-i386-64bit

Traceback (most recent call last):

  File "aqt.taskman", line 142, in _on_closures_pending

  File "aqt.taskman", line 86, in <lambda>

  File "aqt.operations", line 252, in wrapped_done

  File "/Users/stacey/Library/Application Support/Anki2/addons21/1322529746/gui/media_sync.py", line 49, in on_failure
    raise exception

  File "concurrent.futures.thread", line 58, in run

  File "aqt.operations", line 242, in wrapped_op

  File "/Users/stacey/Library/Application Support/Anki2/addons21/1322529746/gui/media_sync.py", line 53, in <lambda>
    op=lambda _: self._update_deck_media_and_download_missing_media(),

  File "/Users/stacey/Library/Application Support/Anki2/addons21/1322529746/gui/media_sync.py", line 118, in _update_deck_media_and_download_missing_media
    self._update_deck_media(ankihub_did=ah_did)

  File "/Users/stacey/Library/Application Support/Anki2/addons21/1322529746/gui/media_sync.py", line 156, in _update_deck_media
    ankihub_db.upsert_deck_media_infos(

  File "/Users/stacey/Library/Application Support/Anki2/addons21/1322529746/db/db.py", line 580, in upsert_deck_media_infos
    conn.execute(

  File "/Users/stacey/Library/Application Support/Anki2/addons21/1322529746/db/db_utils.py", line 39, in execute
    return self._execute_inner(sql, *args, first_row_only=first_row_only)

  File "/Users/stacey/Library/Application Support/Anki2/addons21/1322529746/db/db_utils.py", line 55, in _execute_inner
    raise e

  File "/Users/stacey/Library/Application Support/Anki2/addons21/1322529746/db/db_utils.py", line 47, in _execute_inner
    cur.execute(sql, args)

sqlite3.DatabaseError: database disk image is malformed

Sentry link (for developers)

Your AnkiHub database is corrupted. Please follow the steps if you still have the issue:

  1. Close Anki
  2. Go to the ~/Library/Application Support/AnkiHub folder. The Library folder is hidden by default, but can be revealed in Finder by holding down the option key while clicking on the Go menu.
  3. You should see multiple subfolders with random names. Open each subfolder and delete the ankihub.db file.

Solved. Thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.