Anki wont open keeps happening

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

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

Traceback (most recent call last):

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/ankihub_client/ankihub_client.py", line 239, in _send_request_with_retry
    response = self._send_request_with_retry_inner(request, stream=stream)

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/lib/tenacity/__init__.py", line 289, in wrapped_f
    return self(f, *args, **kw)

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/lib/tenacity/__init__.py", line 379, in __call__
    do = self.iter(retry_state=retry_state)

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/lib/tenacity/__init__.py", line 326, in iter
    raise retry_exc from fut.exception()

tenacity.RetryError: RetryError[<Future at 0x10dee1190 state=finished raised ConnectionError>]


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/ankihub_client/ankihub_client.py", line 245, in _send_request_with_retry
    response = last_attempt.result()

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

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

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/lib/tenacity/__init__.py", line 382, in __call__
    result = fn(*args, **kwargs)

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/ankihub_client/ankihub_client.py", line 260, in _send_request_with_retry_inner
    response = session.send(request, stream=stream)

  File "requests.sessions", line 703, in send

  File "requests.adapters", line 519, in send

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='app.ankihub.net', port=443): Max retries exceeded with url: /api/decks/subscriptions/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10dee14f0>: Failed to establish a new connection: [Errno 61] Connection refused'))


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


Traceback (most recent call last):

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

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/gui/auto_sync.py", line 101, 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/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/gui/operations/ankihub_sync.py", line 66, in sync_with_ankihub
    subscribed_decks = client.get_deck_subscriptions()

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/ankihub_client/ankihub_client.py", line 579, in get_deck_subscriptions
    response = self._send_request("GET", API.ANKIHUB, "/decks/subscriptions/")

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/ankihub_client/ankihub_client.py", line 225, in _send_request
    response = self._send_request_with_retry(prepped, stream=stream)

  File "/Users/gaurisahibzada/Library/Application Support/Anki2/addons21/1322529746/ankihub_client/ankihub_client.py", line 247, in _send_request_with_retry
    raise AnkiHubRequestException(e) from e

1322529746.ankihub_client.ankihub_client.AnkiHubRequestException: AnkiHub request exception: HTTPSConnectionPool(host='app.ankihub.net', port=443): Max retries exceeded with url: /api/decks/subscriptions/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10dee14f0>: Failed to establish a new connection: [Errno 61] Connection refused'))

Sentry link (for developers)

1 Like

Working again, thanks. Didn’t know your addon is the reason and reinstalled Anki + all addons cause had to force quit every time because of freezing. Maybe implement a timeout or something idk.

1 Like

I believe we already have a timeout for web requests. @jakub.f can you confirm?

I checked and we don’t have a timeout right now. We’ll need to change that. Aside from that we will probably move the request to a background thread so that it doesn’t block Anki at all.

1 Like