Error

Before the error happened, I was…
[Replace this text.]

Error message (don't change this)
Anki 24.06.3 (d678e393)  (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: macOS-15.7-x86_64-i386-64bit

Traceback (most recent call last):

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 3291, in execute_sql
    cursor.execute(sql, params or ())

sqlite3.DatabaseError: database disk image is malformed


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

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

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

  File "aqt.taskman", line 106, in wrapped_done

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

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 153, in on_failure
    on_done(future_with_exception(exception))

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/gui/auto_sync.py", line 99, in sync_with_ankiweb
    future.result()

  File "concurrent.futures._base", line 439, in result

  File "concurrent.futures._base", line 391, in __get_result

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

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

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 142, in <lambda>
    op=lambda _: ah_deck_updater.update_decks_and_media(

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/gui/deck_updater.py", line 65, in update_decks_and_media
    self._update_decks(ah_dids)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/gui/deck_updater.py", line 88, in _update_decks
    should_continue = self._update_single_deck(ah_did)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/gui/deck_updater.py", line 102, in _update_single_deck
    result = self._fetch_and_apply_deck_updates(ankihub_did)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/gui/deck_updater.py", line 142, in _fetch_and_apply_deck_updates
    import_result = self._importer.import_ankihub_deck(

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 155, in import_ankihub_deck
    dids = self._import_notes(

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 353, in _import_notes
    upserted_notes_data, skipped_notes_data = ankihub_db.upsert_notes_data(

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/db/db.py", line 129, in upsert_notes_data
    skipped_notes = self._determine_notes_to_skip(

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/db/db.py", line 208, in _determine_notes_to_skip
    execute_list_query_in_chunks(

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/db/db.py", line 708, in execute_list_query_in_chunks
    return execute_query_in_chunks(

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/db/db.py", line 731, in execute_query_in_chunks
    result = accumulator(result, result_chunk)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/db/db.py", line 711, in <lambda>
    accumulator=lambda total, chunk: total + list(chunk),

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 2112, in __len__
    self._ensure_execution()

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 2094, in _ensure_execution
    self.execute()

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 2011, in inner
    return method(self, database, *args, **kwargs)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 2082, in execute
    return self._execute(database)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 2255, in _execute
    cursor = database.execute(self)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 3299, in execute
    return self.execute_sql(sql, params)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 3291, in execute_sql
    cursor.execute(sql, params or ())

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 3059, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 192, in reraise
    raise value.with_traceback(tb)

  File "/Users/matthewcoyne/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 3291, in execute_sql
    cursor.execute(sql, params or ())

peewee.DatabaseError: database disk image is malformed

Sentry link (for developers)

Hello,

Your Anki and AnkiHub add-on are not be up-to-date. Please follow the steps below to update them.

First, please update Anki to the latest version. You can download it from the official website: https://apps.ankiweb.net/

Then, update the AnkiHub add-on:

  1. On your Anki main screen, go to Tools > Add-ons > Check for Updates.
  2. After the update is complete, please restart Anki.

Please let me know if you continue to experience this issue after updating, as you may have some corrupted data.

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