Zotero 10.0.3 sync fails with "sqlDate.substr is not a function"

Zotero 10.0.3 on Windows 11.
Database integrity check reports no errors.
Sync repeatedly fails with:
sqlDate.substr is not a function

I upgraded from Zotero 9.0.6, where the same error was occurring.
Debug ID: D497329151

Earlier logs also showed repeated connection errors to wss://stream.zotero.org, but after upgrading the persistent sync error is now sqlDate.substr is not a function.
  • dstillman Zotero Team
    You may have used some plugin or AI tool that wrote an invalid value to the database.

    Go to Tools → Developer → Run JavaScript, run this, and let us know the result:

    var rows = await Zotero.DB.queryAsync("SELECT itemID, key, TYPEOF(dateAdded) AS ta, dateAdded, TYPEOF(dateModified) AS tm, dateModified FROM items WHERE TYPEOF(dateAdded) != 'text' OR TYPEOF(dateModified) != 'text'");
    return rows.map(r => [r.itemID, r.key, r.ta, r.dateAdded, r.tm, r.dateModified].join(' | ')).join('\n');
  • 47401 | 99F82CD9 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47402 | 1BCCBC3C | text | 2026-05-16 11:15:34 | integer | 1778930134
    47403 | 0EDAE953 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47404 | A3082DBD | text | 2026-05-16 11:15:34 | integer | 1778930134
    47407 | 21FB787C | text | 2026-05-16 11:15:34 | integer | 1778930134
    47408 | 65D89E31 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47410 | 93C143F1 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47411 | 388C6F9C | text | 2026-05-16 11:15:34 | integer | 1778930134
    47412 | 05453232 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47413 | 2D70BEAA | text | 2026-05-16 11:15:34 | integer | 1778930134
    47414 | 49FCECE0 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47415 | 40CF87F3 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47416 | 76BD2925 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47417 | DC7A3520 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47418 | 70722932 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47419 | 26D79BA6 | text | 2026-05-16 11:15:34 | integer | 1778930134
    47420 | 8309616D | text | 2026-05-16 11:23:01 | integer | 1778930581
    47423 | 16CCE6B3 | text | 2026-05-16 11:23:01 | integer | 1778930581
    47426 | 72746578 | text | 2026-05-16 11:23:01 | integer | 1778930581
  • dstillman Zotero Team
    OK, so you used some plugin or AI tool that did this on May 16th.

    This should correct it:

    await Zotero.DB.queryAsync("UPDATE items SET dateModified = STRFTIME('%Y-%m-%d %H:%M:%S', dateModified, 'unixepoch') WHERE TYPEOF(dateModified) != 'text'");


    Then restart Zotero.
  • The date conversion worked, but sync now proceeds further and reports multiple invalid item keys. I can indeed confirm that Claude previously wrote directly to the database (but will obviously avoid it in the future).

    Examples include:
    16CCE6B3, 4CCB1B6A, 60F5B5F6, iaV6Dugw, VG0IWUBB, and 7abUzwhT.

    There are also several "parentItem must be a valid item key or false" errors.

    Could you provide the safest way to identify and batch-repair these records without losing their contents or attachments?
  • Following up on this. The date repair worked, but sync is still blocked by the invalid item-key and parentItem errors listed above. I don’t want to make further direct database changes without guidance. Could you advise on the safest repair? I can provide a fresh Debug ID if useful.
  • dstillman Zotero Team
    I'm afraid you're on your own here. You used a third-party tool that created invalid data in your database that Zotero never would have created (and I believe wouldn't have even allowed a plugin to create). There's no knowing what else it might have done — the DB is never supposed to be written to for exactly this reason. You can try to identify and fix the damage yourself, or you can delete your database and pull down your library from the server.
Sign In or Register to comment.