Trouble Accessing Zotero.sqlite Copies Archived with Windows File History

I realize we can't here try to debug issues with Windows File History (WFH), but I'm coming across an odd issue and wondering if there's anything related on the Zotero side.

Normally, WFH seems to just save a straight copy of a given file. And I can pull files back from the archive when needed as if they're simply copies. But things aren't working that way for zotero.sqlite.

When I try to open a zotero.sqlite file from the WFH archive even from yesterday (e.g., in Zotero's current ZIPed beta version, portable version, and for good measure, regular stable version), I'm told the "database can't be opened" (in this error message) and that I should

- ensure I have read and write permissions for the data directory and
- ensure no security software is preventing Zotero from accessing that directory.

Both of these (I think) check out. I have full access to the directory (see, e.g., here), and no security software shows in Task Manager when I boot Windows into Safe Mode. And I've made sure I'm also trying to open a WFH archive file made from the same machine.

But in any of these scenarios, the same error occurs whenever I try to use Zotero to read a zotero.sqlite file that's been saved via WFH.

But, if I try to

- open in Zotero a backup Zotero has made and that's still in the data directory (i.e., not one that's been saved/copied from there into the WFH archive), the file opens just fine or
- open any of the zotero.sqlite files from the WFH archive directly (e.g., with DB Browser for SQLite), I can open the file and pick through the database just fine there too.

I'm not sure if getting the WFH archive files to open in something like DB Browser is diagnostic for anything. But if anyone has any insight on what I might be missing here when trying to open these same files in Zotero, I'd be most grateful for any thoughts.

Thanks so much!
  • edited July 19, 2022
    I'm not sure if getting the WFH archive files to open in something like DB Browser is diagnostic for anything.
    It means the file itself isn't corrupted, but that would be a different error anyway. And it's testing that the file is readable, but unless you actually try to write to the file, it's not testing writing at all.

    Can you provide a Debug ID for Zotero startup, using the "Restart with Logging Enabled…" option? Or if you can't access the menu to trigger that, see Reporting Startup Errors. We might be able to tell you a little more.
  • Ok, thanks. I'm only able to get debug output with the -jsconsole or -console options. Here's what I got when running "C:\Users\davidst\Dropbox\Apps\Zotero Beta\zotero.exe" -ZoteroDebugText -console > error.txt.

    Thanks so much for having a look and whatever thoughts you may have!
    zotero(3)(+0000000): Using data directory C:\Users\davidst\Dropbox\Apps\Zotero Beta\profile
    zotero(3)(+0000008): Asynchronously opening database 'zotero'
    zotero(3)(+0000000): C:\Users\davidst\Dropbox\Apps\Zotero Beta\profile\zotero.sqlite
    zotero(4)(+0000005): PRAGMA main.locking_mode=EXCLUSIVE
    zotero(4)(+0000000): PRAGMA page_size
    zotero(4)(+0000001): PRAGMA cache_size=2000
    zotero(4)(+0000000): PRAGMA foreign_keys=true
    zotero(1)(+0000002): Cannot write to C:\Users\davidst\Dropbox\Apps\Zotero Beta\profile\zotero.sqlite [I'm not trying or going to try to sync to or from this database that's in Dropbox. That's just a convenient location for me to try to pull files back from the WFH into. Presumably this is the relevant line, but I'm not sure why Zotero doesn't think it can write to this file given what I've mentioned above (full control to the directory, same machine as created the file to begin with, etc.).]
    zotero(4)(+0000002): REPLACE INTO settings VALUES ('db', 'integrityCheck', 1)
    zotero(3)([31;40m+0003051[0m): Zotero.Utilities.Internal.quitZotero() is deprecated -- use quit()
    zotero(3)(+0000009): PluginInstaller: fetching addon info
    zotero(3)(+0000001): PluginInstaller: addon info fetched
    zotero(4)(+0000030): Unregistering notifier observer in notifier with id 'tab_k1'
    zotero(4)(+0000000): Unregistering notifier observer in notifier with id 'itemPane_9P'
    zotero(4)(+0000000): Unregistering notifier observer in notifier with id 'itembox_GP'
    zotero(4)(+0000000): Unregistering notifier observer in notifier with id 'relatedbox_tE'
    zotero(4)(+0000000): Unregistering notifier observer in notifier with id 'noteeditor_Yo'
    zotero(4)(+0000000): Unregistering notifier observer in notifier with id 'noteeditor_Fm'
    zotero(4)(+0000001): Unregistering notifier observer in notifier with id 'itembox_hH'
    zotero(4)(+0000000): Unregistering notifier observer in notifier with id 'attachmentbox_Zd'
    zotero(3)(+0000017): Shutting down Zotero
    zotero(3)(+0000015): Closing database
    zotero(3)(+0000003): Database closed
  • edited July 19, 2022
    I'm not trying or going to try to sync to or from this database that's in Dropbox.
    The database still shouldn't be in a cloud storage folder, even to test — that could easily cause a problem like this (though probably not the problem here, based on your first screenshot showing this happening in a different folder).

    You should copy zotero.sqlite from the backup to the default location in C:\Users\[user]\Zotero and test with that.

    Beyond that, I'm afraid you'll need to debug this on your end.
  • Okay, thanks for the tip, @dstillman. Unfortunately, even if I put everything entirely in a local folder that's not synced in any way (e.g., the desktop), the same issue recurs. I have for the present been able to get what I need from picking through the database backups with DB Browser, though, so I've been grateful for that.

    Thanks again for your time and thoughts.
Sign In or Register to comment.