Skip to content

[Bug]: Misleading SQLite compatibility error when Node is built with shared SQLite #106933

Closed

Description

@montajebii

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

OpenClaw reports that "Node 24.18.0 embeds SQLite 3.46.1" even when the Node runtime reports process.versions.sqlite = 3.53.2 and is using a shared system SQLite library.

Steps to reproduce

  1. Install OpenClaw 2026.7.1 globally with npm.

  2. Run openclaw.

  3. Observe the startup failure.

  4. Compare:

    • node -p "process.versions.sqlite"
    • SELECT sqlite_version() via node:sqlite
  5. Observe that process.versions.sqlite reports 3.53.2 while sqlite_version() reports 3.46.1, but the OpenClaw error states "Node 24.18.0 embeds SQLite 3.46.1".

Expected behavior

The startup error should accurately describe the detected runtime configuration. When Node is built with node_shared_sqlite=true, the diagnostic should distinguish the shared runtime SQLite library from Node's reported SQLite version instead of stating that Node embeds the runtime version.

Actual behavior

OpenClaw fails to start with:

SQLite support is unavailable or unsafe in this Node runtime.

The diagnostic reports:

Node 24.18.0 embeds SQLite 3.46.1

Observed diagnostics on the same system:

node -p "process.versions.sqlite"
3.53.2
node:sqlite
SELECT sqlite_version()
3.46.1
node -p "process.config.variables.node_shared_sqlite"
true

The reported embedded SQLite version does not match the value reported by process.versions.sqlite.

OpenClaw version

OpenClaw 2026.7.1 (2d2ddc4)

Operating system

Kali Linux Rolling

Install method

Global npm installation

Model

mistral-medium-3.5

Provider / routing chain

opencalw -> FreeLLMAPI -> mistral-medium-3.5

Additional provider/model setup details

No response

Logs

Config health-state write failed: SQLite support is unavailable or unsafe in this Node runtime.

OpenClaw requires SQLite 3.51.3+ (or patched 3.50.7+/3.44.6+) for WAL safety; Node 24.18.0 embeds SQLite 3.46.1, which is affected by the upstream WAL-reset database corruption bug.

Stack:
Error: SQLite support is unavailable or unsafe in this Node runtime.
    at requireNodeSqlite (...)
    at repairOpenClawStateDatabaseSchema (...)

Screenshots, recordings, and evidence

$ node -v
v24.18.0

$ node -p "process.versions.sqlite"
3.53.2

$ node -e '
import("node:sqlite").then(({DatabaseSync}) => {
const db = new DatabaseSync(":memory:");
console.log(process.versions.sqlite);
console.log(db.prepare("SELECT sqlite_version() AS v").get().v);
});
'

3.53.2
3.46.1

$ node -p "process.config.variables.node_shared_sqlite"
true

$ sqlite3 --version
3.46.1

$ ldd /usr/bin/node | grep sqlite
libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0

Impact and severity

  • Affected users/systems/channels: Observed on Kali Linux Rolling using a Node.js build configured with node_shared_sqlite=true.
  • Severity: Blocks OpenClaw startup on the tested system.
  • Frequency: Reproduced consistently on every launch.
  • Consequence: OpenClaw cannot start. The diagnostic may make troubleshooting more difficult because it describes the runtime SQLite version as an embedded Node version rather than a shared system library.

Additional information

The SQLite safety check appears to be functioning as intended by validating the runtime SQLite version returned by SELECT sqlite_version().

This report is about the wording of the diagnostic. On systems where Node is built with node_shared_sqlite=true, the message states that Node "embeds" the runtime SQLite version, whereas the runtime is using a shared system SQLite library.

Activity

  1. added
    bug
    on Jul 14, 2026
  2. clawsweeper commented on Jul 14, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 13, 2026, 9:10 PM ET / July 14, 2026, 01:10 UTC.

    Summary
    Keep open: the v2026.7.1 evidence demonstrates a concrete diagnostic bug, and no merged related fix or current-main replacement is identified. The runtime safety rejection appears intentional, but describing a dynamically linked system SQLite library as embedded by Node is inaccurate and can misdirect remediation.

    Likely related people: steipete is the best available routing candidate from SQLite state and release history, with low confidence because exact helper-level provenance remains uncertain.

    Reproducibility: yes. at the shipped/source level: the supplied v2026.7.1 transcript proves a shared SQLite build where the loaded runtime version differs from process.versions.sqlite, yet the diagnostic calls that library embedded. A live current-main run was not established.

    Next step
    The defect, non-goals, likely helper, and focused validation boundary are concrete enough for one repair PR.

    Review details

    Best possible solution:

    Keep the runtime SQLite safety check based on the version returned by the loaded database engine, but format the error as shared system SQLite when node_shared_sqlite is true and as embedded SQLite otherwise, with focused tests for both branches.

    Do we have a high-confidence way to reproduce the issue?

    Yes at the shipped/source level: the supplied v2026.7.1 transcript proves a shared SQLite build where the loaded runtime version differs from process.versions.sqlite, yet the diagnostic calls that library embedded. A live current-main run was not established.

    Is this the best way to solve the issue?

    Yes—the narrowest maintainable fix is to correct only the provenance wording while retaining the loaded-runtime version check and its fail-closed safety behavior.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Exact helper-level authorship and current-main line provenance remain uncertain.
    • The test must model both embedded and shared SQLite builds without changing the existing fail-closed WAL safety decision.

    Codex review notes: model internal, reasoning high; reviewed against dbf48c0df94d.

    Label changes

    Label justifications:

    • P2: This is a narrow, consistently reproducible diagnostic bug with limited platform scope; the underlying safety rejection remains correct.
    • impact:ux-friction: The inaccurate embedded-library wording sends affected Linux users toward the wrong runtime remediation path.
    Evidence reviewed

    Acceptance criteria:

    • pnpm test src/memory/sqlite.test.ts
    • pnpm check:changed -- src/memory/sqlite.ts src/memory/sqlite.test.ts
    • git diff --check

    What I checked:

    • Shipped reproduction: On v2026.7.1, process.versions.sqlite reports 3.53.2 while SELECT sqlite_version() reports the loaded shared library version 3.46.1; the diagnostic incorrectly says Node embeds 3.46.1. (2d2ddc43d0dc)
    • Shared-library proof: The report shows process.config.variables.node_shared_sqlite=true and ldd resolving libsqlite3.so.0, directly contradicting the diagnostic's embedded-library wording.
    • Current repair boundary: The requireNodeSqlite helper is the central SQLite availability and safety diagnostic owner; the fix should change diagnostic provenance wording without weakening its runtime-version safety check. (src/memory/sqlite.ts, dbf48c0df94d)
    • Discussion assessment: The previous ClawSweeper review independently classified the report as a narrow source-reproducible diagnostic defect and kept it open for a focused repair.
    • No canonical fix identified: The supplied GitHub context contains no closing or referencing pull request; the two linked SQLite issues concern missing node:sqlite and FTS5 diagnostics rather than shared-library provenance wording. (dbf48c0df94d)

    Likely related people:

    • steipete: Recent release and state-database history repeatedly connects this person to SQLite-heavy runtime work, making them the best available routing candidate; exact ownership of requireNodeSqlite remains uncertain. (role: recent SQLite state and release contributor; confidence: low; commits: 2d2ddc43d0dc; files: src/memory/sqlite.ts, src/state/openclaw-state-db.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  3. added
    P2
    impact:ux-friction
    no-stale
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    clawsweeper:queueable-fix
    clawsweeper:fix-shape-clear
    on Jul 14, 2026
  4. locked as resolved and limited conversation to collaborators on Sep 2, 2026
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

    P2bugclawsweeper:fix-shape-clearclawsweeper:queueable-fixclawsweeper:source-reproimpact:ux-frictionissue-rating: 🦞 diamond lobsterno-stale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions