Repository navigation
Description
Summary
Two related defects in the file→DB graph importer's Zotero attachment handling. On a graph with Zotero literature notes whose local PDFs no longer exist, the import dies every time at the same point: the db-worker process is killed by an unhandled promise rejection after an asset stat ENOENT, and the renderer hangs with no error surfaced.
Defect 1: base dir joined with absolute paths
get-zotero-local-pdf-path (deps/graph-parser/src/logseq/graph_parser/exporter.cljs:1282) builds <zotero-data-dir>/storage/<id>/<label>, and the {{zotero-linked-file "C:\\...\\foo.pdf"}} macro resolution joins zotero-linked-attachment-base-directory with the absolute path embedded in the macro. With e.g. :zotero/settings-v2 {"default" {:zotero-data-directory "C:\\Users\\me\\Zotero", :zotero-linked-attachment-base-directory "D:\\work\\papers\\zotero-base"}}, the importer stats paths like:
D:\work\papers\zotero-base\C:\Users\me\Documents\Paper\foo.pdf ← macro variant
C:\Users\me\Zotero\storage\6RVEBFF2\foo.pdf ← zotero://select variant
The first form is nonsense on Windows (absolute path appended to another absolute path). The second form points at Zotero storage items that may have been purged. Both should at minimum check isAbsolute and existence, then skip with a warning.
Defect 2: ENOENT stat failure kills the db-worker
<import-file-stat (src/main/frontend/worker/db_core.cljs:330) correctly catches the stat error, logs [severe] :import-file-stat {:fs-path ... :error ENOENT} and returns nil. However something downstream in the asset-resolution chain then throws an unhandled promise rejection (stack ends ... at Object.resolve → hAb in the db-worker-node bundle), which kills the worker process (node exits; db-worker.lock disappears). The renderer never gets an error — the import UI just stops making progress ("loading" forever). In our runs, 30 dead Zotero references killed the import at the same point every time (~41 MB persisted).
Repro
- Graph config
logseq/config.edncontains:zotero/settings-v2with azotero-data-directory(and/orzotero-linked-attachment-base-directory) - Some pages contain
[foo.pdf](zotero://select/library/items/KEY)links or{{zotero-linked-file "C:\\...\\foo.pdf"}}macros where the target file/storage item no longer exists - File → Import → File to DB graph → dies deterministically at the first such resolution
Workarounds we used
- Remove dead
{{zotero-linked-file}}macros from the markdown - Remove
:zotero/settings-v2fromlogseq/config.ednbefore import (get-zotero-local-pdf-pathshort-circuits on a nil data dir — links survive as regular links)
Environment
- Windows 10, Logseq stable 2.0.1 (
b09316a) and self-built master2693a98-dirty(2026-10-01) — both affected - Graph: 2,744 Markdown files, Zotero literature notes (
@Paper Title.mdpages withzotero://links) - Related: 2.0.1 file import: file:/// link to a directory crashes the db-worker (null lastIndexOf/toLowerCase), following files silently dropped #1403 (worker crash on file:/// dir links, same silent-death family), fix: import Windows and HTTPS linked PDF annotations logseq#13162 (Windows PDF annotation import fixes)
Happy to provide the full worker logs (they include the [severe] :import-file-stat chain followed by the uncaught rejection stack) and a minimal markdown repro.
Activity
yuxi-liu-wired commentedon Oct 27, 2026
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.
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path
fix(import): use the absolute path of a Zotero linked file as is
fix(pdf): open a Zotero linked PDF that has an absolute path