I need help, I've tried using previous beckups, but the solution is temporary and the error reappears

Before the error happened, I was

[Replace this text.]

Error message (don't change this)
Anki 24.04.1 (ccd9ca1a)  (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Windows-10-10.0.22621

Traceback (most recent call last):

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 3291, in execute_sql
    cursor.execute(sql, params or ())

sqlite3.OperationalError: unable to open database file


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "C:\Users\mathe\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\mathe\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\deck_installation.py", line 204, in _download_and_install_single_deck
    result = _install_deck(

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

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

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\main\importing.py", line 215, in _import_notes
    upserted_notes_data, skipped_notes_data = ankihub_db.upsert_notes_data(

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\db\db.py", line 161, in upsert_notes_data
    AnkiHubNote.insert_many(chunk).on_conflict_replace().execute()

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 2011, in inner
    return method(self, database, *args, **kwargs)

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 2082, in execute
    return self._execute(database)

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 2887, in _execute
    return super(Insert, self)._execute(database)

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 2600, in _execute
    cursor = database.execute(self)

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 3299, in execute
    return self.execute_sql(sql, params)

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 3291, in execute_sql
    cursor.execute(sql, params or ())

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 3059, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 192, in reraise
    raise value.with_traceback(tb)

  File "C:\Users\mathe\AppData\Roaming\Anki2\addons21\1322529746\lib\peewee.py", line 3291, in execute_sql
    cursor.execute(sql, params or ())

peewee.OperationalError: unable to open database file


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\mathe\AppData\Roaming\Anki2\addons21\1322529746\gui\menu.py", line 332, in on_done
    future.result()

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

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

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

  File "C:\Users\mathe\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\mathe\AppData\Roaming\Anki2\addons21\1322529746\gui\operations\utils.py", line 39, in wrapper
    return func(*args, **kwargs)

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

  File "C:\Users\mathe\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 3011b4d1-b8d2-4b5f-b391-2b9b2a6a7147: unable to open database file

Sentry link (for developers)

When trying to check the database, the following message appears:

Anki 24.04.1 (ccd9ca1a) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Windows-10-10.0.22621

Traceback (most recent call last):
File “aqt.taskman”, line 142, in _on_closures_pending
File “aqt.taskman”, line 86, in
File “aqt.taskman”, line 106, in wrapped_done
File “aqt.dbcheck”, line 41, in on_future_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.dbcheck”, line 36, in do_check
File “aqt.main”, line 1486, in create_backup_now
File “anki.collection”, line 340, in create_backup
File “anki._backend_generated”, line 161, in create_backup
File “anki._backend”, line 173, in _run_command
anki.errors.BackendIOError: Failed to create file in 'C:\Users\mathe\AppData\Local\Temp': Acesso negado. (os error 5) at path “C:\Users\mathe\AppData\Local\Temp\.tmp68upfY”

Error in sys.excepthook:
Traceback (most recent call last):

Original exception was:
Traceback (most recent call last):

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
AnkiHub [‘1322529746’, 2024-05-30T17:25, ‘None’, ‘’]

===IDs of active AnkiWeb add-ons===
1322529746

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])

END

DbError { info: “SqliteFailure(Error { code: CannotOpen, extended_code: 14 }, Some("unable to open database file"))”, kind: Other }

This appears to be a permission issue. My comment here still applies: Help, I can't synchronize with AnkiHub - #5 by abdo.nh

Does running Anki as admin make a difference?

I didn’t understand why this problem kept appearing, but I solved it using a Windons tool - “Solve compatibility problems”

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.