Deleting anki-error for macbook

I was trying to delete anki to get the latest version, but when I tried, it gave me an error saying (An error occurred. Please use Tools > Check Database to see if that fixes the problem.)

It also asked me to copy and paste the information below.

An error occurred. Please use Tools > Check Database to see if that fixes the problem.
If problems persist, please report the problem on our support site. Please copy and paste the information below into your report.
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=False sv=?
Add-ons, last update check: 2022-01-04 00:17:53

Caught exception:
Traceback (most recent call last):
File “aqt/”, line 1069, in closeEvent
File “aqt/”, line 463, in unloadProfileAndExit
File “aqt/”, line 440, in unloadProfile
File “aqt/”, line 550, in unloadCollection
File “aqt/”, line 856, in closeAllWindows
File “aqt/”, line 130, in closeAll
File “aqt/”, line 548, in before_sync
File “aqt/”, line 978, in maybe_auto_sync_on_open_close
File “aqt/”, line 544, in after_sync
File “aqt/”, line 123, in show_diag_until_finished
File “aqt/”, line 541, in after_media_sync
File “aqt/”, line 436, in callback
File “aqt/”, line 445, in _unloadProfile
File “aqt/”, line 218, in save
File “anki/”, line 47, in execute
sqlite3.OperationalError: attempt to write a readonly database

It seems that the database file only has readonly permission.
Try going in the directory of the database, and doing executing ls -l to ensure if this is true.
It’s weird that it even worked before you tried to remove anki. Does it work otherwise (writing to the database should happen quite often, not only when you try to delete Anki)?
This can be caused by several factors, among which:

  • you have accidentally manually changed that file permissions
  • some program has done this for you (maybe MacOS?)
  • your hard disk is starting to die, and thus your OS prevents you to write to it to extend its lifespan to allow you to make a backup

Anyways, if you only want to delete Anki, you just can just remove it by hand (warning: be sure you know what you are doing and have a backup before you screw up your data).

1 Like