Error when starting Zotero after install

I had Zotero installed and working, but today the following error appeared. I uninstalled Zotero, removed the zotero folder from app data, downloaded and reinstalled, but the same error appears.

Win error 123 during operation open on file C:\UsersameZotero\zotero.sqlite (The filename, directory name, or volume label syntax is incorrect.

)
(No stack trace)
From previous event:
ZoteroService@file:///C:/Program%20Files%20(x86)/Zotero/components/zotero-service.js:347:7
@chrome://zotero/content/include.js:4:14

The pathway in the error message is not correct. How can I fix it?
  • edited February 3, 2023
    Did you set a custom data directory? Unless you mistyped it above, there's a problem — and, from the looks of it, an invalid character in — the path where it's looking for the data directory.

    Go to your Zotero profile directory, open prefs.js in Notepad, search for a line containing "extensions.zotero.dataDir", and delete that line, and then save the file. Then restart Zotero. If you set a custom data directory previously, you may need to set Zotero back to the correct folder.
  • edited February 3, 2023
    No, I did not set a custom data directory. And yes, there is an invalid character in the path above - but that was not from any typing on my part. (After a clean install of Zotero, this was the error message on the first launch of Zotero.)

    I went to Users/name/AppData/Roaming/Zotero/Zotero/profiles/<random>/prefs.js, searched for 'extensions.zotero.dataDir' - and did not find it.

    A tiny bit more context: Zotero was previously installed on this computer and was running without issue in December. When I started Zotero this morning, I received this error message. I then attempted to update (failed), uninstalled and reinstalled (failed), uninstalled and deleted all personal files, reinstalled (failed).
  • Is there some unusual character in your Windows username?

    Can you provide a Debug ID for Zotero startup?

    https://www.zotero.org/support/reporting_problems#reporting_startup_errors
  • edited February 3, 2023
    Debug failed to produce any output: it started, but showed a blank page with 'submit' and 'clear' grayed out.

    I ran -jsconsole, and received a lot of output.

    [unrelated messages removed — D.S.]

    [JavaScript Error: "Win error 123 during operation open on file C:\UsersameZotero\zotero.sqlite (The filename, directory name, or volume label syntax is incorrect.
    )" {file: "(unknown module)" line: 0}]

    I've replaced my actual username with 'ame' here - and no, I don't have any special characters in my username

    [JavaScript Error: "Win error 123 during operation open on file C:\UsersameZotero\zotero.sqlite (The filename, directory name, or volume label syntax is incorrect.
    )" {file: "file:///C:/Program%20Files%20(x86)/Zotero/components/zotero-service.js" line: 350}]
    ZoteroService/[…]

    That's the end of it.
  • PS - I did restart the computer before running this last test.
  • edited February 3, 2023
    OK, see Logging to a Terminal Window. It doesn't work as well on Windows, but it should be enough to let you copy the initial 20 or so lines. Email to support@zotero.org, unedited, with a link to this thread.
  • (I'm not clear why you're replacing your name with "ame"? It's fine to replace a username in a public post, if you say you're doing so, but that's a really confusing choice…)
  • No unusual characters in user name. I was leaving it as 'ame' as the odd special character would be the first letter.

    Ran logging to terminal window: no output.

    Added > zoterodebug.txt. Empty file.
  • edited February 3, 2023
    Make sure you add both -ZoteroDebugText and -console. The cmd.exe window will be empty, but it should open up a new console window with logging output.

    Can you also take a screenshot of the error message and email it to us?

    In any case, I think you're going to have to debug this on your system. I don't recall us ever seeing anything like this, so it's something installed on your system or non-standard about your system configuration. Zotero just gets the home directory and adds "Zotero" to it, with OS-appropriate separators. It seems like you're somehow missing a couple backslashes and also ending up with an invalid character. That's just not a problem from Zotero itself.

    If you installed any third-party plugins (showing up in 'extensions' in the Zotero profile directory), you should delete those, but I'd guess this is from something else on your system.
  • Resolved:

    I looked, and Users/username/Zotero did not exist. I created the folder, and copied zotero.sqlite from a different computer into the folder. I then started Zotero - and no error occurred.

    Three questions remain unclear to me.
    1. Where did my zotero.sqlite go this morning? (Possibly something happened to corrupt it?? I don't think this is anything that you can answer.)
    2. Why didn't the installation create the directory and file after I had uninstalled and had manually deleted this directory? (Perhaps you have insight on this question.)
    3. Why did Zotero create such an odd error message for the missing sqlite file? (That is, why was the username given a special character?)

    Thanks,

    Eric
  • edited February 3, 2023
    1. Where did my zotero.sqlite go this morning?
    You said you deleted the folder, no? There would've been all sorts of files in there, including .bak files, 'storage', etc.
    2. Why didn't the installation create the directory and file after I had uninstalled and had manually deleted this directory?
    Couldn't tell you — Zotero obviously normally creates the folder and file if they don't exist. Could be something with security software on the system or file permissions.
    3. Why did Zotero create such an odd error message for the missing sqlite file? (That is, why was the username given a special character?)
    In various programming languages, a backslash plus the first letter of your OS username results in that special character, but why that's showing for the path in the error message, I don't know. It looks like it took just "\username\" from the path as a separate string, converted the first escape sequence (backslash plus first character) to the special character, and stripped the trailing backslash, while leaving the rest of the path (including backslashes) intact. I'd guess that this was related to its not being able to create the file either, but don't know for sure. Not something I can recall seeing anyone report before. It would be below the level of Zotero code, in any case — we only get the entire home directory path and don't do anything with the OS username ourselves.

    Anyway, glad it's working for you now.
Sign In or Register to comment.