Please help: Corrupt Anki Files

Hi there,

I have recently encountered a problem with my Anki Decks. This afternoon, on my MacBook, my Anki suddenly froze so I restarted my computer. Now, when I open my Anki, the following error messages show.

My decks are up to date and work perfectly fine on my phone and iPad, so I have exported my decks to iPad just in case I were to lose everything. It’s just my MMI on my MacBook that is the issue.

Please help me, I do not know what to do. I have tried restarting my computer, deleting and reinstalling Anki from my computer, holding shift when opening Anki and nothing works. I can’t even switch profile to make a new one without the “your collection file appears to be corrupt” message showing.

Thank you very much

Edit. Anki on my MacBook showed this message and asks me to copy and paste it onto the support site. If I’m supposed to post it somewhere else please let me know.

Anki 2.1.55 (01caec2a) Python 3.9.15 Qt 6.3.2 PyQt 6.3.1
Platform: macOS-12.0.1-x86_64-i386-64bit
Flags: frz=True ao=False sv=3
Add-ons, last update check: 2022-12-17 10:39:38

Traceback (most recent call last):
File “aqt.main”, line 586, in loadCollection
File “aqt.main”, line 688, in moveToState
File “aqt.main”, line 694, in _deckBrowserState
File “aqt.deckbrowser”, line 69, in show
File “aqt.deckbrowser”, line 143, in _renderPage
File “anki.scheduler.base”, line 58, in deck_due_tree
File “anki._backend_generated”, line 377, in deck_tree
File “anki._backend”, line 148, in _run_command
anki.errors.DBError: DbError { info: “SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some("database disk image is malformed"))”, kind: Other }



Anki keeps backups. Try to restore a recent one: Backups - Anki Manual

I’ve tried. Unfortunately it doesn’t work. I can’t even switch profile after reinstalling Anki. This shows up

When I try to reproduce the problem, Anki displays the error and then opens the profile selection screen. If I then click on “Open Backup” and choose a valid backup, it opens the collection correctly. Have you tried opening an older backup?

If you remain stuck there, you could try manually renaming your collection file, which will cause Anki to treat your collection as new. You can then try importing the backup via file>import.

https://docs.ankiweb.net/files.html#file-locations

I have tried that and unfortunately both options do not work.

Anki works perfectly find on my iPhone 14 Plus and iPad Pro 2018. I exported my Anki from my phone, Air Dropped it to my MacBook and tired to manually import it. Unfortunately it does not work.

The reason why I am mentioning the models of the devices is that my MacBook is the 2015 model so it is quite old and I am planning to upgrade sometime this year could that be why the MacBook version of Anki does not work?

Also I downloaded Anki on my Dad’s M1 MacBook Air and imported my decks there. Works perfectly fine

If you rename your profile’s collection.anki2 file and start Anki, does it open successfully to an empty profile? If so, you should be able to sync and choose “download” to grab your collection from AnkiWeb.

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