I'm also getting the error when trying to vacuum notes.
Code:
calibre, version 6.99.0
ERROR: Failed: Database integrity check failed, click "Show details" for details.
Traceback (most recent call last):
File "calibre\gui2\dialogs\check_library.py", line 95, in vacuum
File "calibre\db\cache.py", line 88, in call_func_with_lock
File "calibre\db\cache.py", line 2780, in vacuum
File "calibre\db\backend.py", line 1412, in vacuum
TypeError: Notes.vacuum() missing 1 required positional argument: 'conn'