This error has been cropping up based on other threads for several years now, through various versions of Calibre. It's a great program, but this bug really cripples it use.
I've been trying various suggestions, including exporting the library and reimporting it to a different local drive. My library passes all the check library tests. I can add and edit books, but I cannot delete some books. There's a serious bug in Calibre somewhere. I don't know if it's specific to Windows, but I could test this on Linux if needed.
Here's the error message:
Spoiler:
calibre, version 7.8.0
ERROR: Unhandled exception: <b>SQLError</b>:SQLError: no such savepoint: _apsw-0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "calibre\gui2\actions\delete.py", line 459, in delete_books
File "calibre\gui2\actions\delete.py", line 436, in do_library_delete
File "calibre\gui2\library\models.py", line 459, in delete_books_by_id
File "calibre\db\cache.py", line 86, in call_func_with_lock
File "calibre\db\cache.py", line 2220, in remove_books
File "calibre\db\backend.py", line 2292, in remove_books
File "calibre\db\backend.py", line 1158, in executemany
apsw.SQLError: SQLError: no such savepoint: _apsw-0