Skip to content

Bug: Journal pages tagged with #Page cause permanent validation error — cannot be deleted or repaired #1378

Open
logseq/logseq
#13886

Description

@justjom

Search first

  • I searched and no similar issues were found

What Happened?

Summary

Two journal pages have become permanently corrupt with a validation error
that blocks all write operations including delete, making them impossible
to repair through any available tool (MCP API, CLI, EDN export).

Error message

[:db-invalid] {:msg "Validation errors", :errors
({:entity {:block/name "aug 14th, 2025" ...
:block/tags [{...} #{4 167} {:page-class-id 4, :all-page-class-ids #{3 4 2 167 168}}]},
:dispatch-key :normal-page,
:errors {36650 {:block/tags ["should not have other built-in page tags
when tagged with #Page"]}}}

Affected entities

Field Aug 14th Nov 24th
Entity ID 40497 44182
UUID 6ab3cdea-fe6c-4eda-ba44-a14e8bdb197e 6ab3cdf0-eb84-41d8-bbfb-d956264b2d7c
block/name aug 14th, 2025 nov 24th, 2025
block/tags [4 (#Page), 167 (#Journal)] [4 (#Page), 167 (#Journal)]

These pages have both #Page (id: 4) and #Journal (id: 167) as
block/tags simultaneously, which violates the constraint that a page
tagged with #Page cannot have other built-in page tags.

Reproduction

Unknown — the corruption was discovered during DB migration from
Logseq OG (markdown) to DB version.

Reproduce the Bug

All write operations are blocked by the same validation error:

  1. Logseq MCP API — delete_page and update_page timeout with
    Read timed out
  2. Logseq CLI — logseq remove page --id 40497 returns
    Failure(DB write failed with invalid data)
  3. CLI by name — logseq remove page --page "aug 14th, 2025" returns
    Error (page-not-found)
  4. EDN export — blocked by the same validation error
  5. Direct SQLite edit — not safe; the B-tree has multiple index
    trees (EAVT, AEVT, AVET) that must be updated atomically

The validation prevents any repair because every write path runs
validation first.

SQLite location of corrupted data

Relevant kvs table addresses:

  • 1056516 — contains block/tags for entity 40497 with both refs 4 and 167
  • 1057045 — contains block/tags for entity 44182 with ref 167
SELECT addr, substr(content,1,300) FROM kvs 
WHERE content LIKE '%40497%' AND content LIKE '%tags%';

Expected behavior

Either:

  • The CLI remove page --force should bypass validation and hard-delete
    the entity, or
  • A repair command should be available to remove invalid built-in tags
    from corrupt entities

Environment

  • Logseq desktop, macOS
  • DB graph migrated from Logseq OG (markdown)
  • Graph name: local DB graph

Related issues

Expected Behavior

Possibility to delete these pages. Export in EDN gives same error.

Screenshots

No response

Desktop or Mobile Platform Information

Logseq 2.0.1, MacOS 26.6.2 (25G83)

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. transferred this issue fromlogseq/logseqon Sep 29, 2026
  2. yuxi-liu-wired commented on Oct 29, 2026

    @yuxi-liu-wired

    Fixed in logseq/logseq#13911 (fix(storage, import): a failed store no longer leaves a graph that cannot reopen, batch rollback after commit, kv-store keeps keys, import page merges and #1378). Its description has the cause and the test that pins it; it fails on current master and passes with the fix.

  3. yuxi-liu-wired commented on Oct 30, 2026

    @yuxi-liu-wired

    The fix for this (with a reproduction: a journal file and a pages/ file for the same date, in either order) is now in logseq/logseq#13886; it moved there from #13911.

  4. added 4 commits that reference this issue on Oct 31, 2026
    a71e321
    f8a4117
    3fb69c3
    8ece0f2
  5. added 16 commits that reference this issue on Nov 11, 2026
    6b9002e
    202a00b
    0a49122
    2cf405e
    c90ee1f
    0dd29b0
    ffe2d75
    a618afa
    2c5cd18
    53552e4
    4096387
    427945d
    3c4ab64
    3207c0d
    ac31f61
    e489051
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