Sync Error "Item collection 462 not found"
Dear Zotero community,
the Zotero library on my desktop does not synchronize any more with my Zotero online storage. I constantly get the following error message upon synchronising my database (ID: 1396855052):
[JavaScript Error: "Item collection 462 not found" {file: "chrome://zotero/content/xpcom/data/item.js" line: 4482}]
[JavaScript Error: "Item collection 462 not found" {file: "chrome://zotero/content/xpcom/data/item.js" line: 4482}]
[JavaScript Error: "Item collection 462 not found" {file: "chrome://zotero/content/xpcom/data/item.js" line: 4482}]
[JavaScript Error: "Item collection 462 not found" {file: "chrome://zotero/content/xpcom/data/item.js" line: 4482}]
version => 5.0.82, platform => Win32, oscpu => Windows NT 10.0; WOW64, locale => de, appName => Zotero, appVersion => 5.0.82, extensions => Zutilo Dienstprogramm für Zotero (2.0.4, extension), Zotero Scholar Citations (1.9.3, extension), Zotero Storage Scanner (5.0.8, extension), Zotero LibreOffice Integration (5.0.21.SA.5.0.82, extension), Zotero Word for Windows Integration (5.0.14.SA.5.0.82, extension), ZotFile (5.0.16, extension), Shockwave Flash (32.0.0.223, plugin)
I have tried to solve this problem by myself unsuccessfully. Restarting Zotero does not help. I also tried to uninstall Zotero from my Computer and reinstall it (using the zotero.sqlite file). The error persists. I have also checked for database integrity (which seems to be fine). Otherwise, my Zotero is working perfectly. Just the syncing does not work.
I will very much appreciate your help!
the Zotero library on my desktop does not synchronize any more with my Zotero online storage. I constantly get the following error message upon synchronising my database (ID: 1396855052):
[JavaScript Error: "Item collection 462 not found" {file: "chrome://zotero/content/xpcom/data/item.js" line: 4482}]
[JavaScript Error: "Item collection 462 not found" {file: "chrome://zotero/content/xpcom/data/item.js" line: 4482}]
[JavaScript Error: "Item collection 462 not found" {file: "chrome://zotero/content/xpcom/data/item.js" line: 4482}]
[JavaScript Error: "Item collection 462 not found" {file: "chrome://zotero/content/xpcom/data/item.js" line: 4482}]
version => 5.0.82, platform => Win32, oscpu => Windows NT 10.0; WOW64, locale => de, appName => Zotero, appVersion => 5.0.82, extensions => Zutilo Dienstprogramm für Zotero (2.0.4, extension), Zotero Scholar Citations (1.9.3, extension), Zotero Storage Scanner (5.0.8, extension), Zotero LibreOffice Integration (5.0.21.SA.5.0.82, extension), Zotero Word for Windows Integration (5.0.14.SA.5.0.82, extension), ZotFile (5.0.16, extension), Shockwave Flash (32.0.0.223, plugin)
I have tried to solve this problem by myself unsuccessfully. Restarting Zotero does not help. I also tried to uninstall Zotero from my Computer and reinstall it (using the zotero.sqlite file). The error persists. I have also checked for database integrity (which seems to be fine). Otherwise, my Zotero is working perfectly. Just the syncing does not work.
I will very much appreciate your help!
You're saying you've checked database integrity from the Advanced → Files and Folders pane of the Zotero preferences and it said no errors were found? Because this error would definitely occur from a particular kind of DB corruption that that check should be able to detect and correct.
If you run that again and it doesn't find any errors, can you go to Tools → Developer → Run JavaScript and paste in the following code, and let me know the result?
return [
await Zotero.DB.valueQueryAsync("SELECT key FROM collections WHERE collectionID=462"),
await Zotero.DB.columnQueryAsync("SELECT key FROM items WHERE itemID IN (SELECT itemID FROM collectionItems WHERE collectionID=462)")
];
I ran your JavaScript with the following result:
[
"0": false
"1": [
"0": "BN5BZRIH"
"1": "F6BV9Z22"
"2": "5ARGNU45"
"3": "8FE97D53"
"4": "ZQRX2KQJ"
"5": "LXEGUDK6"
"6": "HSWGMK6G"
"7": "YMC8ULWN"
"8": "WXBLQBG4"
]
]
What do you think?
Basically, your database somehow has nine items that are listed as being in a collection that doesn't exist, and the checks in the database that are supposed to make sure that doesn't happen, and to correct it if it does, don't seem to be in place.
Could you run this in the Run JavaScript window and let me know the result?
return await Zotero.DB.valueQueryAsync("SELECT sql FROM sqlite_master WHERE type='table' AND name='collectionItems'");
CREATE TABLE collectionItems (
collectionID INT NOT NULL,
itemID INT NOT NULL,
orderIndex INT NOT NULL DEFAULT 0,
PRIMARY KEY (collectionID, itemID),
FOREIGN KEY (collectionID) REFERENCES collections(collectionID) ON DELETE CASCADE,
FOREIGN KEY (itemID) REFERENCES items(itemID) ON DELETE CASCADE
)
What do you think?
If your database is small enough and you don't mind, you can try uploading it to the DB Repair Tool and swapping in the rebuilt database to see if that fixes the problem. If it doesn't, if you let us know the Upload ID from the repair tool, we can run some tests on the file to see what's going on.
Alternatively, you can simply run this command to delete the invalid collection-item associations, and then restart Zotero, but I couldn't guarantee that this wouldn't somehow happen again:
return await Zotero.DB.valueQueryAsync("DELETE FROM collectionItems WHERE collectionID=462");