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.
  • 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
  • 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?
Sign In or Register to comment.