Trying to import a deck results in 500: dB Error

(copy from reddit[dot]com/r/Anki/s/zcpoqjmXHK )

Trying to import a deck results in the error seen below. I’ve moved the full file tree around a few times, trying to rehome it to an SD card and being limited by when my phone decided to abort the process. Especially collection.media was aborted and restarted several times.

I did not have the error code problem before. I am also currently unable to fully sync the media (telling me “media sync aborted” after a short while). Card progress syncs fine.

I did a database check, resulting in no issues. I can add cards manually.

What does that tell me? How can I approach the issue? If you need more information, I’ll be happy to supply.

The full error:

500: DbError { info: “SqliteFailure(Error { code: DatabaseCorrupt, extended\_code: 11 }, Some(\\“database disk image is malformed\\”))”, kind: Other }


I did find this SD card workaround and issue linked on github[dot]com/ankidroid/Anki-Android/wiki/FAQ#my-ankidroid-files-are-stored-on-a-sd-card-how-can-i-point-ankidroid-to-them, but the linked posts are from 2017 and 2015 respectively, so I reckon they don’t apply.

AnkiDroid Version = 2.25.1 (0c0a878221806c44f72e5d0259b290028661b567)

Backend Version = 0.1.68-anki26.05 (26.05 e64c6b1aee3e8d668fb8bbe084beada8e070d985)

Android Version = 11 (SDK 30)

ProductFlavor = full

Device Info = Xiaomi | Redmi | curtana | curtana\_eea | Redmi Note 9S | qcom

WebView Info = \[com.google.android.webview | 805904303\]: Mozilla/5.0 (Linux; Android 11; Redmi Note 9S Build/RKQ1.200826.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/155.0.8059.43 Mobile Safari/537.36

ACRA UUID = 9cf19625-3dd9-4ba0-bf09-f4f06d53e1be

FSRS = 5.2.0 (Enabled: true)

Crash Reports Enabled = true

Update: I can add new notes types and “fully” sync from local. I also can technically add cards manually, but I can’t add a picture to them. Trying that results in “Collection not opened”. My card collection then does show a corrupted database, but switching from Card Browser to Decks back to Card Browser seemingly solves that. I can then access my cards again.

That seems like the cause of the issue, doesn’t it? I’m not sure quite what you were moving and why, but the easiest way to move your collection (since you’re using the non-Play-Store version) is to sync with AnkiWeb first – then point the app at the new location you want to use on your device, and download your completed collection from AnkiWeb. [You can clean up the files at the old location to save space.]

If everything you need is synced to AnkiWeb already, have you considered that you might need to delete your current data/database (wherever it is located), and start fresh? That’s generally easier than trying to repair corruption in a database.

Since media was the issue, clean up your unused media first – 3-dots menu > Check > Check media > Delete Unused Media – and sync to get that off the server, so you won’t have to redownload anything unnecessary.

If you just post the complete url in a codeblock, it’s easier for folks to copy-paste it. [When you do that, I can also help by editing it back into a link for you.]

Thank you so much! That did the trick. Way more straightforward than my approach :slight_smile: Will think of the codeblock next time I’ll post something.