Can't add, delete or edit items

I can't add, delete or edit items in Zotero 1.0.10 (FF 3.0.11), although I have full access to view them.

Somehow I have ended up with a bunch of attachments (20) without items at the bottom of My Library. When I start Zotero, the Error console shows 19 errors like this:
Error: itemData row references nonexistent item 10322
Source File: chrome://zotero/content/xpcom/data_access.js
Line: 2881

When I then try to add a new item, the following:
Error: uncaught exception: [Exception... "Component returned failure code: 0x8052000e (NS_ERROR_FILE_IS_LOCKED) [mozIStorageConnection.commitTransaction]" nsresult: "0x8052000e (NS_ERROR_FILE_IS_LOCKED)" location: "JS frame :: chrome://zotero/content/xpcom/db.js :: anonymous :: line 321" data: no] [ERROR: database is locked]

When I then try to delete an item (one of the attachments without items listed above), I get:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.beginTransaction]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://zotero/content/xpcom/db.js :: anonymous :: line 295" data: no]

Any suggestions would be welcome.
  • NS_ERROR_FILE_IS_LOCKED
    First things first, something else is preventing write access to your SQLite database. Restart your computer and try again.
  • This problem has been happening for a while now. Restarting the computer makes no difference. The database is on a network server. Is that a problem?
  • Things have gone from bad to worse now.

    This morning there was a forced shutdown of Firefox by my AVG anti-virus. When I restarted Firefox, the Zotero icon has a yellow triangle with "!", and when I hover over the icon it says "There was an error starting Zotero". The error console gave me the following:
    Error: [Exception... "Component returned failure code: 0x8052000e (NS_ERROR_FILE_IS_LOCKED) [mozIStorageService.openDatabase]" nsresult: "0x8052000e (NS_ERROR_FILE_IS_LOCKED)" location: "JS frame :: chrome://zotero/content/xpcom/db.js :: anonymous :: line 807" data: no]
    Source File: chrome://zotero/content/xpcom/zotero.js
    Line: 230

    I have tried uninstalling and reinstalling Zotero without success.
  • The database is on a network server. Is that a problem?
    Yes. Particularly if another client or a program on the server is accessing it. Do multiple copies of firefox use this database? Could one be open elsewhere? Any reason for storing it on a server?
    Things have gone from bad to worse now.
    It is not obvious to me that is the case; you have the same problem of the database being locked that you've always had.
  • Yes, multiple copies of firefox use the database. That is the reason it is on the server - it is a shared library. We enable Zotero on only one PC at a time to prevent conflicts, but there is a chance of accidental dual access. But I am 100% certain no other PCs have Zotero enabled now.

    Yes, things are definitely worse. Previously Zotero would run but I couldn't change anything, now it won't run, so I can't view items either.
  • We enable Zotero on only one PC at a time to prevent conflicts, but there is a chance of accidental dual access.
    If that happens, there's a decent chance you'd corrupt your database.
    Yes, multiple copies of firefox use the database. That is the reason it is on the server - it is a shared library.
    Syncing and group support in Zotero 2.0 is designed for this purpose.

    Close Firefox, make a backup of everything, and check for a zotero.sqlite-journal file in the data directory. If it's there, delete it.
  • OK, I did that. Now I can view items again. When I try to add an item, I get an hourglass for maybe 30s, but no new item. Previously there was no hourglass.

    I suppose I need to uncorrupt my database and then start using v2. Is there a recommended way to do this? Should I try exporting the database, then importing to a new location?
  • edited June 17, 2009
    I suppose I need to uncorrupt my database and then start using v2. Is there a recommended way to do this?
    Use "Check Database Integrity" in the Advanced pane of the Zotero prefs. If it finds an error, use the DB Repair Tool. But that might not be the problem.

    You could try changing your data directory location (also in the Advanced pane of the Zotero prefs) to somewhere else on the network drive and testing with a fresh library.

    But I would recommend just copying your Zotero data directory to a local drive, repairing it if necessary, and using off a local drive with 2.0.
  • I had the same problem as pressureman but was able to repair it using this advice. When I went back to install Zotero 2.0, it automatically saved to the shared drive. I now have a shared library with collective resources. This is fine for me, but I'm wondering if it's ok for Zotero. Will the files become corrupt again, or was this only a problem with 1.0? Do I have to move my data directory to a local drive or is it safe where it is?
  • asbake: We don't test with network drives, there's tremendous variety in network setups, and I couldn't really tell you one way or another whether it's safe. Note that pressureman's issue may have been from multiple instances of Firefox using the same file on the network drive.

    If you have a choice, I'd recommend a local drive. If you want to continue using a network drive from one open Firefox instance at a time, I'd recommend frequent backups and regular checking via "Check Database Integrity" in the Advanced pane of the Zotero prefs to make sure it's working properly.
  • The DB repair tools worked and I can now manage the library properly. The DB is on my local drive, so my colleagues don't have access right now. I haven't got around to installing v2 yet, but will do this soon. Thanks for your help.
Sign In or Register to comment.