Tags remain in the database after items are deleted

Not exactly sure what triggered the database "corruption", so here goes the whole story.

Using Zotero standalone (I was also using 3.0b3.2... it's on our lab computer. I didn't realize it was out of date)

I was toying around with transferring an EndNote library to Zotero using BibTeX and RIS and ended up importing a single library several times (ended up with like 5000 items, which shouldn't have been a problem, though I could tell it was pretty sluggish).

My first few imports added really long Tags, which I then eliminated in my RIS file and did another import. This time none of the items had tags.

I was then trying to delete all of the old imports with the large tags (around 4000), which caused Zotero to freeze up and I wasn't patient enough so I closed it. The items were deleted, however, when I re-opened Zotero. At this point only items without tags were left in the library.

I ended up checking for database corruption, but it didn't find anything wrong the first time. I then tried syncing the library with zotero's servers, which gave me a message saying that my tags were too long. I chose to delete the tag, but the same message popped up with the same exact tag. Chose to delete it about 10 more times, but it kept popping up.

Did another check for database integrity and this time it said that my DB was corrupt. So I used the online tool to fix the DB (Upload ID 4f7a6ff20d378) and replaced my old one with the fixed version. At this point, the items were still without tags.

When attempting to sync again with the server, I got the same exact message about tags being too large.

So I turned on debugging for the sync process (actually Restore to Zotero Server) and generated a pretty large report (Debug ID D606420930), but if you look towards the bottom, you can see that there's a whole list of long tags, though I don't think they are associated with any of the items.

I guess what I'm getting at is that I think the database check/repair tool should probably pick up on the ghosting tags and delete them.

Right now I don't see any way to delete these tags, so I can't sync. I think my only options at this point are to either edit the sqlite db or to just delete the DB and redo my last import, which will be much easier. But I'll wait before I do the latter in case you want me to do some debugging.

Upload ID 4f7a6ff20d378
Debug ID D606420930

EDIT: oh, and after the repair, the Database Integrity Check does not detect any corruption.
  • Delete a tag in the tag selector, restart Standalone, try again.
  • You're talking about the tags list on the bottom left, right?

    "No tags to display" even though I'm in a collection where all the items are. This kinda makes sense, since that list only displays tags associated with items in the current view.
  • I just mean delete any tag. Go to the library root (and/or create a new tag) if you need to.
  • edited April 3, 2012
    That did not fix it.

    EDIT: There are no tags displayed in library root either, but I did create and delete tags a couple tags and then restarted Zotero. Ghost tags still remain. At this point Zotero is up to date, btw.
  • 1) Have you emptied the trash?

    2) Assuming you have, set extensions.zotero.purge.tags to true in about:config (accessible from the Advanced pane of the prefs) and then sync, and provide a Debug ID for that sync attempt?
  • 1) Trash was empty

    2) Debug ID D1403778640
  • That was the first sync with purge.tags set to true? Doesn't look like it.
  • Ah, sorry, that was my bad. It was not really a sync. I was doing a reset to Zotero server, but I see now what those hidden options are supposed to do.

    I redid this with a proper sync and it cleared the ghost tags. (If you still want to see it, the Debug ID is D2070639488)

    That's great that there's a way to fix this corruption. Would you consider implementing detection/repair of this in the Database checker?
  • This wasn't corruption. The purge.tags flag gets set when you delete a tag or remove an item from a tag, and when it's set orphaned tags are automatically purged when you sync—you just weren't doing that. (They're also supposed to be purged when open the Zotero pane, though it's possible that only happens currently in Zotero for Firefox.)
  • and when it's set orphaned tags are automatically purged when you sync—you just weren't doing that.
    Well, yes and no. I didn't do a proper sync for debug id D1403778640, but I was doing sync previously after adding and deleting tags. Is there a way to get the old DB back from that upload id I posted? Upload ID 4f7a6ff20d378
  • Yes, but all it would show would be some orphaned long tags, which you could recreate yourself if you wanted to test something.
  • How may I recreate the orphaned tags?
  • edited April 4, 2012
    What are you trying to accomplish here? Do you need the original tags, or are you just trying to test something? You create a long tag the way you create any tag—the length limitation is on the server side.
  • edited April 4, 2012
    I'm trying to figure out why adding and removing a tag on an item did not purge the orphaned tags after:

    A) restarting Zotero

    and

    B) performing a sync (I didn't do a reset that time, I did a sync)

    I think I may know why, but I just want to make sure.

    EDIT: I can create the tags just fine, I just can't get them to remain orphaned.
Sign In or Register to comment.