Error starting when storage is on USB thumb drive

I recently started having a problem with my Zotero 1.0.7 install on Firefox 3.0.1 on MacOSX 10.4.11. This combination previously worked, but stopped working a few days ago. I don't recall that I changed anything, but I'm not discounting it!

When I start Zotero using my Profiles directory, everything works. But when I use the custom location "/Volumes/NEW VOLUME/Documents/zotero", it fails with these errors:

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 799" data: no]
Source File: chrome://zotero/content/xpcom/zotero.js
Line: 220

Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebNavigation.sessionHistory]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/browser.xml :: :: line 644" data: no]
Source File: chrome://global/content/bindings/browser.xml
Line: 650

Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebNavigation.sessionHistory]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/browser.xml :: :: line 644" data: no]
Source File: chrome://global/content/bindings/browser.xml
Line: 650

I also tried closing Firefox and deleting the files compreg.dat, xpti.dat, extensions.cache, extensions.ini, and extensions.rdf from my Firefox profile.

No joy on any of these.

The sqllite 3.6.0 command line tool dies with a bus error when I try to check the validity of the file.

Thoughts?

Patrick
  • The SQLite 3.6.0 command line client would fail if it's not a version compiled with the OS X network share–compatible locking flag, so that might be the reason for the bus error. I'm not sure if the OS X versions from the SQLite downloads have the flag, but it's possible they don't.

    Are you positive this is in Firefox 3.0.1 and not Firefox 3.0 or a nightly build? 3.0.1 enabled the flag, before which you'd get the NS_ERROR_FILE_IS_LOCKED error when trying to use a network share on OS X.
  • (I was just reminded that this was a USB drive, not a network share. The locking flag may still play a role, as we've seen this error occur with the flag disabled even on local drives, but, if you haven't yet, you should obviously verify that you can write to the USB drive normally through other apps.)
  • Also, if this is definitely Firefox 3.0.1, is it possible this broke when you upgraded to 3.0.1 from 3.0? It's possible that the locking change to fix network shares on OS X in 3.0.1 broke locking on USB drives...
  • I am almost positive this broke after I went to 3.0.1. I was on 3.0 beta for a long time, and then 3.0 and then 3.0.1. I thought all of them worked at one point.

    And I run many docs to the USB drive, so it does write. I just tried again.
  • Are you able to create a new database elsewhere on the USB drive using the 3.6.0 command line client? Or, for that matter, create a new empty Zotero database by pointing Zotero elsewhere on the drive? Would be good to rule out a locking issue with the file itself.
  • I created an empty one on the same drive. Same path as above, except as zoterotest.

    It works fine.

    Corrupt db?
  • Corrupt db?
    What does "Check Database Integrity" return in the Advanced pane of the Zotero prefs?

    It's also possible that the file is really locked by another app (such as another Firefox process). Does this still occur after restarting your computer?
  • Check Database Integrity doesn't return anything on the bad library. I click it, and then nothing. On the new test one, it returns a message saying there were no errors.

    I found the problem and fixed it. In the storage location, there was another file "zotero.sqllit". I thought that might be a temp file, so I tried renaming it to .bad. After that zotero worked just fine.

    Thanks for the help!
  • In the storage location, there was another file "zotero.sqllit"
    Was the file perhaps called zotero.sqlite-journal? SQLite creates a temporary journal file when it writes data, and if the journal file isn't correctly removed, it can probably cause an error like you saw.

    This shouldn't really happen, of course, and it may be something about using the USB drive for storage that caused it, though there are probably other ways. Let us know if it happens again.
  • Great work, pgardella! I solved the same issue by deleting zotero.sqlit from the library.
  • A word of warning here:

    zotero.sqlite is your main Zotero database. You don't want to delete a file named zotero.sqlite unless you don't care about your data. There should be no files named "zotero.sqllit" (two L's) or "zotero.sqlit" (no E). There may be a zotero.sqlite.bak file or a zotero.sqlite.tmp file, and, depending on your OS settings, the extension might not be displayed. Those would be safe to delete (though it'd be better to move them elsewhere). But just deleting zotero.sqlite (without an extension) is not something you want to do if you have data you care about.
  • I moved the "zotero.sqlit" out of the folder. Now Zotero is working fine.

    Thanks for your help.

    Kaoru
  • Was the file called "zotero.sqlit" or "zotero.sqlite"? And what other files existed in the directory at the time?
  • The file was called "zotero.sqlit". Before removing that file, there were the "storage" folder, "zotero.sqlite", and "zotero.sqlit" in the directory. After removing the file, I now see "zotero.sqlite", "zotero.squlite.bak in addition to the "storage" folder.
  • The file was called "zotero.sqlit".
    How bizarre. We've definitely never seen this before, but I'm going to take a wild shot in the dark here and guess that your USB drive (and that of Patrick and Anthony above) is formatted with a FAT filesystem rather than HFS+. FAT filesystems didn't originally have long-filename support, with the original limit for the name and extension being 8.3—that is, 12 characters including the period. "zotero.sqlit" happens to be 12 characters. So I'm guessing that, though some fluke of filename handling, the zotero.sqlite-journal file is getting truncated to 12 characters, not getting deleted properly, and therefore locking out further use of the database.

    Can you check what the filesystem is? You can do this by selecting the drive in the Finder and pressing Cmd-I (or selecting Get Info from the File menu). The filesystem should be listed next to "Format:".
  • edited August 7, 2008
    I'm seeing this problem intermittently as well. And yes, it is on FAT formatted USB drives.
  • kieren (and others): Could you please be more specific about your environment? Are you running OS X? What version? Is your USB drive FAT32? FAT16?
  • Firefox running on OS X (from /Applications/Firefox.app) and the thumb drive is FAT16
  • Unless others report that this happens on FAT32 as well, I'd recommend copying all the files off and reformatting the drive as FAT32 to see if that fixes it. Alternatively, if you don't need Windows compatibility at all, you could just use HFS+ ("Mac OS X Extended"—probably not journaled due to the speed constraints on the flash drive).
  • I just had the same problem on a FAT32 USB drive, FYI.
  • I have had this same problem start recently. I have my database on a FAT32 USB drive and access this from Ubuntu linux and Mac OSX. On linux it's fine, but OSX started locking me out of zotero. I found this thread, and deleted 'zotero.sqlit' and it starts up fine again. The problem is that this file is regenerated each time at startup. At the moment, I have to navigate to the zotero folder and delete the '.sqlit' file each time before starting firefox - that's a pain!
    Has anyone worked out what changed in OSX to cause this behaviour? (I an running an up-to-date 10.5.4)
  • Just registered to report the same problem. Using Zotero (v 1.0.9 - firefox 3.0.6) with an external USB-hdd formated in FAT-32 (working in both OS-X and windows). Zotero woulden´t start under OS-X untill i removed .sqlit from directory - no problems when using on a windows machine.
  • just to follow-up: This is definitely a FAT problem. I reformatted the drive with Mac OSX Extended, and it solved the issue for me.
    I'm running: I have Zotero 1.5b2 on Portable Firefox 3.0r4.0 on Mac OSX 10.5.6.
Sign In or Register to comment.