Skip to content

[DB 2.0.2] Recycle GC prevents startup after converting a parent tag to a page #13877

Closed

Description

@GJCPP

Search first

  • I searched and no similar issues were found

What Happened?

I experienced this bug on both Windows and Mac, which hinders graph-loading process. Its diagnosis and local repair were completed with help from GPT/Codex.

The following sections were written by Codex. As I understood it, the followings should describe the issue and the reproduction steps faithfully. With agent's help, I also reproduced the bug, and the log is attached in "Reproduce the bug".

Hope this helps!

Cause and result

Converting a parent tag to an ordinary page leaves child tags' Extends references pointing to that page. If the page is then recycled and removed by the 30-day GC, a child can lose its only parent. Validation fails and the graph cannot open:

DB write failed with invalid data
:outliner-op :recycle-gc
:logseq.property.class/extends — missing required key

Reproduce the Bug

  1. In a new DB graph, create tags Parent and Child. Set Child's only Extends value to Parent.
  2. Convert Parent from a tag to an ordinary page. Child still extends Parent.
  3. Recycle the Parent page.
  4. Let the 30-day retention expire and ensure GC is due. In an isolated test, I simulated this by backdating Parent's :logseq.property/deleted-at by 31 days and setting :logseq.kv/recycle-last-gc-at to 0, with GC temporarily bypassed only during fixture preparation.
  5. Reopen the graph with the unmodified worker. Startup fails with the error above.

The synthetic graph passed read-only validation before GC. The attached fixture reproduces the failure without private graph data.

The following log is produced from the above steps: repro-worker.log

Expected Behavior

What happened

The graph stays on the loading screen and never becomes usable. The database worker exits during startup recycle GC with DB write failed with invalid data. Closing and reopening Logseq repeats the same failure, so the graph cannot be accessed through the UI to repair it.

What I would expect

Ideally, I would expect Logseq to load the graph normally. Refusing to load and function due to an operation taken 30 days ago is confusing.

Screenshots

No response

Desktop or Mobile Platform Information

Logseq DB 2.0.2, macOS 15.5 arm64, worker revision 533ac43.

The same issues have also appeared in my Windows host. Though the above diagnosis is done on my Mac.

Additional Context

Related issues i found are:

  • #1312: undo does not restore child tags' parents after deleting a parent tag.
  • #1424: page-to-block conversion leaves stale child references.

This report concerns a different chain: parent tag → ordinary page → recycle expiry → GC removes the child's only Extends target → graph startup fails. I did not find an existing report of this exact sequence.

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
    Contributor

    Thanks for the precise report and the steps, they reproduced on current master as written. The fix is in #13786:

    • converting a tag to a page now moves its child tags to their remaining parent (or Root);
    • the recycle GC does the same for any page it removes, so a graph already in this state opens again after the update, with Child extending Root;
    • a failing GC no longer blocks the graph from opening.
  2. GJCPP commented on Oct 28, 2026

    @GJCPP
    Author

    Hi, thanks for your feedback. Glad to know it's already fixed. I will close the issue now.

  3. 3 remaining items

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