Check your database integrity from the Advanced → Files and Folders section of the Zotero preferences. If that passes without errors, can you upload your database to the DB Repair Tool and provide the Upload ID it gives you? You can ignore the download links the tool provides, but that will let us run some tests on your database to see why this is happening and give you a command to fix it.
OK, thanks. It looks like you somehow ended up with a few attachments with broken, empty annotation items, all created at the same time on October 4th. Do you have any recollection of how that could've happened?
You can paste 3FLKWC23, W8SVMM2R, and CXCPWCXN into the Zotero search bar in All Fields & Tags mode to find the affected attachments. Do you remember how you added those to Zotero or have any idea where their annotations would've come from? Anything you can remember would be helpful.
In any case, running this in Tools → Run JavaScript and then restarting Zotero should fix the problem:
await Zotero.DB.queryAsync("DELETE FROM items WHERE itemTypeID IN (SELECT itemTypeID FROM itemTypes WHERE typeName='annotation') AND itemID NOT IN (SELECT itemID FROM itemAnnotations)")
I'm afraid your local database is too corrupted to use. You'll need to close Zotero, delete zotero.sqlite in your Zotero data directory, and sync to download your data from the online library.
If there's data that hasn't yet synced to the online library, you'll need to export those items to Zotero RDF and import it back in after syncing. If you have PDF annotations that haven't synced, you should export those PDFs with the annotations embedded and then import those back in afterward.
You can paste 3FLKWC23, W8SVMM2R, and CXCPWCXN into the Zotero search bar in All Fields & Tags mode to find the affected attachments. Do you remember how you added those to Zotero or have any idea where their annotations would've come from? Anything you can remember would be helpful.
In any case, running this in Tools → Run JavaScript and then restarting Zotero should fix the problem:
await Zotero.DB.queryAsync("DELETE FROM items WHERE itemTypeID IN (SELECT itemTypeID FROM itemTypes WHERE typeName='annotation') AND itemID NOT IN (SELECT itemID FROM itemAnnotations)")
still false
In that day, I changed the local save location.Maybe this operation produced these things.
Change where the data is stored.
I'm afraid your local database is too corrupted to use. You'll need to close Zotero, delete zotero.sqlite in your Zotero data directory, and sync to download your data from the online library.
If there's data that hasn't yet synced to the online library, you'll need to export those items to Zotero RDF and import it back in after syncing. If you have PDF annotations that haven't synced, you should export those PDFs with the annotations embedded and then import those back in afterward.