Skip to content

File→DB import aborts with a dangling [:block/uuid …] and leaves an empty graph when a PDF asset fails to stat #1469

Open
logseq/logseq
#13886

Description

@vanabel

Search first

  • I searched and no similar issues were found

What Happened?

Summary

Importing a 0.10.15-style markdown graph into 2.0.2 (533ac43) aborts with

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

and leaves the new graph with zero nodes (db.sqlite 446 KB, only the kvs table). The reported uuid is generated at import time and exists nowhere in the source graph, so the message cannot be acted on. Root cause: an asset whose stat fails never materialises, which also drops the PDF-annotation nodes that hang off it, which in turn leaves cross-file ((uuid)) block refs dangling; the transact then dies and takes the entire import with it.

Expected

  • Per-item degradation: skip the unresolvable asset / annotation, keep the rest, report what was skipped.
  • Or, at minimum, an error naming the source file and the dangling target, not a runtime uuid.

Actual

  • Whole import discarded; UI shows a uuid that maps to nothing:
    <img>-level evidence in the log: [severe] :import-file-stat, transact-failed [object Object], Nothing found for entity id [:block/uuid …].
  • No import summary anywhere: no page/block/asset counts, no skipped-item list.

Verification that this is the trigger

Symlinking the 6 recorded filenames to the real (lowercased) PDFs, same graph, no other change:

  • import completes; count ?b over [?b :block/uuid] → 4476
  • count ?b over [?b :block/tags :logseq.class/Pdf-annotation] → 6 (matches the source)
  • the previously dangling refs are now [[69285d16-a489-4c91-85f4-6484b2e857ca]]

Environment

Suggestion

A preflight pass (cheap, file-level) that lists failing file:// targets, unresolvable ((uuid))/[[uuid]] refs and DB-illegal page names, plus a "skip and continue" path and a final import summary, would cover this whole family of silent failures.

Reproduce the Bug

Reproduce

  1. File graph with a PDF-annotation page whose file:: label no longer matches the file on disk — e.g. Zotero storage normalised Colding和Minicozzi Ii_2008_….pdf to colding_minicozzi_ii_2008_….pdf (spaces/uppercase → underscores, 和 → _; not a case-sensitivity issue, the volume is case-insensitive — the names differ structurally, so stat is ENOENT; same class as File import: Zotero attachment paths join base dir with absolute paths; ENOENT stat kills the db-worker (unhandled rejection) #1408).
  2. That annotation page has ls-type:: annotation blocks with id:: uuids.
  3. Another page block-refs one of those ids: - ((69285d16-a489-4c91-85f4-6484b2e857ca)).
  4. Import the graph.

Result: [severe] :import-file-stat … ENOENT ×3 → transact-failed → entity error → import aborted, 0 nodes.

Expected Behavior

No response

Screenshots

No response

Files

No response

Browser, Desktop or Mobile Platform Information

No response

Additional Context

No response

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)

Activity

  1. yuxi-liu-wired commented on Oct 27, 2026

    @yuxi-liu-wired

    Fixed in logseq/logseq#13891 (fix(import): file-graph import keeps tables in quotes and Zotero PDF assets). Its description has the cause and the test that pins it; it fails on current master and passes with the fix.

  2. added 5 commits that reference this issue on Oct 28, 2026
    8107c48
    afb6434
    672bbe9
    cca8de9
    14c3cce
  3. added 8 commits that reference this issue on Nov 11, 2026
    082b1b4
    968e913
    3e1c404
    a5b00bc
    34fb630
    e6a8d6c
    28af8d7
    a2dfd77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions