Cannot empty Trash [Report ID: 531678683]
There are many child items in my trash folder. I try to delete them all my Ctrl-A and then select delete. Try empty trash. No response. Then if I try delete it one by one, it kept having this error and requires me to quit and restart zotero.
Thanks for your help in following up.
Thanks for your help in following up.
You can try to fix the damage with the DB Repair Tool, or, if this was in cloud storage or have a local backup, you can restore from an earlier version of zotero.sqlite. If that doesn't work, and your data is all online, you can just delete the zotero.sqlite file (or move it somewhere temporarily for backup) with Zotero closed and then reopen Zotero and sync to pull down your library.
As my database exceed db repair tool, i followed the instructions on https://forums.zotero.org/discussion/2607/
I got a zotero.repaired.sqlite but it is 0KB. My original size is 144,672KB... :( so it doesn't work. It has the following error messages:
Error: near line 207923: UNIQUE constraint failed: fulltextWords.wordID
Error: near line 207924: UNIQUE constraint failed: fulltextWords.wordID
.... (repeat for a few extra time)
Error: near line 210038: UNIQUE constraint failed: fulltextWords.word
Error: near line 210514: UNIQUE constraint failed: fulltextWords.word
I don't have a back up of the file because this trash problem was developed long time ago I believed. I just never attempt to empty trash before....
Make a backup of your database before trying that.
If you're not successful with that, we might be able to increase the limit on the online repair tool.
Error: Error(s) encountered during statement execution: database disk image is malformed [QUERY: DELETE FROM fulltextItemWords] [PARAMS: ] [ERROR: database disk image is malformed]
When the .dump command encounters corruption (which I think in this case is caused by multiple rows with the same wordID, the integer primary key for the fulltextWords table - the result of the full-text index), it adds a ROLLBACK command. (It also apparently stops partway through, I only got 240 MB out in dump.sql). So when you run the dump.sql commands, it interprets all the commands, but then rolls back the zotero.sqlite database to a 0 byte file.
Instead of .dump, use .recover (introduced in sqlite 3.29.0). This does not insert a rollback command, and also gave me a bigger (444 MB) dump.sql. https://www.sqlite.org/cli.html#recover_data_from_a_corrupted_database
The commands are then:
sqlite3 zotero.sqlite .recover > dump.sql
mv zotero.sqlite zotero.sqlite.old
sqlite3 zotero.sqlite < dump.sql
This fixed the corrupted Zotero database. Now back to writing.