Error in installing ankihub addon

Before the error happened, i upgraded anki app on windows and installed the ankihub add on but it is showing an error :frowning:

Error message (don't change this)
Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2023-08-21 20:31:05

Traceback (most recent call last):

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

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

  File "decorator", line 232, in fun

  File "anki.hooks", line 89, in decorator_wrapper

  File "anki.hooks", line 86, in repl

  File "C:\Users\fatim\AppData\Roaming\Anki2\addons21\1322529746\gui\addons.py", line 40, in _check_future_for_exceptions
    _old(*args, **kwargs)

  File "aqt.addons", line 1186, in _download_done

  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.addons", line 1163, in <lambda>

  File "aqt.addons", line 1179, in _download_all

  File "aqt.addons", line 1124, in download_and_install_addon

  File "aqt.addons", line 430, in install

  File "aqt.addons", line 454, in _install

  File "decorator", line 232, in fun

  File "anki.hooks", line 89, in decorator_wrapper

  File "anki.hooks", line 84, in repl

  File "decorator", line 232, in fun

  File "anki.hooks", line 89, in decorator_wrapper

  File "anki.hooks", line 84, in repl

  File "aqt.addons", line 716, in backupUserFiles

PermissionError: [WinError 5] Access is denied: 'C:\\Users\\fatim\\AppData\\Roaming\\Anki2\\addons21\\1214357311\\user_files' -> 'C:\\Users\\fatim\\AppData\\Roaming\\Anki2\\addons21\\files_backup'

Sentry link (for developers)

Can you delete the image resizer addon and see if that fixes your issue?

I have the same problem since yesterday, I already remove the add on like twice, desinstall anki and the error is still here :frowning:

If deleting the addon does not work, try this based on @jakub.f’s recommendation


jakub.f
AnkiHub Developer

Please open C:\Users\fatim\AppData\Roaming\Anki2\addons21\files_backup in a file explorer and delete the 1214357311 folder if possible. This is the folder of the ImageResizer add-on. It’s possible that it didn’t get fully deleted when you deleted it using Anki’s Add-on dialog.

If you still get an error after doing that please post the error here.

You can try the above as well, but if you can post the error message so we can investigate further

This is the error

Can you copy paste it here, we also need the bottom part

Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0
Platform: Windows-10-10.0.19041
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2023-08-21 12:32:34

Traceback (most recent call last):

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 102, in _download_and_install_decks_inner
result.append(_download_and_install_single_deck(ah_did))

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 128, in _download_and_install_single_deck
result = _install_deck(

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 154, in _install_deck
import_result = importer.import_ankihub_deck(

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py”, line 101, in import_ankihub_deck
return self._import_ankihub_deck_inner(

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py”, line 144, in _import_ankihub_deck_inner
_adjust_note_types(remote_note_types)

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py”, line 541, in _adjust_note_types
_ensure_local_and_remote_fields_are_same(remote_note_types)

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py”, line 600, in _ensure_local_and_remote_fields_are_same
aqt.mw.col.models.update_dict(local_note_type)

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

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

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

anki.errors.CardTypeError: Card template ⁨1⁩ in notetype ‘⁨AnKingOverhaul (AnKing / AnKingMed)⁩’ has a problem.
Expected to find a field replacement on the front of the card template.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

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

File “aqt.taskman”, line 71, in

File “aqt.taskman”, line 90, in wrapped_done

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 39, in on_install_done
on_done(future_with_exception(e))

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\ankihub_sync.py”, line 55, in
on_done=lambda future: on_new_deck_subscriptions_done(

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\ankihub_sync.py”, line 24, in on_new_deck_subscriptions_done
on_done(future_with_exception(future.exception()))

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\auto_sync.py”, line 74, in sync_with_ankiweb
future.result()

File “concurrent.futures._base”, line 439, in result

File “concurrent.futures._base”, line 391, in __get_result

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 37, in on_install_done
import_results: List[AnkiHubImportResult] = 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 “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 85, in
task=lambda: _download_and_install_decks_inner(ankihub_dids),

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 114, in _download_and_install_decks_inner
raise exceptions[0]

1322529746.gui.exceptions.DeckDownloadAndInstallError: Error while downloading and installing deck e77aedfe-a636-40e2-8169-2fce2673187e: Card template ⁨1⁩ in notetype ‘⁨AnKingOverhaul (AnKing / AnKingMed)⁩’ has a problem.
Expected to find a field replacement on the front of the card template

@yulian_palmeros

Your issue looks like it has to do with the AnKing note type.

Per @abdo.nh’s suggestion, please try this first:

Can you go to Tools > Manage Notetypes and delete the “AnKingOverhaul (AnKing / AnKingMed)” notetype?

Then do this:

Unsubscribe to the deck on the ankihub addon → Unsubscribe to the deck on the AnkiHub website → Resubscribe again on the website → Press sync in Anki

Done, but still the error

Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0
Platform: Windows-10-10.0.19041
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2023-08-21 12:32:34

Traceback (most recent call last):

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 102, in _download_and_install_decks_inner
result.append(_download_and_install_single_deck(ah_did))

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 128, in _download_and_install_single_deck
result = _install_deck(

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 154, in _install_deck
import_result = importer.import_ankihub_deck(

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py”, line 101, in import_ankihub_deck
return self._import_ankihub_deck_inner(

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py”, line 148, in _import_ankihub_deck_inner
ankihub_db.remove_deck(ankihub_did)

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\db\db.py”, line 478, in remove_deck
self.execute(

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\db\db.py”, line 100, in execute
return self.connection().execute(*args, **kwargs)

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\db\db.py”, line 165, in connection
result = DBConnection(conn=sqlite3.connect(ankihub_db.database_path))

sqlite3.OperationalError: unable to open database file

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

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

File “aqt.taskman”, line 71, in

File “aqt.taskman”, line 90, in wrapped_done

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 39, in on_install_done
on_done(future_with_exception(e))

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\ankihub_sync.py”, line 55, in
on_done=lambda future: on_new_deck_subscriptions_done(

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\ankihub_sync.py”, line 24, in on_new_deck_subscriptions_done
on_done(future_with_exception(future.exception()))

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\auto_sync.py”, line 74, in sync_with_ankiweb
future.result()

File “concurrent.futures._base”, line 439, in result

File “concurrent.futures._base”, line 391, in __get_result

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 37, in on_install_done
import_results: List[AnkiHubImportResult] = 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 “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 85, in
task=lambda: _download_and_install_decks_inner(ankihub_dids),

File “C:\Users\HP\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py”, line 114, in _download_and_install_decks_inner
raise exceptions[0]

1322529746.gui.exceptions.DeckDownloadAndInstallError: Error while downloading and installing deck e77aedfe-a636-40e2-8169-2fce2673187e: unable to open database file

@abdo.nh do you know what might be going on for @yulian_palmeros?

Maybe following the steps in Permission Problems - Anki Manual could help.