Repository navigation
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Description
After upgrading from 2026.5.7 to 2026.6.1 via openclaw update --yes, the
post-update openclaw doctor step fails. The npm install + global swap succeed;
the doctor verification fails; the gateway is restarted but plugin/task state
stores are broken. The same TypeError: statement.columns is not a function
appears across three independent state migrations.
Environment
- OS: macOS 25.3.0 (Darwin, arm64)
- Node: v23.9.0
- Install method: npm global
- Previous version: 2026.5.7
- Target version: 2026.6.1 (latest tag — just promoted from beta)
Steps to reproduce
- Have
openclaw@2026.5.7installed globally with state in~/.openclaw/ - Run
openclaw backup create - Run
openclaw update --dry-run(planned actions look normal) - Run
openclaw update --yes
Actual
Update Result: ERROR
Before: 2026.5.7
After: 2026.6.1
Steps:
✓ global update (7.09s)
✓ global install swap (1.95s)
✗ openclaw doctor (2.24s)
PluginStateStoreError: Failed to open the plugin state database.
openclaw plugins doctor shows the underlying cause:
- Failed migrating plugin install index /Users/<user>/.openclaw/plugins/installs.json:
TypeError: statement.columns is not a function
- Failed migrating task registry sidecar /Users/<user>/.openclaw/tasks/runs.sqlite:
TypeError: statement.columns is not a function
- Failed migrating task flow sidecar /Users/<user>/.openclaw/flows/registry.sqlite:
TypeError: statement.columns is not a function
Workaround
Downgrade to 2026.5.28 — migrations from 2026.5.7 → 2026.5.28 succeed cleanly.
npm install -g openclaw@2026.5.28
Possible cause
statement.columns() is a method on node:sqlite prepared statements
(Node 22.16+/23.x). Node 23.9.0 should have it, so either:
- The 2026.6.1 migration code is calling
.columns()against a non-node:sqlite
library (e.g. better-sqlite3 with a different API shape), or - The migration code in 2026.6.1 has a regression vs. 2026.5.28.
Happy to provide more logs or test a patch.
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon Jun 3, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 3, 2026, 5:01 PM ET / 21:01 UTC.
Summary
Keep open: current main still contains the same source-level hazard on the SQLite/Kysely path used by the reported post-upgrade migrations, and there is no merged fix or duplicate owner in the provided context.
Reproducibility: yes. from source, but not with a live Node 23.9 run in this checkout. If
StatementSynclackscolumns(), current main throws the reportedTypeErrorbefore the affected state migrations can write to SQLite.Next step
This is a narrow, valid repair candidate: the affected helper, migrations, and regression tests are clear, and no product decision is needed unless maintainers want to change the supported Node policy.
Review details
Best possible solution:
Centralize the compatibility fix in the
node:sqliteKysely execution layer or add an early clear runtime guard, then prove the plugin install index and task registry/flow migrations survive the upgrade path without reintroducing JSON runtime storage.Do we have a high-confidence way to reproduce the issue?
Yes from source, but not with a live Node 23.9 run in this checkout. If
StatementSynclackscolumns(), current main throws the reportedTypeErrorbefore the affected state migrations can write to SQLite.Is this the best way to solve the issue?
No implemented solution is present yet. The maintainable repair is a shared SQLite/Kysely compatibility fix or explicit runtime preflight, not three separate migration-specific fallbacks.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
StatementSynccompatibility test, because the local Node 24.16 runtime does exposecolumns()and therefore does not reproduce the failure by itself.Codex review notes: model gpt-5.5, reasoning high; reviewed against a0717ef61c77.
Label changes
Label changes:
P1: A reported latest-upgrade regression breaks post-update doctor and leaves plugin/task state migrations failing for a real npm global install.impact:session-state: The failure is in migration of OpenClaw-owned state stores, including task registry and task flow sidecars, into the shared state database.issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.clawsweeper:needs-live-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P1: A reported latest-upgrade regression breaks post-update doctor and leaves plugin/task state migrations failing for a real npm global install.impact:session-state: The failure is in migration of OpenClaw-owned state stores, including task registry and task flow sidecars, into the shared state database.Evidence reviewed
Acceptance criteria:
openclaw doctor --fixor upgrade-style migration proof on Node 23.9 or the lowest supported Node runtime after the patch.What I checked:
executeCompiledSqliteQuerySyncunconditionally callsstatement.columns()before deciding whether to callall()orrun(), so any supported runtime whosenode:sqlitestatement lacks that method fails before the SQL operation runs. (src/infra/kysely-sync.ts:31, a0717ef61c77)readPersistedInstalledPluginIndexSync/writePersistedInstalledPluginIndexSync, and those sync helpers read/write the shared SQLite state store. (src/infra/state-migrations.ts:1484, a0717ef61c77)runOpenClawStateWriteTransaction, matching two of the reporter's three failing migration warnings. (src/infra/state-migrations.ts:862, a0717ef61c77)ensureSchema, which usesexecuteSqliteQuerySyncto upsertschema_meta; this makes thestatement.columns()dependency part of state DB startup before the affected migrations can complete. (src/state/openclaw-state-db.ts:644, a0717ef61c77)StatementSyncwithoutcolumns(). (src/commands/doctor-state-migrations.test.ts:1230, a0717ef61c77)v2026.5.28..HEADaddssrc/infra/kysely-sync.tsand moves the installed plugin index from JSON-backed storage into shared SQLite, aligning with the reporter's downgrade-to-2026.5.28 workaround. (src/infra/kysely-sync.ts:1, 4f8740029a0d)Likely related people:
git blameandgit log -Spoint the current sync Kysely helper and the added migration/import paths to commit4f8740029a, which is the central post-2026.5.28 change implicated by the report. (role: introduced current SQLite migration/helper path; confidence: high; commits: 4f8740029a0d; files:src/infra/kysely-sync.ts,src/infra/state-migrations.ts,src/plugins/installed-plugin-index-store.ts)v2026.5.28is the reporter's working downgrade target, and history shows that tag as the last local release baseline before the sync helper and SQLite install-index migration changes. (role: adjacent release baseline contributor; confidence: medium; commits: e93216080aa1; files:src/plugins/installed-plugin-index-store.ts,src/infra/kysely-node-sqlite.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.fix(sqlite): support Node 23.0–23.10 runtimes lacking StatementSync.c…
fix(sqlite): support Node 23.0–23.10 runtimes lacking StatementSync.c…
Countermarch commentedon Jun 4, 2026
Additional
2026.6.1evidence for the plugin install index/shared SQLite migration path, from an upgrade where the migration did not throwstatement.columns is not a functionbut still left doctor in a non-clearable legacy-state warning.Environment
2026.6.1 (2e08f0f)npm install -g openclaw@2026.6.12026.5.28Observed behavior
After the package update and gateway restart,
openclaw doctor --lint --jsonreports:{ "checkId": "core/doctor/legacy-state", "severity": "warning", "message": "Plugin install index: <stateDir>/plugins/installs.json → shared SQLite state", "fixHint": "Run `openclaw doctor --fix` to migrate legacy state." }Gateway startup/health commands also print:
The suggested fix path does not clear the warning:
returned exit code
2with:Then:
returned exit code
1and still reported the samecore/doctor/legacy-statewarning.Why this seems related
The original issue covers
2026.6.1plugin install index migration into shared SQLite failing during upgrade. This is a second failure mode in the same migration/doctor surface:braveandcodex;plugins/installs.jsonin place;ok: falsewith a fix hint;Expected behavior: when the legacy plugin index cannot be safely migrated because shared SQLite state has conflicting plugin metadata, doctor should either clear the warning after a safe migration or report the exact manual/conflict-resolution step instead of leaving a non-clearing
Run openclaw doctor --fixhint.Additional verification
openclaw secrets audit --jsongating counts remained clean: plaintext0, unresolved refs0, shadowed refs0.openclaw plugins list --jsonshowed thebraveandcodexglobal plugin entries loaded from the local OpenClaw npm plugin directory while the migration continued reporting conflicting metadata.Redactions: replaced local absolute paths with
<stateDir>and omitted account names, private workspace names, hook URLs, and local user paths.fix(sqlite): support Node 23.0–23.10 runtimes lacking StatementSync.c…
sjf commentedon Jun 9, 2026
Node 23 was EOL'd in 2025, the fix for this issue is to either switch to an LTS version of node (22 or 24), or update to the latest version of node (26).
fix(sqlite): support Node 23.0–23.10 runtimes lacking StatementSync.c…