Add-On Error with Application Opening

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

Error message (don't change this)
Anki 25.09.4 (d52ca669) (ao)
Python 3.13.5 Qt 6.9.1 PyQt 6.9.1
Platform: macOS-26.3.1-arm64-arm-64bit-Mach-O

Traceback (most recent call last):

  File "/Users/mollymccuensherard/Library/Application Support/AnkiProgramFiles/.venv/lib/python3.13/site-packages/aqt/taskman.py", line 152, in raise_exception
    raise exception

  File "/Users/mollymccuensherard/Library/Application Support/AnkiProgramFiles/.venv/lib/python3.13/site-packages/aqt/taskman.py", line 148, in _on_closures_pending
    closure()
    ~~~~~~~^^

  File "/Users/mollymccuensherard/Library/Application Support/AnkiProgramFiles/.venv/lib/python3.13/site-packages/aqt/taskman.py", line 88, in <lambda>
    lambda future: self.run_on_main(lambda: on_done(future))
                                            ~~~~~~~^^^^^^^^

  File "/Users/mollymccuensherard/Library/Application Support/AnkiProgramFiles/.venv/lib/python3.13/site-packages/aqt/taskman.py", line 111, in wrapped_done
    on_done(fut)
    ~~~~~~~^^^^^

  File "/Users/mollymccuensherard/Library/Application Support/AnkiProgramFiles/.venv/lib/python3.13/site-packages/aqt/operations/__init__.py", line 253, in wrapped_done
    self._failure(exception)
    ~~~~~~~~~~~~~^^^^^^^^^^^

  File "/Users/mollymccuensherard/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 106, in <lambda>
    .failure(lambda e: on_done(future_with_exception(e)))
                       ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/mollymccuensherard/Library/Application Support/Anki2/addons21/1322529746/gui/auto_sync.py", line 100, in sync_with_ankiweb
    future.result()
    ~~~~~~~~~~~~~^^

  File "/Users/mollymccuensherard/Library/Application Support/AnkiProgramFiles/python/cpython-3.13.5-macos-aarch64-none/lib/python3.13/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^

  File "/Users/mollymccuensherard/Library/Application Support/AnkiProgramFiles/python/cpython-3.13.5-macos-aarch64-none/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception

  File "/Users/mollymccuensherard/Library/Application Support/AnkiProgramFiles/python/cpython-3.13.5-macos-aarch64-none/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)

  File "/Users/mollymccuensherard/Library/Application Support/AnkiProgramFiles/.venv/lib/python3.13/site-packages/aqt/operations/__init__.py", line 243, in wrapped_op
    return self._op(mw.col)
           ~~~~~~~~^^^^^^^^

  File "/Users/mollymccuensherard/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 102, in <lambda>
    op=lambda _: get_subscriptions_and_clean_up(),
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^

  File "/Users/mollymccuensherard/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 89, in get_subscriptions_and_clean_up
    subscribed_decks = client.get_deck_subscriptions()

  File "/Users/mollymccuensherard/Library/Application Support/Anki2/addons21/1322529746/ankihub_client/ankihub_client.py", line 633, in get_deck_subscriptions
    raise AnkiHubHTTPError(response)

1322529746.ankihub_client.ankihub_client.AnkiHubHTTPError: AnkiHub request error: 401 Unauthorized
Invalid token.

Sentry link (for developers)

Hello,

Are you experiencing this error repeatedly? Try logging out of AnkiHub then logging in again to see if the error goes away.

Hi there,

The error happens every time I open the Anki app. I have tried to restart my computer, though the error persists. When the error message pops up, I can’t utilize any functions of the Anki app because the application stops responding, requiring me to force quit.

Is there a way to log out of AnkiHub without the Anki app? As mentioned, I cannot perform any functions or access the Anki toolbar in the app because the error message freezes the app.

Thank you!

I asked a developer to take a look at it. In the meantime, you can safely delete the add-on and re-download it. This will cause the add-on to request your credentials again, and once you log in, everything should work fine.

Since you cannot perform any actions because of the error, you should start Anki in Safe Mode..

  • Starting Anki in safe mode will temporarily disable all add-ons. To do this, open Anki while holding down the Shift key.
  • Go to Tools > Add-ons. Select the AnkiHub Add-on and delete it.
  • Close Anki, then open it normally. Go to Tools > Add-ons, get add-ons, and put this code: 1322529746