ERROR. Database Corrupt. "database disk image is malformed\"

When app’s syncing I have this message:

DbError { info: “SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some("database disk image is malformed"))”, kind: Other }

But it’s not all problems that I have !!

  1. Yes, I left my computer with open Anki app for hours (I slept).
  2. The computer crashed, so I can’t fix Anki through my PC.
  3. I uninstalled Anki from computer when I tried to fix it.
  4. The app works well on Android phone.

Leaving your computer on and Anki open isn’t ordinarily a problem, but it looks like it was here, due to the computer crashing. Best practice is to make sure that you always sync your device to AnkiWeb when you open the app AND when you close/leave the app, on every device, every time.

That removed the program files for Anki, but all of your data – including your corrupt database – is still on your PC. You’ll need to reinstall Anki to take care of this, but while you’re figuring this out, it’s important that you not sync either of your devices.

On Android – put your device in airplane mode, open AnkiDroid, go to Settings > Sync, and turn off automatic sync.

On your PC – Download the Anki installer (from https://apps.ankiweb.net/), and then disconnect from the internet until you’re ready to sync.

The best way to recover from this is to restore an automatic backup – from before the corruption. If you go back too far, you might lose data (edits, updates, review history, etc.), so you want to choose the closest one to when you finished studying/went to sleep.

  • Get Anki installed on your PC again.
  • File > Switch Profile > select your existing profile if you aren’t already on it > Open.
  • Before you start on restoring the backup, try dae’s suggestion –
  • File > Switch Profile > Open Backup…
  • Select the most recent version that is definitely before the crash corruption.
  • Once that is restored, Tools > Check Database.
  • Tools > Preferences > Syncing > on next sync, force changes in one direction.
  • Then you can connect to the internet again, sync to AnkiWeb, and choose UPLOAD TO AnkiWeb.
  • Once that’s successful, you can take your AnkiDroid off airplane mode and sync it too – choose DOWNLOAD FROM AnkiWeb.

If you’re able to open your profile, and tools>check database does not report any problems, logging out in the sync preferences screen may help.

1 Like

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