GeezerVison is showing github.com — cold-store: atlas Turso export fails to rebuild (duplicate chunk_id in vec table dump) · Issue #12000 · developing-today/code
cold-store: atlas Turso export fails to rebuild (duplicate chunk_id in vec table dump) #12000DescriptionProblem
cold-store-nightly on the laptop (device amd) has failed its export-turso step on Nov 17 and Nov 18, so the nightly run reports FAILED steps: export-turso. Every Turso database exports except the large atlas database:
- Nov 17 03:26 CST:
turso export: ERROR: atlas: dump download failed (the /dump download for atlas).
- Nov 18 04:19 and 05:11 CST:
Error near line 458145: UNIQUE constraint failed: vec_snowflake_m_v2_768_f32.chunk_id, then turso export: ERROR: atlas: dump did not rebuild into a SQLite file. Both attempts fail on the same dump line.
The Nov 18 prune listing keeps no atlas export at all, so this database has no cold-store copy in the retained set. All other databases (the atlas-core-* shards, fleet-mirror, muse-meta, notes-submissions) filed normally.
What is known
vec_snowflake_m_v2_768_f32 is a plain table with chunk_id INTEGER PRIMARY KEY in the repo's fixtures. A primary-key collision on rebuild means the /dump text carries the same chunk_id twice. That fits a dump paginated over a table that was being written during the dump, or a schema on the live atlas database that differs from the fixtures. It has not been confirmed.
export-turso.sh deletes its work dir on exit, so the failing dump is not kept for inspection.
Ask
- Keep the failing dump (or at least the table name, the duplicated
chunk_id and how many dump lines carry it) when the rebuild fails, so the cause can be read off the next run.
- Fix the cause: a consistent dump for
atlas, or a rebuild that tolerates a key repeated by a non-snapshot dump only where the repeated rows are identical. Do not drop rows silently.
- Acceptance: one nightly run files an
atlas export that passes the existing integrity and user-table checks.
Found while checking laptop backups for #10296. Related: #1391 (dump repair filter).
Generated by Claude Code Activitydeveloping-today commented on Nov 19, 2026 dezren39 commented on Nov 23, 2026
Reconciliation — all three asks landed; acceptance met (Lane LR, 2026-11-23)
Verified first-hand against current main and the laptop's cold-store transfer ledger (~/.config/cold-store/manifest.sqlite):
- Diagnostics (ask 1) — landed 2026-11-19. PR cold-store: report the statement a failed Turso rebuild stopped on #12001 (commit
2029c2e04f3): on a rebuild failure the export now reports the failing statement's table and whether the dump repeats it verbatim, via scripts/dump_line_report.py; row values are never printed.
- Cause fixed (ask 2) — landed 2026-11-19. Commit
d8780735c02: the export pipeline gained scripts/dedupe_dump.py (a repeated table is dropped only when its CREATE statement and every row match the first copy exactly; a differing repeat fails the export — no row is dropped silently) and scripts/vector_index_dump.py (a libsql vector index's CREATE INDEX is recorded in cold_store_libsql_vector_indexes instead of dying on stock sqlite3; its data stays in the shadow tables).
- Acceptance (ask 3) — met twice. The transfer ledger records an
atlas export filed on 2026-11-19 (turso-20261119T094654Z-atlas.db.gz, 3,581,679,110 bytes gzipped) and again on 2026-11-21 (turso-20261121T085527Z-atlas.db.gz, same size) — the first two nightly runs after the fix landed. Filing happens only after the rebuild passes PRAGMA integrity_check = ok and the at-least-one-user-table check in export-turso.sh, so both filings passed the existing checks by construction.
Re-verified tonight with a standalone run of the atlas leg (download → filters → rebuild): the rebuild stage was never reached because the download stage now fails first — see the separate issue below. That is a different failure mode from this issue's defect, not a regression of the dedupe fix.
Remaining problem, filed separately: #13115 — the atlas /dump download is cut mid-transfer (curl 18) on every attempt and the endpoint ignores Range, so no resume is possible; the 2026-11-22 nightly also filed no atlas (50 other databases filed, service exited FAILURE), and no unit output survives to confirm its stage.
Closing this issue as completed: the duplicate-chunk_id rebuild failure it reported is fixed and its acceptance criterion has been met.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|