How do I fix this? :(

Before the error happened, I was using AnKing as normal for months. I am subscribed, but my most recent sync messed up everything and now it won’t sync to ankihub even when I log in and none of my AnKing cards have cloze anymore :frowning: Help plz

Error message (don't change this)
Anki 2.1.65 (aa9a734f) Python 3.9.15 Qt 6.5.0 PyQt 6.5.0
Platform: macOS-13.4.1-arm64-arm-64bit
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2023-09-20 08:22:52

Traceback (most recent call last):

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 103, in _download_and_install_decks_inner
    result.append(_download_and_install_single_deck(ah_did))

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 129, in _download_and_install_single_deck
    result = _install_deck(

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 159, in _install_deck
    import_result = importer.import_ankihub_deck(

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

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

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 499, in _adjust_note_types_in_anki_db
    _ensure_local_and_remote_fields_are_same(remote_note_types)

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/main/importing.py", line 558, 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 <U+2068>1<U+2069> in notetype '<U+2068>AnKingOverhaul (AnKing / AnKingMed)<U+2069>' has a problem.<br>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 <lambda>

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

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 40, in on_install_done
    on_done(future_with_exception(e))

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 56, in <lambda>
    on_done=lambda future: on_new_deck_subscriptions_done(

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 24, in on_new_deck_subscriptions_done
    on_done(future_with_exception(future.exception()))

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/menu.py", line 433, in on_done
    future.result()

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

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

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 38, 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 "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 86, in <lambda>
    task=lambda: _download_and_install_decks_inner(ankihub_dids),

  File "/Users/kristinaoconnell/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 115, 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 <U+2068>1<U+2069> in notetype '<U+2068>AnKingOverhaul (AnKing / AnKingMed)<U+2069>' has a problem.<br>Expected to find a field replacement on the front of the card template.

Sentry link (for developers)

Can you go to Tools > Manage Notetypes and see if “AnKingOverhaul (AnKing / AnKingMed)” note type has any notes? If it doesn’t, can you try deleting it and syncing again?

it appears the AnKingOverhaul note type in your collection has different fields and structure from the expected form: It has the “Front” and “Back” fields.

I have tried deleting the add on/logging out and re-syncing, but it is not working. I cannot figure out how to make the card type switch back to the proper structure of cloze type and not just front/back because it does not appear to give me that option. :frowning:

Just to confirm, did you try deleting the note type? Reinstalling the add-on may not help here.

Wait thank you!! I didn’t realize it was the specific note type with the issue I thought it was the add on as a whole. This worked! Thanks so much

2 Likes

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