Zotero was unable to load translators and styles.

I suddenly had the error "Zotero was unable to load translators and styles." when starting Zotero.

I already tried the suggested actions:
- resetting translators and styles and checking your database integrity in the preferences.
- deleting the translators and styles folders in the data directory.

I work on Linux (Manjaro/Arch) and also use zotero from with a virtual machine running Windows 10.

The report ID is: 2036159652

Any advices, what to do?

Many thanks,
Samuel
  • [JavaScript Error: "Error(s) encountered during statement execution: database disk image is malformed [QUERY: SELECT rowid, fileName, metadataJSON, lastModifiedTime FROM translatorCache] [PARAMS: ] [ERROR: database disk image is malformed]" {file: "chrome://zotero/content/xpcom/db.js" line: 664}]
    Your database is corrupted, likely from your use of the database across the VM boundary, which I wouldn't recommend.

    You can try repairing it with the DB Repair Tool.
  • Thanks for the hint.
    (As Word is still the main format in my environment, I still haven't found any alternative to use zotero in word besides in a virtual machine. It works all fine, as a long as I never open zotero twice. This time I forgot to close it. I guess this was the reason for the damage)

    Unfortunately, the Repair Tool and the manual way was not successful. The created .sqlite file with the manual was of size 0KB.

    An integrity check with
    sqlite3 zotero.sqlite "PRAGMA integrity_check"
    returned
    *** in database main ***
    On tree page 63852 cell 65: 2nd reference to page 31547
    Page 43330 is never used
    Error: database disk image is malformed

    However, I finally managed by replacing the last line of the dump.sql by "COMMIT;", and then creating the new zotero.sqlite from the dump. Found on stackoverflow:
    https://stackoverflow.com/questions/44602759/sqlite3-recreates-empty-database-from-dump-file

    For the record, I did:

    # integrity check on corrupted database
    sqlite3 zotero.sqlite "PRAGMA integrity_check"
    # rename
    mv zotero.sqlite zotero.sqlite.old
    # dump
    sqlite3 zotero.sqlite.old .dump > dump.sql
    # remove last line (could also be done in editor, but file is rather big)
    head dump.sql -n -1 > dump1.sql
    # add COMMIT; to end
    echo 'COMMIT;' >> dump1.sql
    # create database newly from dump
    sqlite3 zotero.sqlite < dump1.sql
    # integrity check on new database
    sqlite3 zotero.sqlite "PRAGMA integrity_check"
    # should return "ok"

    Probably you want to implement this in the repair tool...
  • Probably you want to implement this in the repair tool...
    No, we don't. The dump may skip bad data, but if it completes and includes the COMMIT it generally at least indicates that the full schema was created. As the SO page explains, all you're doing by putting that in manually is overriding the rollback to create an incomplete database, and there's a very good chance you're missing entire database tables and will run into crashes or other problems later. In those cases, it's better to restore from a backup, even if outdated. If you're using syncing, you can also just delete the database and sync to pull down your online data.

    (One improvement we could consider would be first rebuilding an empty database from the current DB schema and then adding just the data from the corrupted database, but that could get into problems with the schema version. Really, when a naive dump and restore doesn't work, restoring from a backup and/or syncing is almost always going to be the better option.)
Sign In or Register to comment.