Error on ankihub sync

Before the error happened, I was…
[trying to sync ankihub]

Error message (don't change this)
Anki 2.1.66 (70506aeb) Python 3.9.15 Qt 6.5.0 PyQt 6.5.0
Platform: macOS-14.0-arm64-arm-64bit
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-11-02 17:03:53

Traceback (most recent call last):

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

  File "/Users/tomek/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 142, in _download_and_install_single_deck
    deck.ah_did, download_progress_cb=_download_progress_cb

UnboundLocalError: local variable 'deck' referenced before assignment


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/tomek/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 41, in on_install_done
    on_done(future_with_exception(e))

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

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

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

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

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

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

  File "/Users/tomek/Library/Application Support/Anki2/addons21/1322529746/gui/operations/deck_installation.py", line 129, in _download_and_install_decks_inner
    raise exceptions[0]

1322529746.gui.exceptions.DeckDownloadAndInstallError: Error while downloading and installing deck f4c225fe-d3e6-4457-b4bc-b4f998b4cca2: local variable 'deck' referenced before assignment

Sentry link (for developers)

@ProductTeam

Looks like an unhandled exception here:
https://github.com/ankipalace/ankihub_addon/blob/1c4c88a683bc2ca1a13eb7a78ea6fd866d899e53/ankihub/gui/operations/deck_installation.py#L137

This is now fixed in the 2023-11-14.1 release of the add-on.

1 Like

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