Unable to update AnkiHub

ANKI has not been able to update AnkiHub for a few weeks.

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: 2024-02-04 13:39:30

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\tarek\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\\tarek\\AppData\\Roaming\\Anki2\\addons21\\1214357311\\user_files' -> 'C:\\Users\\tarek\\AppData\\Roaming\\Anki2\\addons21\\files_backup'

Sentry link (for developers)

Please try this solution:

Anki 24.04 (429bc9e1) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Windows-10-10.0.22631

Traceback (most recent call last):

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\ankihub_client\ankihub_client.py”, line 246, in _send_request_with_retry
response = self._send_request_with_retry_inner(

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\lib\tenacity_init_.py”, line 289, in wrapped_f
return self(f, *args, **kw)

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\lib\tenacity_init_.py”, line 379, in call
do = self.iter(retry_state=retry_state)

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\lib\tenacity_init_.py”, line 326, in iter
raise retry_exc from fut.exception()

tenacity.RetryError: RetryError[<Future at 0x29bab092490 state=finished raised SSLError>]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\ankihub_client\ankihub_client.py”, line 254, 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 “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\lib\tenacity_init_.py”, line 382, in call
result = fn(*args, **kwargs)

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\ankihub_client\ankihub_client.py”, line 269, in _send_request_with_retry_inner
response = session.send(request, stream=stream, timeout=timeout)

File “requests.sessions”, line 703, in send

File “requests.adapters”, line 517, in send

requests.exceptions.SSLError: HTTPSConnectionPool(host=‘app.ankihub.net’, port=443): Max retries exceeded with url: /api/login/ (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)’)))

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

Traceback (most recent call last):

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\gui\menu.py”, line 186, in login
token = ankihub_client.login(credentials=credentials)

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\ankihub_client\ankihub_client.py”, line 275, in login
response = self._send_request(“POST”, API.ANKIHUB, “/login/”, json=credentials)

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\ankihub_client\ankihub_client.py”, line 228, in _send_request
response = self._send_request_with_retry(

File “C:\Users\tarek\AppData\Roaming\Anki2\addons21\1322529746\ankihub_client\ankihub_client.py”, line 256, 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/login/ (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)’)))

Please try the solution here:

God bless you! I have been trying for hours and hours to fix this. How did you figure this out?? and reproduce it?**

1 Like

Some googling & trial and error :smile: