Anki wont load error

Before the error happened, I was…
doing anki then it stopped working. i restarted my computer and still nothing works

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-14.3-arm64-arm-64bit

Traceback (most recent call last):

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

  File "/Users/natilec/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 "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/gui/operations/utils.py", line 39, in wrapper
    return func(*args, **kwargs)

  File "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 118, in _on_sync_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 "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 110, in <lambda>
    task=lambda: ah_deck_updater.update_decks_and_media(to_sync_ah_dids),

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

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

  File "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 145, in import_ankihub_deck
    self._import_note_types(note_types=note_types)

  File "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 188, in _import_note_types
    _adjust_note_types_in_anki_db(note_types)

  File "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 754, in _adjust_note_types_in_anki_db
    _update_templates_and_css(remote_note_types)

  File "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 793, in _update_templates_and_css
    aqt.mw.col.models.update_dict(updated_note_type)

  File "anki.models", line 226, in update_dict

  File "anki._backend_generated", line 1065, in update_notetype_legacy

  File "anki._backend", line 166, in _run_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)

update: i tried to import a backup file but the backup file was not “.apkg” it was .colpkg and wouldn’t allow me to restore

it is only for the anking haul deck and when i click it it says
Anki encountered a problem. Please follow the troubleshooting steps.

Add-ons possibly involved: ⁨Web Browser - Search terms Import texts and images automatically⁩

please help me

Please disable the web browser addon and try again

it did not help

when i click check database it says “Collection file is corrupt. Please restore from an automatic backup.” so i tried to but the backups i have are .colpkg and would not allow me to restore. I dont know if that helps you
thank you.

Restore through this method: https://www.youtube.com/watch?v=rHnUgNIJcR4&t=0s

DbError { info: “SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some("database disk image is malformed"))”, kind: Other }

that is the message i got when i tried to export it

Can you try older backups? Does this happen with every backup you try to restore?

yes.
Your collection file appears to be corrupt. This can happen when the file is copied or moved while Anki is open, or when the collection is stored on a network or cloud drive. If problems persist after restarting your computer, please open an automatic backup from the profile screen.

then it says
The provided file is not a valid .apkg file.


all of them say .colpkg im not sure if that makes a difference

update: still does not work

This indicates the backup is corrupted too. Have you tried some earlier backups? Do all of them give the same error?

all of them give the same error.

please if you can help me with this issue. I haven’t been able to use anki all day and i’m gonna fall behind on my cards

Do you sync with AnkiWeb? Can you try creating a new Anki profile and syncing with AnkiWeb there to get a fresh collection. That’ll probably solve the corruption issue, unless if it’s caused by something in your computer.

my anki was workimg fine yesterday and now it is saying the same thing . i was just using it and it suddenly stopped working
when i go on anki web it shoes twice the amount of cards i have due. on myy anki desktop i have 800 left and on anki web i have 1645 left to do

it doesnt sync
here is the new debug info from todays issue

Anki 23.12.1 (1a1d4d54) (ao)
Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: macOS-14.3-arm64-arm-64bit

Traceback (most recent call last):

File “aqt.taskman”, line 142, in _on_closures_pending

File “/Users/natilec/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 “/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/gui/operations/utils.py”, line 39, in wrapper
return func(*args, **kwargs)

File “/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py”, line 118, in _on_sync_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 “/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py”, line 110, in
task=lambda: ah_deck_updater.update_decks_and_media(to_sync_ah_dids),

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

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

File “/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/main/importing.py”, line 145, in import_ankihub_deck
self._import_note_types(note_types=note_types)

File “/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/main/importing.py”, line 188, in _import_note_types
_adjust_note_types_in_anki_db(note_types)

File “/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/main/importing.py”, line 754, in _adjust_note_types_in_anki_db
_update_templates_and_css(remote_note_types)

File “/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/main/importing.py”, line 793, in _update_templates_and_css
aqt.mw.col.models.update_dict(updated_note_type)

File “anki.models”, line 226, in update_dict

File “anki._backend_generated”, line 1065, in update_notetype_legacy

File “anki._backend”, line 166, in _run_command

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

i tried to upload the deck to ankiweb and it said

DbError { info: “SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some("database disk image is malformed"))”, kind: Other }

then it cancelled the upload. It is specifically the anking desk because the other decks i have work fine

also i would like to add i disables all the add on and the issue persists

Try deleting the deck completely then using Tools > Check Database.

No. Backups are in .colpkg format. The error message is just inaccurate here and it’s indicating a file corruption.

Can you go to AnkiHub > Help > Upload logs and data and paste the filename shown here?

i did a backup from 7 days ago so im not sure if the " upload logs and data" will show my previous issue but here you go

ankihub_addon_debug_info_895e9_1718635414.zip

with the file that was able to upload i have to redo all the work ive done this entire week

update: even though i was able to do a backup from 7 days ago, i tried to sync it and it wouldn’t let me. i got this error

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-14.3-arm64-arm-64bit

Traceback (most recent call last):

  File "/Users/natilec/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 "/Users/natilec/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 "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/gui/operations/utils.py", line 39, in wrapper
    return func(*args, **kwargs)

  File "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 118, in _on_sync_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 "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 110, in <lambda>
    task=lambda: ah_deck_updater.update_decks_and_media(to_sync_ah_dids),

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

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

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

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

  File "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/db/db.py", line 161, in upsert_notes_data
    AnkiHubNote.insert_many(chunk).on_conflict_replace().execute()

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

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

  File "/Users/natilec/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 2887, in _execute
    return super(Insert, self)._execute(database)

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

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

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

  File "/Users/natilec/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/natilec/Library/Application Support/Anki2/addons21/1322529746/lib/peewee.py", line 192, in reraise
    raise value.with_traceback(tb)

  File "/Users/natilec/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)

this is the new “upload and logs data” zip after the failed sync.

ankihub_addon_debug_info_895e9_1718672828.zip

still doesnt work