Cannot drag images or import apkg files anymore

Hello to everyone!

I have a macOS High Sierra version 10.13.6 (Intel Core i5).

And I have always had problems with my Anki app. It shuts down my computer completely every couple of weeks especially when I am listening to music on iTunes at the same time or when I have “too many” apps opened (Anki, Firefox and OpenOffice seem to be already a lot…).

That being said, I got a much bigger problem today with my Anki app. I was draging an image (gif format) to add a new flashcard when everything shut down (as usual). But when I started the computer again, Anki would not work anymore.

I cannot drag an image like before. It gives me the error message copied at the bottom of my post.

And I cannot import any of the apkg files that I had previously exported on my computer. I saved 7 different ones and none of them work. When I try to import, it gives me the following message:

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

Then, if I click OK, I have a window “Import Log…” that endlessly says “Extracting data…”. I let it extract up to two hours… in vain.

I was using anki-2.1.65-mac-intel-qt5 when the big problem occurred. I noticed that it was not the latest version. So I installed anki-2.1.66-mac-intel-qt5.

Of course, I tried restarting my computer and restarting Anki. But it did not change anything.

Also I got the message to go in Tools>Check Database
So I did. The database was “rebuilt and optimized”.

But when I click on Tools>Check Media, I get the following error message (the same one I get when I try to drag an image to add a new flashcard):

Anki 2.1.66 (70506aeb) Python 3.9.15 Qt 5.14.2 PyQt 5.14.1
Platform: macOS-10.13.6-x86_64-i386-64bit
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2023-10-07 21:25:20

Caught exception:
Traceback (most recent call last):
File “aqt.taskman”, line 122, in _on_closures_pending
File “aqt.taskman”, line 71, in
File “aqt.mediacheck”, line 102, in _on_finished
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.mediacheck”, line 91, in _check
File “”, line 177, in check
File “anki._backend_generated”, line 1708, in check_media
File “anki._backend”, line 151, in _run_command
anki.errors.DBError: DbError { info: “SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some("database disk image is malformed"))”, kind: Other }

Is there anything else I could try to fix that problem?

I use my Anki app everyday to work on my Japanese characters and vocabulary. And I do not want to stay long without it… By the way, I use Anki on my desktop because the Web version do not allow us to import images.

Thanks for your time, your help and any suggestions!

I partly found a way to avoid the problem.

What bothered me is that I could not uninstall Anki and start again from scratch. It would automatically reset my older profile, my older decks the way they were and my older bug.

So I got an idea: I clicked on “Switch Profile” and created a new one. Miracle! On a new profile, I am able to import all my apkg files (nothing lost!), drag images like before and add new flashcards!

I also checked the database and the media and I no longer have the error messages I had on the previous profile.

My new problem is that… all my flashcards (nearly a thousand) are “New”! Is there a way to change that? How can I add my daily new flashcards without going through all the flashcards added over the past months?


Your database appears to be corrupt. You can try restoring from a backup: Backups - Anki Manual

By the looks of it, it’s your media DB that is the problem. You should be able to fix it by logging out in the preferences screen and then logging back in again, when using your original profile.

Thank you Abdo and Dae for your responses! It helped and I really appreciate it.

With my new profile and my thousand of flashcards that were “New”, I was at a loss.

My Anki Desktop is not syncronized to the Anki Web account. So I could not log out and log back in again as you suggested Dae.

But I did restore from a backup though and found my old profile with the right number of due cards!

Dragging images and importing apkg files work fine again!

Thank you very much!

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