SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some(\"database disk image is malformed

I mistakenly left Anki open overnight and got the following log:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 2.1.60 (76d88073) Python 3.9.2 Qt 5.15.2 PyQt 5.15.2
Platform: Linux-5.4.0-faked-aarch64-with-glibc2.31
Flags: frz=False ao=True sv=1
Add-ons, last update check: 2023-03-28 08:26:52

Caught exception:
Traceback (most recent call last):
  File "/home/anki-user/pyenv/lib/python3.9/site-packages/aqt/progress.py", line 118, in handler
    func()
  File "/home/anki-user/pyenv/lib/python3.9/site-packages/aqt/main.py", line 1447, in onRefreshTimer
    self.deckBrowser.refresh()
  File "/home/anki-user/pyenv/lib/python3.9/site-packages/aqt/deckbrowser.py", line 76, in refresh
    self._renderPage()
  File "/home/anki-user/pyenv/lib/python3.9/site-packages/aqt/deckbrowser.py", line 144, in _renderPage
    self._dueTree = self.mw.col.sched.deck_due_tree()
  File "/home/anki-user/pyenv/lib/python3.9/site-packages/anki/scheduler/base.py", line 58, in deck_due_tree
    tree = self.col._backend.deck_tree(now=int_time())
  File "/home/anki-user/pyenv/lib/python3.9/site-packages/anki/_backend_generated.py", line 377, in deck_tree
    raw_bytes = self._run_command(1, 4, message.SerializeToString())
  File "/home/anki-user/pyenv/lib/python3.9/site-packages/anki/_backend.py", line 156, in _run_command
    raise backend_exception_to_pylib(err)
anki.errors.DBError: DbError { info: "SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some(\"database disk image is malformed\"))", kind: Other }

This and a popup saying the database disk image is malformed kept popping up so I’m guessing it tried numerous times to make a backup. My user is indeed named “anki-user”. My OS is Debian 11.6 running in a PRoot environment in Termux on Android. I installed Anki from pip. I’m guessing at some point it ran out of memory or android went to sleep/entered power saving and Anki tried to make backups but couldn’t.

I’m not worried about data loss though because I have a backup from changes I made last night, so there’s no real issue. Just thought I’d report it.

Is it reproducible?

Do you want me to try leaving Anki open overnight again?

Yes, please retrace your steps and see if it happens again.

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