Importing a 0.10.15 markdown graph into 2.0.2: one missing Zotero PDF silently empties the whole graph

I migrated a 124-page markdown graph (0.10.15 era) into Logseq 2.0.2. The import failed with the least actionable error I’ve seen in a while, and the resulting graph was completely empty. I traced it down to a single missing Zotero attachment. I’d like to raise one request at the end, but first the facts.

Environment

  • macOS 27.0.1 (26A434), Logseq desktop 2.0.2, revision 533ac43 (build 2026-10-07)
  • Source: pure markdown file graph, 124 pages + 2 journals + 13 assets, sitting in a synced folder
  • Target: ~/logseq/graphs/<name>/db.sqlite

What the user sees

Unexpected error: Nothing found for entity id [:block/uuid #uuid "6add3b62-8240-494d-9292-b19d17aefe57"]

and afterwards a graph that contains nothing at all:

$ sqlite3 ~/logseq/graphs/Logseq-Reseach/db.sqlite ".tables"
kvs                      # 446 KB, 410 rows of schema bootstrap, 0 nodes

The uuid in the message does not exist anywhere in the source graph — not in any .md, not in config.edn (I grepped all 124 pages, case-insensitively). It is generated during the import, so it tells you literally nothing about which file broke.

The db-worker log is more honest than the UI, but only just:

[severe] :import-file-stat {:fs-path ".../Zotero/storage/QE97MQ8Y/Colding和Minicozzi Ii_2008_....pdf"
                            :error ENOENT}
[severe] :import-file-stat {...}   ×2 more
[console.error] transact-failed [object Object]
[console.error] Error: Nothing found for entity id [:block/uuid #uuid "6add3b62-..."]

Root cause (as far as I could trace it)

  1. The graph has 8 hls__*.md PDF-annotation pages. Their file:: property points at ~/Zotero/storage/<KEY>/<Label>.pdf.
  2. Zotero (or a folder sync) had normalised those filenames on disk: Colding和Minicozzi Ii_2008_Width and finite extinction time of Ricci flow.pdf is on disk colding_minicozzi_ii_2008_width_and_finite_extinction_time_of_ricci_flow.pdf. Note this is not a case-sensitivity problem — this volume is case-insensitive — spaces became underscores and 和 became _, so the label recorded in the markdown simply no longer matches any file, and stat is ENOENT (exactly what the log shows).
  3. Because of the failed stat, the PDF’s asset node is never created — and with it the 6 ls-type:: annotation nodes that hang off that asset are never created either.
  4. Two other pages reference those annotations with block refs: @Width and finite extinction time of ricci flow contains - ((69285d16-a489-4c91-85f4-6484b2e857ca)) and ((69285d97-...)), both pointing into hls__Colding…md.
  5. The per-file transaction therefore carries a [:block/uuid 69285d16-...] lookup ref with no entity behind it, datascript’s entity! throws, and the whole import is gone — not “that file was skipped”, not “5 pages imported, 119 failed”: empty.

Proof it’s this, not something else

I created symlinks with the exact filenames the markdown records, pointing at the real (lowercased) files, and re-imported the same graph unchanged:

  • import completes in one pass
  • logseq query -g Logseq-Reseach --query '[:find (count ?b) . :where [?b :block/uuid]]' → 4476 nodes
  • … :where [?b :block/tags :logseq.class/Pdf-annotation] → 6 (all of them, exactly the number in the source)
  • the block refs that used to dangle survive as [[69285d16-a489-4c91-85f4-6484b2e857ca]]

Same input, one symlink away from total loss.

This looks like a sibling of #1408 (“File import: Zotero attachment paths … ENOENT stat kills the db-worker”), but a different failure mode: there the worker dies and the UI hangs; here the worker survives and hands the user an unusable uuid. #1403 and #1343 (“Import ignored 1 asset. See the javascript console”) seem to be the same family — the importer knows something went wrong and tells nobody.

The one thing I’d ask for

Make file→DB import fail-safe and self-diagnosing. Concretely, three acceptance criteria:

  1. Name the culprit. On a transact failure, report the source file, the page title, and the dangling target (“page @Width and … refs block 69285d16-…, which would have come from asset …pdf that failed to stat”). Never a bare runtime uuid.
  2. Don’t take the graph hostage. Isolate the failure to that file/node, keep everything already committed, and end with a summary: pages imported / blocks imported / assets imported / N items skipped, here’s the list. “0 nodes after 40 seconds” is not an acceptable outcome for one bad attachment.
  3. Preflight, and let me fix before it hurts. Before transacting, validate and list: file:// targets that fail stat, ((uuid)) / [[uuid]] refs with no target, and page names the DB can’t take (a ___-encoded name ending in / was rejected in my graph; [[/unread]]-style leading-slash names are namespace-degenerate). Offer “skip these and continue” instead of abort.

Point 3 is also the cheapest: all three checks are cheap file-level scans, and they’d have turned a 40-minute post-mortem into a warning list.

Workaround for anyone hitting this

  • Copy the graph out of any synced folder first, and never import in place.

  • Reconcile every file:: / file-path:: / {{zotero-imported-file KEY,"label"}} path against what’s actually on disk (symlink or rename), or strip :zotero/settings-v2 from config.edn and remove the dead macros.

  • Rename any …___.md page (trailing / after decoding) and drop leading / from [[/tag]] refs.

  • Check the result: if db.sqlite is ~450 KB and sqlite3 … ".tables" shows only kvs, your import silently rolled back — it isn’t “slow”, it’s empty.

  • Verify with the bundled CLI instead of the UI:

    logseq query -g <graph> --query '[:find (count ?b) . :where [?b :block/uuid]]'
    

Happy to provide the full db-worker log, the 8 offending hls__ pages and a minimised repro (one annotation page + one page with a ((uuid)) ref + a renamed PDF) if that helps.