Ankihub error when subscibing to an old deck followed by a database error (Continuous cycle)

I subscribed to an old private deck that previously worked. Upon syncing with ankihub I am met with the following error message. Upon closing the error message, I am prompted to install the subscribed deck again and the error repeats. When I unsubscribe, I am met with the following image:

image

If I select yes, the deck is re-added and the error message reappears. When I restart anki after this sequence, I am again met with the database error and the cycle repeats itself if I click yes. I would love some help in resolving this so I am not stuck with these error messages. I have tried uninstalling and reinstalling both anki and ankihub.

Error message (don't change this)
Anki 23.12.1 (1a1d4d54)  (ao)
Python 3.9.15 Qt 6.6.1 PyQt 6.6.1
Platform: Windows-10-10.0.19045

Traceback (most recent call last):

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 168, in _download_and_install_decks_inner
    _download_and_install_single_deck(

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 204, in _download_and_install_single_deck
    result = _install_deck(

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 238, in _install_deck
    import_result = importer.import_ankihub_deck(

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py", line 147, in import_ankihub_deck
    dids = self._import_notes(

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py", line 249, in _import_notes
    self._create_notes(notes_to_create_by_ah_nid, notes_data=upserted_notes_data)

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py", line 349, in _create_notes
    self._create_notes_inner(

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py", line 481, in _create_notes_inner
    aqt.mw.col.db.execute(

  File "anki.dbproxy", line 71, in all

  File "anki.dbproxy", line 65, in _query

  File "anki._backend", line 98, in db_query

  File "anki._backend", line 122, in _db_command

anki.errors.DBError: DbError { info: "SqliteFailure(Error { code: ConstraintViolation, extended_code: 1555 }, Some(\"UNIQUE constraint failed: notes.id\"))", kind: Other }


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 "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\auto_sync.py", line 99, in sync_with_ankiweb
    future.result()

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

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

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\utils.py", line 39, in wrapper
    return func(*args, **kwargs)

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\ankihub_sync.py", line 96, in _on_new_deck_subscriptions_done
    future.result()

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

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

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\utils.py", line 39, in wrapper
    return func(*args, **kwargs)

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 85, 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 "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 71, in <lambda>
    task=lambda: _download_and_install_decks_inner(

  File "C:\Users\bug8110\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 187, in _download_and_install_decks_inner
    raise exceptions[0]

1322529746.gui.exceptions.DeckDownloadAndInstallError: Error while downloading and installing deck 9813bcf6-788f-49f1-9a49-06ca81b116ef: DbError { info: "SqliteFailure(Error { code: ConstraintViolation, extended_code: 1555 }, Some(\"UNIQUE constraint failed: notes.id\"))", kind: Other }

Sentry link (for developers)

Hello,

Which deck is it?

It is a private deck visible under β€œmy decks” created by me titled anatomy 2023.

The error with the Anatomy 2023 deck should be fixed now. Can you confirm whether you’re still getting the β€œAnkiHub Database Check” dialog?

@ProductTeam Related: Add-on Error, unable to install deck

We should investigate why this is happening

I am unfortunately still getting the database error.

Edit: No longer having database error after clicking yes one time. Thank you for the help!

1 Like