Browse button error

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

Error message (don't change this)
Anki 2.1.63 (f356f177) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-09-24 15:29:40

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 "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\ankihub_sync.py", line 44, in on_sync_done
    maybe_check_databases()

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\db_check\__init__.py", line 23, in maybe_check_databases
    check_ankihub_db(on_success=check_anki_db)

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\db_check\ah_db_check.py", line 16, in check_ankihub_db
    on_success()

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\db_check\anki_db_check.py", line 19, in check_anki_db
    _check_ankihub_update_tags()

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\db_check\anki_db_check.py", line 124, in _check_ankihub_update_tags
    nids = aqt.mw.col.find_notes("tag:AnkiHub_Update::*")

  File "anki.collection", line 696, in find_notes

  File "anki._backend_generated", line 1544, in search_notes

  File "anki._backend", line 156, in _run_command

anki.errors.DBError: DbError { info: "SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some(\"invalid utf-8 sequence of 1 bytes from index 640\"))", kind: Other }

Sentry link (for developers)

today i began receiving an error message whenever I tried to click on any tag on the browse page to see all the cards with the particular tag. the error message was:

DbError { info: “SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some(“invalid utf-8 sequence of 1 bytes from index 640”))”, kind: Other }

i also ran the check database tool and tried to update my AnKing deck and the following error message appeared with both:

DbError { info: “”, kind: Utf8 }

does anyone have any idea how to fix these issues? i’m hoping it’s one issue causing both error messages but any insight would be greatly appreciated.

I have already tried the forced one-way sync and continue to get the same messages.

Error message (don't change this)
Anki 2.1.63 (f356f177) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-09-24 15:32:48

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 "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\ankihub_sync.py", line 44, in on_sync_done
    maybe_check_databases()

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\db_check\__init__.py", line 23, in maybe_check_databases
    check_ankihub_db(on_success=check_anki_db)

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\db_check\ah_db_check.py", line 16, in check_ankihub_db
    on_success()

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\db_check\anki_db_check.py", line 19, in check_anki_db
    _check_ankihub_update_tags()

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\db_check\anki_db_check.py", line 124, in _check_ankihub_update_tags
    nids = aqt.mw.col.find_notes("tag:AnkiHub_Update::*")

  File "anki.collection", line 696, in find_notes

  File "anki._backend_generated", line 1544, in search_notes

  File "anki._backend", line 156, in _run_command

anki.errors.DBError: DbError { info: "SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some(\"invalid utf-8 sequence of 1 bytes from index 640\"))", kind: Other }

Sentry link (for developers)

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

Error message (don't change this)
Anki 2.1.63 (f356f177) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-09-25 18:26:10

Traceback (most recent call last):

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 103, in _download_and_install_decks_inner
    result.append(_download_and_install_single_deck(ah_did))

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

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

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py", line 117, in import_ankihub_deck
    dids = self._import_notes(notes_data=notes)

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py", line 166, in _import_notes
    _reset_note_types_of_notes_based_on_notes_data(upserted_notes)

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py", line 605, in _reset_note_types_of_notes_based_on_notes_data
    reset_note_types_of_notes(nid_mid_pairs)

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\main\utils.py", line 166, in reset_note_types_of_notes
    note = aqt.mw.col.get_note(nid)

  File "anki.collection", line 527, in get_note

  File "anki.notes", line 49, in __init__

  File "anki.notes", line 55, in load

  File "anki._backend_generated", line 653, in get_note

  File "anki._backend", line 156, in _run_command

anki.errors.DBError: DbError { info: "", kind: Utf8 }


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 "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 40, in on_install_done
    on_done(future_with_exception(e))

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\ankihub_sync.py", line 56, in <lambda>
    on_done=lambda future: on_new_deck_subscriptions_done(

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\ankihub_sync.py", line 24, in on_new_deck_subscriptions_done
    on_done(future_with_exception(future.exception()))

  File "C:\Users\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\auto_sync.py", line 74, 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\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 38, 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\dcamb006\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 86, in <lambda>
    task=lambda: _download_and_install_decks_inner(ankihub_dids),

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

1322529746.gui.exceptions.DeckDownloadAndInstallError: Error while downloading and installing deck e77aedfe-a636-40e2-8169-2fce2673187e: DbError { info: "", kind: Utf8 }

Sentry link (for developers)

You appear to have a specific tag causing the problem. Are you able to search for “AnkiHub_Update” from the sidebar? Can you perhaps delete it?

Another thing to try is to update to the latest Anki version.

You can also use AnkiHub > Help > Upload logs and data and I’ll investigate the issue with your collection. Please let me know the filename shown.

I get the error with every tag. When i searched for that specific tag, nothing came up. This is the file:

ankihub_addon_debug_info_01007_1695692662.zip

OK, this is apparently not related to AnkiHub. I’ll get back to you with a fix.

This is caused by a single note that has invalid tags. To fix it, run the following code in the debug console:

mw.col.db.execute('update notes set tags = "" where id = 1556275023917')

This will simply clear the tags of the note with ID 1556275023917. If syncing with AnkiHub doesn’t bring the correct tags back, you can copy them manually from the site: Sign In

Let us know If you have any clues about how this happened and what you did differently before it appeared.

Thank you so much for the help! That debug fixed it.

I also received an error for an AnkiHub add-on. That’s why I thought it was related to syncing in some way:

Anki 2.1.66 (70506aeb) Python 3.9.15 Qt 6.5.2 PyQt 6.5.2
Platform: Windows-10-10.0.19045
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-09-25 05:09:59

Traceback (most recent call last):

File “aqt.taskman”, line 122, in _on_closures_pending

File “aqt.taskman”, line 71, in

File “C:\Users\Daniel\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py”, line 180, in _on_download_finished
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\Daniel\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py”, line 107, in _update_deck_media_and_download_missing_media
self._update_deck_media(ankihub_did=ah_did)

File “C:\Users\Daniel\AppData\Roaming\Anki2\addons21\1322529746\gui\media_sync.py”, line 141, in _update_deck_media
since=deck_config.latest_media_update,

AttributeError: ‘NoneType’ object has no attribute ‘latest_media_update’

This error is unrelated. We’ll look into it.

@ProductTeam I think this error started to appear since the 2023-09-06.1 update.