Random disk is malformed error. What should I do?

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

Error message (don't change this)
Anki 24.11 (87ccd24e)  (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: macOS-15.1.1-x86_64-i386-64bit

Traceback (most recent call last):

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

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

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

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

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

  File "/Users/humzaarif/Library/Application Support/Anki2/addons21/1322529746/gui/menu.py", line 333, in on_done
    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 243, in wrapped_op

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

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

  File "/Users/humzaarif/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/humzaarif/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/humzaarif/Library/Application Support/Anki2/addons21/1322529746/gui/deck_updater.py", line 143, in _fetch_and_apply_deck_updates
    import_result = self._importer.import_ankihub_deck(

  File "/Users/humzaarif/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 163, in import_ankihub_deck
    self._import_notes(

  File "/Users/humzaarif/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 339, in _import_notes
    self._reset_note_types_of_notes_based_on_notes_data(upserted_notes_data)

  File "/Users/humzaarif/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 384, in _reset_note_types_of_notes_based_on_notes_data
    change_note_types_of_notes(nid_mid_pairs, raise_if_full_sync_required=self._raise_if_full_sync_required)

  File "/Users/humzaarif/Library/Application Support/Anki2/addons21/1322529746/main/utils.py", line 351, in change_note_types_of_notes
    current_mid = aqt.mw.col.db.scalar(f"SELECT mid FROM notes WHERE id={nid}")

  File "anki.dbproxy", line 87, in scalar

  File "anki.dbproxy", line 66, in _query

  File "anki._backend", line 99, in db_query

  File "anki._backend", line 123, in _db_command

anki.errors.DBError: DbError { info: "SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some(\"database disk image is malformed\"))", kind: Other }

Sentry link (for developers)

Hello,

  1. You are not on the latest version of Anki. Download it here: https://apps.ankiweb.net/. After downloading, simply run the downloaded file to update your application.

  2. It looks like your collection is corrupted. You will need to restore it from a recent backup made before the issue started.
    Please see this tutorial for step-by-step instructions on how to do that: How to Restore from Backup

1 Like

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