Zotero 9. No longer able to open database ("Loading items...")
Hi,
I was upgraded to Zotero 9 and can no longer access my data. I waiting at "loading items" for 10-15 minutes. I restarted in troubleshooting mode. waited. I restarted in troubleshooting mode with logging enabled, waited. I downloaded and installed the latest version, just in case... repeated the above processes.
It has been a couple hours now without access to my data, which is a little frustrating given that I have deadlines approaching.
here is the debug ID. D1768391229
From looking at the logs it doesn't seem like there is a migration going on, or anything that should take a particularly long time.
thanks.
I was upgraded to Zotero 9 and can no longer access my data. I waiting at "loading items" for 10-15 minutes. I restarted in troubleshooting mode. waited. I restarted in troubleshooting mode with logging enabled, waited. I downloaded and installed the latest version, just in case... repeated the above processes.
It has been a couple hours now without access to my data, which is a little frustrating given that I have deadlines approaching.
here is the debug ID. D1768391229
From looking at the logs it doesn't seem like there is a migration going on, or anything that should take a particularly long time.
thanks.
Upgrade Storage
Thanks for the prompt reply. I have run the integrity check, it says that the database is corrupt and Zotero can attempt to repair it. I asked it to do that... button greys out for a while. Then it comes back, but Zotero doesn't automatically restart (I thought it would?). I run the check again, same thing. I restart Zotero, run check again, and... same thing.
The "loading items" issue is, of course, still there. How do I fix the database?
thanks,
We'll fix the startup hang, but for now, you can go to Tools → Developer → Run JavaScript and run this to fix your database:
await Zotero.DB.queryAsync("DELETE FROM items WHERE itemTypeID=(SELECT itemTypeID FROM itemTypes WHERE typeName='annotation') AND itemID NOT IN (SELECT itemID FROM itemAnnotations)");Then restart Zotero.
Thanks, it was the db integrity. I had Claude Code examine a copy of the database and there were a number of internal inconsistencies. Most stemmed from a sync that seems to have failed partway through, created a load of entries but never populated them.
Claude deleted the items (15 of them) and now Zotero works fine.
Thanks for the help.
I created a backup, and then had claude work on a copy. I reviewed the commands before running them, and they seemed fine. If they caused a problem, I could simply revert to the backup.
On the issue causing the problem re: not loading.
Claude: "The problem is logical/referential inconsistency: 15 rows in the items table are typed as annotations (itemTypeID = 1) but have no matching row in itemAnnotations"
-- BACKUP FIRST: cp zotero.sqlite zotero.sqlite.bak
BEGIN;
DELETE FROM items
WHERE itemTypeID = 1
AND itemID NOT IN (SELECT itemID FROM itemAnnotations);
-- verify: should be 15
SELECT changes();
COMMIT;
Second problem:
Claude: "PRAGMA foreign_key_check reports pre-existing inconsistencies that are not caused by this fix — 6 rows in itemRelations referencing missing items (774, 782, 827, 866, 876, 992), 1 row in deletedItems (1958), and a large number of rows in fulltextItemWords."
The issue here is that, I did attempt the "fix database" route, but I didn't restart zotero and check to see if the error remained.
Instead I had claude fix the db, then shutdown zotero and installed the fixed one, and reran the check and it passed.
I have a backup of the broken foreign key version, I can install that, do the check, restart and do the check again. But since it was just an FK issue I assume it would be covered by the existing code.
thanks.