Database update error...

Just updated to the latest version. On start-up I get the following message:

Database upgrade error

Error: Error(s) encountered during statement execution: database disk image is malformed [QUERY: SELECT COUNT(*) > 0 FROM fulltextItemWords WHERE itemID NOT IN (SELECT itemID FROM items WHERE itemTypeID=2)] [PARAMS: ] [ERROR: database disk image is malformed]
Zotero.DBConnection.prototype.valueQueryAsync@chrome://zotero/content/xpcom/db.js:762:13
From previous event:
this.init@chrome://zotero/content/xpcom/zotero.js:414:25
getContentsFromURL@chrome://zotero/content/xpcom/file.js:339:13
Zotero.Intl</<@chrome://zotero/content/xpcom/intl.js:100:35
Zotero.Intl</this.getString@chrome://zotero/content/xpcom/intl.js:144:18
this.getString@chrome://zotero/content/xpcom/zotero.js:1523:24
ZoteroPane<@chrome://zotero/content/zoteroPane.js:3176:19
@chrome://zotero/content/zoteroPane.js:31:18
@chrome://zotero/content/zoteroPane.xhtml:82:25

Did Zotero just nuke my database?
  • Also, the clean backup doesn't work, either.
  • Do you have you Zotero data folder in a custom location? I've seen similar errors more commonly with I/O error messages than with database malformed, but that'd still be my first guess. Since Z7 does differ in how it accesses databases on external harddisk, network drives, etc.
  • c:\Zotero is the location of the library.

    I've had no issues with it there, or working from a USB stick in the past.

    Might have to try installing Zotero 6 again to see if that fixes the issue...I really don't look forward to re-cataloguing 35 GB worth of files.
  • Reinstalled Zotero 6 on another machine. Database isn't corrupted at all and everything appears as it should.

    this makes me think there's a significant issue with the way Zotero 7 deals with the SQLite database.
  • edited yesterday at 6:40am
    Have you actually checked the integrity of this database file? If you're getting this error, the database is very likely corrupted (quite possibly from using it on a USB stick in the past). It's entirely possible to use a corrupted database for a long time without encountering an error — that doesn't mean it's not corrupted, nor does it mean there's some problem with the SQLite client when you do encounter an error. It just means you've been lucky up to now.

    If you can start up Zotero (any version), you can check the database integrity from the Advanced → Files and Folders section of the Zotero settings. Otherwise, if your DB compresses to <150 MB, you can try the DB Repair Tool. If not, you'd have to use something like DB Browser for SQLite and run PRAGMA integrity_check; manually.
  • Hello, We have the same problem here: when we upgraded to Zotero 7, we got the same error message about a corrupted database.

    Going back to Zotero 6 solved the problem.

    We used the tool to check the DB integrity in Zotero, which told us that the database was indeed slightly corrupted.

    Since our database was 164 MB, we installed DB Browser for SQLite, opened the sqlite file, and then ran the PRAGMA integrity_check command.

    Here is the response:
    https://s3.amazonaws.com/zotero.org/images/forums/u3230111/0anmeixofa4opba19tll.png

    Do you know what we can do with that?
    Thanks you in advance
  • edited yesterday at 3:25pm
    If you can't use the DB Repair Tool, you have a two main options:

    1) Follow the manual repair instructions to run .recover from the SQLite command-line interface. We can't guide people through that on Windows, though.

    2) If you've been using Zotero syncing and all your data is online, you can just close Zotero and delete zotero.sqlite in your Zotero data directory, and then let Zotero sync down your data from the online library.
Sign In or Register to comment.