Skip to content

2026.7.1 startup-migration gate is fatal, but the repair path (openclaw doctor) doesn't resolve the conflict — gateway crash-loops with no documented remedy #107227

Closed

Description

@Marvinthebored

2026.7.1 startup-migration gate is fatal, but the repair path (openclaw doctor) doesn't resolve the conflict — gateway crash-loops with no documented remedy

Summary

Upgrading a long-lived install to 2026.7.1 left the gateway refusing to start, crash-looping under launchd, with:

[openclaw] Reason: OpenClaw startup migrations did not complete cleanly; refusing to report the gateway ready.
- Left plugin install index in place because shared SQLite state has conflicting plugin install metadata for: deepseek, firecrawl, perplexity, qwen
- Left legacy update-check state in place because shared SQLite state already differs: /Users/.../.openclaw/update-check.json
- Left legacy config health state in place because 1 entry conflicts with shared SQLite state: /Users/.../.openclaw/logs/config-health.json
[openclaw] Try: openclaw doctor

The error directs the user to openclaw doctor, but doctor --fix does not resolve these conflicts — it reconciles other state (auth-profile SQLite, config) and leaves the plugin-install-index / legacy-state conflicts exactly as-is, so the gateway keeps failing the gate. There is no documented or automated way to complete the migration; the only fix I found was manually moving the conflicting legacy JSON files aside.

2026.7.1 intentionally makes an unclean migration fatal ("gateway crashes stop restarting forever / stable repair path"). The problem isn't the gate — it's that the advertised repair path doesn't repair, and three secondary issues make recovery worse (below).

Environment

  • OpenClaw 2026.7.1 (2d2ddc4), upgraded from 2026.6.11 via openclaw update (npm, stable).
  • macOS (Darwin 24.6.0), Node 25.9.0, npm-global, gateway under launchd (KeepAlive).
  • Long-lived install: the state dir has ~/.openclaw/plugins/installs.json, ~/.openclaw/update-check.json, ~/.openclaw/logs/config-health.json accumulated across many prior versions — these predate the new shared-SQLite store and conflict with the entries the migration wrote into it.

The core bug

  1. Startup migration finds legacy JSON state that conflicts with the new shared-SQLite store → it "leaves the legacy state in place" and marks the migration incomplete.
  2. The incomplete migration trips the fatal readiness gate → gateway never reports ready → launchd respawns it every ~13s (crash loop).
  3. The error says "Try: openclaw doctor", but openclaw doctor --fix does not reconcile the plugin-install-index or legacy-state conflicts — they persist verbatim across repeated doctor --fix runs.

Expected: doctor --fix (or openclaw update repair) should resolve legacy-vs-SQLite conflicts — e.g. adopt one side deterministically, or offer a --force-adopt-sqlite / --reset-legacy-state path — or the error should name the exact files to move and the command to run. Right now the user is told to run a tool that can't fix it, with no next step.

Three secondary issues that make recovery worse

  • b1. Stale migration lease-lock under crash-loop. Once looping, starts begin failing with a different error:
    OpenClaw startup migrations are already running for this state directory; retry after <timestamp>.
    
    The launchd respawns contend the migration lease and effectively keep it held, so it never clears within the respawn cycle. Recovery requires fully unloading the service (launchctl bootout) and waiting out the lease before a single clean start.
  • b2. doctor --fix restarts the crash-looping gateway mid-repair. Running doctor --fix to repair the loop re-bootstraps/restarts the LaunchAgent, re-arming the crash loop and lease contention while you're trying to diagnose. A repair command shouldn't restart the unhealthy service without first resolving the cause.
  • b3. "Stable repair path" still thrashes. The release notes describe repeatedly-failing gateways leaving "a stable repair path instead of restarting indefinitely," but in practice launchd KeepAlive respawned the failing process every ~13s indefinitely until manually booted out.

Workaround

launchctl bootout gui/$UID/ai.openclaw.gateway         # stop the crash loop
# move the conflicting legacy state aside (regenerable caches):
mv ~/.openclaw/plugins/installs.json      ~/.openclaw/plugins/installs.json.bak
mv ~/.openclaw/update-check.json          ~/.openclaw/update-check.json.bak
mv ~/.openclaw/logs/config-health.json    ~/.openclaw/logs/config-health.json.bak   # if present
# wait out the migration lease, then ONE clean start:
openclaw gateway restart

After this the migration completes against the SQLite store and the gateway comes up.

Impact / notes

The conflicting legacy files come from a long-lived install, which most users won't have — so the trigger is niche. But the failure mode (fatal gate + a repair path that can't repair + a crash loop that holds its own lease) is a rough first-run experience for exactly the upgrade-from-old-version case the migration exists to serve. Making doctor --fix actually reconcile these, or naming the files in the error, would resolve it.

Activity

  1. darealgege commented on Jul 14, 2026

    @darealgege

    Additional context: Node version mismatch (nvm vs system) compounds the issue

    I encountered the same problem today on an Ubuntu 22.04 system, but with an additional complication that made diagnosis harder.

    Environment

    • OpenClaw 2026.7.1 (2d2ddc4), upgraded from 2026.6.11
    • Ubuntu 22.04 (AWS EC2)
    • Two Node versions in play:
      • System Node: v26.5.0 (/usr/bin/node) — used by systemd service
      • nvm Node: v24.18.0 (~/.nvm/versions/node/v24.18.0/bin/node) — used by openclaw chat TUI

    What happened

    1. Ran openclaw update (which uses system Node v26.5.0)
    2. Gateway failed to start with startup migrations did not complete cleanly
    3. Tried openclaw doctor --fix — it ran but did NOT resolve the plugin-install-index conflict
    4. Meanwhile, openclaw chat (TUI) auto-started its own gateway instance using nvm Node v24.18.0
    5. This created a migration lease lock that blocked the systemd service from starting
    6. Got stuck in a crash loop with alternating errors:
      • migrations did not complete cleanly
      • migrations are already running for this state directory; retry after

    The Node version problem

    The systemd service uses /usr/bin/node (v26.5.0), but the TUI (openclaw chat) uses the nvm Node (v24.18.0). These two instances were competing for the same migration lease, and the different Node versions may have contributed to the SQLite migration inconsistency.

    Suggestion: The openclaw update command should warn if multiple Node versions are detected, or the systemd service should explicitly use the same Node binary as the CLI.

    Workaround that worked

    1. Stop ALL openclaw processes (both systemd and TUI)
    2. Wait for migration lease to expire (check logs for timestamp)
    3. Manually move conflicting legacy files aside
    4. Start gateway cleanly

    Suggestions for improvement

    1. doctor --fix should handle plugin-install-index conflicts — currently it silently skips them
    2. Error message should name the exact files to move, not just say Try: openclaw doctor
    3. Migration lease should be cleared when the owning process dies unexpectedly
    4. Detect multiple Node versions and warn during update/install
  2. shao-zhijie commented on Jul 14, 2026

    @shao-zhijie

    Three additional data points from a parallel macOS / launchd install hitting the same gate, which I think are independent of the cases already discussed and may help triangulate the bug.

    1. state_leases.expires_at field is unit-inconsistent — the 5-min wait is a lie

    I hit the same lease lock you described, but the suggested retry after 2026-07-14T09:45:20.221Z is not actually 5 minutes away. Inspecting state_leases in ~/.openclaw/state/openclaw.sqlite:

    SELECT scope, lease_key, owner, expires_at FROM state_leases WHERE scope='startup-migrations';
    -- scope               lease_key  owner                                 expires_at
    -- startup-migrations  global     2d5f0923-69e6-4e5e-af83-b116a1468e86  1784022320221

    date -u -r 1784022320221 decodes as Sat Jun 2 11:37:01 UTC 58503, not 2026-07-14. Looks like the field is being written as Date.now() (ms since epoch) but the migration gate compares it as seconds, so the effective wait is on the order of ~5×10¹² seconds. The "wait 5 minutes" guidance in the error message is misleading because the value isn't actually a 5-minute timeout — it's an overflowed/unconverted ms timestamp.

    My workaround was DELETE FROM state_leases WHERE scope='startup-migrations'; after the legacy JSON was moved aside.

    2. macOS launchd plist ships with StandardErrorPath = /dev/null — users see exit-1 with no real error

    ~/Library/LaunchAgents/ai.openclaw.gateway.plist has:

    <key>StandardErrorPath</key>
    <string>/dev/null</string>

    so the gateway's crash-loop only shows launchctl list exit code 1 and a 15 MB gateway.log full of repeated Doctor warnings boxes. The real failure (Reason: OpenClaw startup migrations did not complete cleanly…) only appears in gateway.err.log once I edited the plist to write stderr to a real file and reloaded. Every macOS-launchd user hitting this gate is going to spend 10+ minutes chasing the "Doctor warnings" loop before realizing the actual error is somewhere else entirely.

    Suggest: ship a plist template that writes both stdout and stderr to dated rotated files, and include a "first start failed — run openclaw doctor then check ~/Library/Logs/openclaw/gateway.err.log" hint in the launchd KeepAlive output.

    3. simdjson ABI breaks openclaw CLI after the 7.1 upgrade — secondary failure that masks the real one

    Once I started looking for a way to run openclaw doctor to inspect state, the CLI itself crashed before doing anything:

    dyld: Library not loaded: /opt/homebrew/opt/simdjson/lib/libsimdjson.30.dylib
      Referenced from: /opt/homebrew/Cellar/node/25.7.0/bin/node
      Reason: tried: '/opt/homebrew/Cellar/simdjson/4.6.4/lib/libsimdjson.30.dylib' (no such file)
    

    Root cause:

    • Homebrew upgraded simdjson from a version shipping libsimdjson.30.dylib to 4.6.4 which only ships libsimdjson.33.dylib
    • /opt/homebrew/bin/node is symlinked to node@25 (25.7.0), whose binary is linked against libsimdjson.30
    • openclaw CLI uses #!/usr/bin/env node → picks the default node → dyld crash
    • The gateway process itself was unaffected because the launchd plist invokes /opt/homebrew/opt/node@24/bin/node directly — but the CLI wrapper doesn't honor that, and that's the same wrapper the user is told to run when the gateway is down

    The OpenClaw package.json engines field already restricts to >=22.22.3 <23 || >=24.15.0 <25 || >=25.9.0, but the CLI wrapper doesn't honor any of that — it just uses the first node on PATH. The fix is either:

    • pin a Node major in the openclaw package's optional bin script (or add a bin shim that resolves node at install time), or
    • document the workaround clearly: PATH="/opt/homebrew/opt/node@24/bin:$PATH" openclaw … for the duration of the simdjson mismatch window.

    This is independently a Homebrew / simdjson ABI issue, but for OpenClaw users it has the nasty property of preventing openclaw doctor from running at all, which is the very command the startup-migration error tells you to run.

    Workaround (full path, for the issue body / FAQ)

    # 1. Run the CLI with a node that can find simdjson
    export PATH="/opt/homebrew/opt/node@24/bin:$PATH"
    
    # 2. Force-refresh the SQLite install index
    openclaw plugins registry --refresh
    
    # 3. Move the conflicting legacy JSON aside (this is what the gate is blocking on)
    mv ~/.openclaw/plugins/installs.json \
       ~/.openclaw/plugins/installs.json.migrated-$(date +%Y%m%d-%H%M%S)
    
    # 4. Clear the broken startup-migrations lease
    sqlite3 ~/.openclaw/state/openclaw.sqlite \
      "DELETE FROM state_leases WHERE scope='startup-migrations';"
    
    # 5. Bounce the gateway
    launchctl bootout gui/$(id -u)/ai.openclaw.gateway
    launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist
    
    # 6. (Recommended) Make stderr observable next time
    # Edit ~/Library/LaunchAgents/ai.openclaw.gateway.plist
    #   <key>StandardErrorPath</key>
    #   <string>/Users/bellabot/Library/Logs/openclaw/gateway.err.log</string>

    Confirmed working on macOS 26.5, OpenClaw 2026.7.1 (2d2ddc4), upgrading from 2026.6.5, conflicting plugins were brave, email, feishu. Different set from the OP and from @darealgege, in case that helps the pattern. FTR: this is a long-lived install too — the state dir has been around since 2025 and has been through many OpenClaw upgrades.

    For the lease specifically: @darealgege's hypothesis is dual-Node racing, which fits a Linux/multi-version install but not mine (only one Node is involved here — the 5-min wait just never elapses because the timestamp is unit-mismatched). If the gate is supposed to bound how long the lease is held, the bound itself appears to be broken in the ms-vs-seconds path.

  3. added
    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.
    impact:crash-loopCrash, hang, restart loop, or process-level availability failure.
    impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on Jul 14, 2026
  4. 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 14, 2026, 9:22 AM ET / 13:22 UTC.

    Summary
    Keep open for a narrow maintainer verification pass: merged pull request #107002 appears to address the central SQLite-authoritative migration dead end on current main, but the exact three-source state reported here has not been replayed, the fix is not in v2026.7.1, and the lease/service-restart observations remain separate concrete claims that should not be silently discarded.

    Reproducibility: yes. at source and shipped-release evidence level: multiple users report the same v2026.7.1 warning-to-readiness-failure path, and the merged convergence work confirms that these legacy-state warnings controlled startup. A current-main exact-state replay is still missing.

    Next step
    Do not queue another fix PR yet: a broad candidate fix is already merged, and the next action is maintainer-owned exact-state verification plus a decision on whether surviving secondary symptoms need separate canonical issues.

    Maintainer decision needed

    • Question: Does current main at or after 4da0eb1 converge the exact plugin-install, update-check, and config-health conflict combination reported here, including a clean second Doctor/startup run?
    • Rationale: The broad migration policy has already been selected and merged, but available proof covers representative convergence scenarios rather than this exact release state; closure would otherwise risk discarding concrete secondary outage evidence.
    • Likely owner: steipete — This person carried the merged cross-surface convergence implementation and is best positioned to judge whether its proof covers this exact state combination.
    • Options:
      • Replay then close (recommended): Run an exact copied-state two-pass Doctor and gateway-start replay, close if clean, and split any surviving lease or service-loop defect into a narrower issue.
      • Keep as release tracker: Keep this issue open until the convergence fix ships and an affected stable installation confirms recovery without manual file or database edits.
    Review details

    Best possible solution:

    Replay a copied v2026.7.1 state containing conflicting plugin-install, update-check, and config-health sources against current main, confirm Doctor converges and a second gateway start is clean, then close this issue while splitting any independently reproducible lease-expiry or service-restart defects into narrow canonical reports.

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

    Yes at source and shipped-release evidence level: multiple users report the same v2026.7.1 warning-to-readiness-failure path, and the merged convergence work confirms that these legacy-state warnings controlled startup. A current-main exact-state replay is still missing.

    Is this the best way to solve the issue?

    Yes in direction: one SQLite-authoritative convergence policy shared by Doctor and startup is safer than file-specific manual workarounds or new force flags. The remaining step is exact upgrade proof and separate handling of any lease or service-supervisor defect that survives it.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The apparent fix is current-main-only; users remaining on v2026.7.1 can still encounter the reported upgrade outage.
    • Current main intentionally keeps genuinely divergent plugin metadata fail-closed, so an exact replay is needed to prove this report's conflicts are recognized as safely superseded rather than still blocking.
    • The reported lease-expiry, Doctor-triggered restart, and launchd respawn behavior were not part of the documented scope of the merged convergence fix and may require narrower follow-up issues if reproduced.

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

    Label changes

    Label changes:

    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.
    • remove clawsweeper:needs-product-decision: Current issue advisory state no longer selects this label.

    Label justifications:

    • P0: The reported stable upgrade leaves the gateway unusable under service supervision and requires manual service, file, and possibly database intervention to recover.
    • impact:crash-loop: Gateway startup repeatedly exits because migration warnings fail the readiness gate while launchd or systemd restarts the process.
    • impact:ux-release-blocker: Affected upgrading users have no effective in-product recovery path; the advertised Doctor action does not resolve v2026.7.1 and recovery requires terminal commands and internal state knowledge.
    Evidence reviewed

    Acceptance criteria:

    • Run Doctor with --fix against a copied v2026.7.1 state containing conflicting plugins/installs.json, update-check.json, and logs/config-health.json while canonical SQLite rows already exist.
    • Run Doctor a second time and verify the same migration warnings do not recur.
    • Start the gateway under the relevant service supervisor and verify readiness succeeds without repeated restarts or a lingering startup-migrations lease.
    • Verify archive/retirement failures remain blocking and visible rather than being downgraded to notices.

    What I checked:

    • Reported release failure: Three independent upgrade reports describe v2026.7.1 refusing gateway readiness after legacy-versus-SQLite conflicts, with Doctor repeating the same conflicts and recovery requiring manual service and state-file intervention. (2d2ddc43d0dc)
    • Merged convergence fix: Merged pull request fix(state): converge legacy startup migrations #107002 separates non-blocking notices from blocking warnings and states that it converges safely superseded state-directory, update-check, plugin-install, Matrix, Memory Core, and Codex migration sources while preserving real conflicts as warnings. (src/infra/state-migrations.doctor.ts:803, 4da0eb19c570)
    • Plugin conflict handling changed: The merged fix changes the plugin-install conflict path and includes focused review around preserving archive-operation failures rather than treating every legacy/SQLite mismatch as an unrecoverable startup blocker. (src/infra/state-migrations.plugin-state.ts:235, 4da0eb19c570)
    • Regression coverage exists: The convergence change added focused Doctor migration coverage and reported a two-run scenario where the first run retired acknowledged residue and the second run was clean, but the available proof does not identify an exact replay of this issue's plugin, update-check, and config-health combination. (src/commands/doctor-state-migrations.test.ts:397, 4da0eb19c570)
    • Release provenance: The latest release v2026.7.1 points to 2d2ddc4 and was published before the convergence fix merged, so affected stable users do not yet have the apparent main-branch repair. (CHANGELOG.md, 2d2ddc43d0dc)
    • Repository direction: VISION.md prioritizes bug fixes, stability, setup reliability, and first-run UX, and states that Doctor should detect, explain, back up, and rewrite incompatible owned state into the canonical form. (VISION.md:250, a9316bc65ff9)

    Likely related people:

    • steipete: Carried and merged the cross-surface legacy startup-migration convergence change that directly overlaps the reported plugin, update-check, Doctor, and readiness behavior. (role: feature-history owner and likely follow-up owner; confidence: high; commits: 4da0eb19c570, eafe2a8d0bb6, 0d981095d430; files: src/infra/state-migrations.doctor.ts, src/infra/state-migrations.plugin-state.ts, src/infra/state-migrations.update-check.ts)
    • vincentkoc: Recent merged history touched the same SQLite migration, archive, Doctor, and plugin install-index surfaces, and the predecessor canonical issue was assigned to this person. (role: recent state-migration contributor; confidence: high; commits: 5cebe9666790, 6326395c0ae4, 7485dd649262; files: src/infra/state-migrations.doctor.ts, src/infra/state-migrations.debug-proxy.ts, src/commands/doctor-state-migrations.test.ts)
    • obviyus: Authored the predecessor convergence work establishing notices, numbered archives, and blocking warnings only for real retirement failures. (role: adjacent convergence-policy contributor; confidence: high; commits: 0d41316bcc34, 709855d623b2, a00d175b0d32; files: src/infra/state-migrations.doctor.ts, src/commands/doctor-state-migrations.test.ts, src/plugins/doctor-state-migration-fs.ts)
    • sallyom: Recent history introduced the readiness path that makes remaining migration warnings block gateway startup, so this person is relevant to validating the gate and service behavior. (role: startup readiness contributor; confidence: medium; commits: b81666ca6af2; files: src/commands/doctor-config-preflight.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.
  5. added
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    and removed
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on Jul 14, 2026
  6. pfrederiksen commented on Jul 14, 2026

    @pfrederiksen
    Contributor

    Additional data point: 2026.7.1 migration gate remains fatal after plugin-state workaround; hit Memory Core conflicts, then a state-dir migration false/stale blocker.

    Environment

    • OpenClaw 2026.7.1 (2d2ddc4)
    • Linux/systemd user service
    • Service: ~/.config/systemd/user/openclaw-gateway.service
    • Command: /usr/bin/node /usr/lib/node_modules/openclaw/dist/index.js gateway --port 18789
    • State/config path: /root/.openclaw

    Summary

    The plugin/update-check/config-health workaround was not sufficient for this install. There appear to be at least two additional unresolved migration-gate cases:

    1. Memory Core legacy per-agent SQLite conflicts vs canonical SQLite rows.
    2. A remaining fatal State dir migration skipped: target already exists (/root/.openclaw) warning even though no ~/.clawdbot / ~/.moltbot legacy dirs exist and grep found no related config/env references.

    Initial status

    openclaw gateway status --deep --require-rpc showed:
    text
    Runtime: stopped (state activating, sub auto-restart, last exit 1, reason 1)
    Read probe: failed
    gateway closed (1006 abnormal closure (no close frame)): no close reason
    Service is loaded but not running (likely exited immediately).

    First blocker after applying the plugin/update-check workaround

    After moving the known conflicting legacy files aside, the gateway still crash-looped. Journal showed:
    text
    Reason: OpenClaw startup migrations did not complete cleanly; refusing to report the gateway ready.
    State dir migration skipped: target already exists (/root/.openclaw). Remove or merge manually.
    Skipped Memory Core legacy memory index import for agent researcher because legacy rows could not be imported: Error: legacy memory chunks rows conflict with canonical memory index rows
    Skipped Memory Core legacy memory index import for agent email-agent because legacy rows could not be imported: Error: legacy memory chunks rows conflict with canonical memory index rows
    ...
    This repeated for many agents.

    Memory Core workaround attempted

    Found per-agent legacy SQLite files:
    text
    /root/.openclaw/agents//agent/openclaw-agent.sqlite
    /root/.openclaw/agents//agent/openclaw-agent.sqlite-wal
    /root/.openclaw/agents//agent/openclaw-agent.sqlite-shm
    Archived those per-agent openclaw-agent.sqlite* files, leaving /root/.openclaw/state/openclaw.sqlite untouched.

    After that, the Memory Core conflict disappeared.

    Remaining fatal blocker

    Gateway still refuses to start with only:
    text
    Reason: OpenClaw startup migrations did not complete cleanly; refusing to report the gateway ready.
    State dir migration skipped: target already exists (/root/.openclaw). Remove or merge manually.
    Run "openclaw doctor --fix" against the mounted state/config, then restart the container.
    openclaw doctor --fix did not clear this.

    Checked for legacy dirs/config/env

    No legacy dirs found:
    bash
    ls -ld ~/.clawdbot ~/.moltbot ~/.openclaw 2>/dev/null
    Output:
    text
    drwx------ 64 root root 20480 Jul 14 15:01 /root/.openclaw
    No relevant config/env references found:
    bash
    grep -RInE "clawdbot|moltbot|CLAWD|MOLT|OPENCLAW_HOME|OPENCLAW_STATE|OPENCLAW_DIR|state dir"
    ~/.openclaw/openclaw.json
    ~/.openclaw/gateway.systemd.env
    ~/.config/systemd/user/openclaw-gateway.service
    ~/.config/systemd/user/openclaw-gateway.service.d 2>/dev/null
    Output: no matches.

    Runtime env only showed:
    text
    OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS=1

    Current state

    Downgrading to Beta6 got me moving.

  7. pfrederiksen commented on Jul 14, 2026

    @pfrederiksen
    Contributor

    Follow-up on this same Linux/systemd install: it is now running successfully on OpenClaw 2026.7.1.

    Recovery sequence after my earlier comment:

    • I first downgraded to Beta6 to restore service.
    • Before retrying 2026.7.1, I upgraded Node from 22.22.2 to 24.18.0 because the 2026.7.1 package requires Node >=22.22.3.
    • I then installed 2026.7.1 and restarted the systemd user gateway.
    • The gateway now starts cleanly; configuration validation and host ops/health checks pass. Multiple subsequent gateway restarts have reached gateway ready, and the previous State dir migration skipped: target already exists fatal error no longer appears.

    Important caveat: I cannot attribute the migration recovery to the Node upgrade. The Node change removed a separate runtime-version blocker, while the intervening Beta6 downgrade/re-upgrade and prior archival of conflicting per-agent SQLite files mean this sequence does not isolate which step cleared the remaining state-dir migration gate. Still, this confirms the same long-lived state directory can subsequently boot 2026.7.1 without deleting /root/.openclaw.

  8. maxatv commented on Jul 14, 2026

    @maxatv

    Additional data point: amazon-bedrock plugin-install-index conflict on Amazon Linux 2023 / systemd — same fatal gate, same non-repairing doctor

    Adding another concrete repro to the pile. Same core failure mode as OP; different plugin (amazon-bedrock) and Linux distro.

    Environment

    • OpenClaw 2026.7.1, upgraded from 2026.6.11 (npm-global, stable)
    • Amazon Linux 2023 (kernel 6.1.x), AWS EC2 t3a.small
    • Gateway under user-scope systemd (~/.config/systemd/user/openclaw-gateway.service)
    • Node runtime: v22.22.2 under nvm (pre-upgrade); confirmed 7.1's engines also enforced >=22.22.3, which surfaced before the migration gate (see below)
    • Long-lived install: legacy ~/.openclaw/plugins/installs.json present, carries an amazon-bedrock metadata row that has been emitting the state-migrations warning as benign since the 6.1 upgrade in early June — never blocking until 7.1.

    Sequence

    1. openclaw update --tag 2026.7.1 --yes. npm global swap succeeded (19.7s global update + 2.07s install swap). Doctor then refused with the Node minimum error; the automatic rollback did not roll back the on-disk npm package, so openclaw --version under Node 22.22.2 became unrunnable.
    2. nvm install 22.22.3 && nvm alias default 22.22.3 && npm install -g openclaw@2026.7.1 && openclaw gateway install --force. Gateway started briefly, then began systemd-restart-looping with:
      [openclaw] Reason: OpenClaw startup migrations did not complete cleanly;
      refusing to report the gateway ready.
      - Left plugin install index in place because shared SQLite state has
        conflicting plugin install metadata for: amazon-bedrock
      
      No other conflicts — just the one plugin, unlike OP's four-plugin list. Same fatal gate.
    3. openclaw doctor --fix ran twice. On the first pass it did useful work: migrated Memory Core legacy memory index → per-agent SQLite (108 sources, 1029 chunks, 939 cache rows), archived a legacy config-health.json. Reported success. Both runs left the amazon-bedrock plugin-install-index conflict identical. Warning re-emitted verbatim on next startup.
    4. openclaw plugins update amazon-bedrock (advanced to a 7.1-compatible plugin version). Fatal warning unchanged — the conflict is on the install-index metadata rows, not the plugin version.
    5. Manual openclaw gateway start bypassing systemd. Hit the state-migrations lease lock (retry after 2026-07-14T...Z) from the earlier failed restart cascade, and even after the lease expired the amazon-bedrock warning re-triggered the fatal gate.
    6. Stopped after three in-place recovery attempts under an internal three-strike stop-the-rotation rule. Rolled back via EBS snapshot restore to the pre-upgrade 6.11 volume. Gateway [ready] on 6.11 within ~90s of instance start, and a real end-to-end Telegram round-trip completed 47s later confirming the rollback was clean.

    Two secondary findings from this repro

    a. Node minimum bump (22.22.3) is not release-note-flagged as breaking. It's real and enforced by engines, but only visible AFTER npm has already swapped the global install to 7.1. On systemd-managed installs the automatic rollback re-invokes 7.1's binary against the old Node and cannot even reach --version. Recommend either (i) a pre-flight engines.node probe in openclaw update that refuses the swap if the active Node version is below the target's minimum, or (ii) at minimum, flag node: >=22.22.3 under "Breaking" in the release notes — a patch-bump Node minimum silently arriving in a .1 release is a foot-gun. Matches @pfrederiksen's Node 22.22.2 → 24.18.0 note above (his Node change was mandatory before he could re-attempt 7.1 at all).

    b. Long-tail benign warnings promoted to fatal on major-era jumps. The amazon-bedrock plugin-install-index row that killed this upgrade has been sitting untouched in installs.json since the 6.1 upgrade six weeks ago, emitting the same warning on every doctor run without ever affecting agent function. Its promotion from "leave it alone, note it" (6.x) to "fail-closed on startup" (7.1) with no automatic reconcile path is exactly the class of thing PR #107002 addresses (per its "converge legacy startup migrations" description). Confirming for a maintainer: PR #107002 landed on main at 2026-07-14T03:05:25Z, roughly 3 hours before 2026.7.1 was cut in the field for me, so this reproduction is on a release that pre-dates the convergence fix. It would be very useful to know whether the next 2026.7.x patch is expected to include #107002 — that would let long-lived installs with legacy plugin-install-index rows upgrade without hand-editing SQLite.

    Meta

    Blast radius here was 1 agent + 1 downstream user (Telegram bot for family use); we could afford the EBS snapshot dance. A sibling instance on the same fleet running 6 agents is now under a hard 7.x upgrade freeze pending resolution — filing a separate follow-up if the amazon-bedrock repro on a multi-agent install turns out to differ.

    Happy to provide full journalctl output, the state_leases / installed_plugin_index SQLite dumps from the retained failed root volume, or the pre-upgrade doctor --json if it would help triangulate.

  9. steipete commented on Jul 15, 2026

    @steipete
    Contributor

    Fixed on main by #107961 (ef110e9a0f42e5c99d56f0126e7e42c4284865aa).

    The repair now treats the shared SQLite install record as canonical when the same plugin ID conflicts, while preserving the shipped partial-ledger migration for plugin IDs found only in legacy JSON. The retired JSON is archived for recovery; archive failures remain blocking and retryable.

    Proof: 141 focused migration tests passed on current main; packaged Doctor/Gateway proof preserved SQLite values, converged cleanly on the second run, and reached gateway readiness; hosted CI and Workflow Sanity passed. Thanks @Marvinthebored and the additional reporters for the upgrade evidence, and @Patrick-Erichsen for the fix.

    The separate Memory Core and state-directory cases mentioned in follow-up comments have different migration owners and are not folded into this plugin-install fix. Please open a focused issue, or ask to reopen this one, only with a reproduction of the same plugins/installs.json conflict on a release containing the landed commit.

  10. smelike commented on Jul 15, 2026

    @smelike

    the same problem.

    Fixed on main by #107961 (ef110e9a0f42e5c99d56f0126e7e42c4284865aa).

    The repair now treats the shared SQLite install record as canonical when the same plugin ID conflicts, while preserving the shipped partial-ledger migration for plugin IDs found only in legacy JSON. The retired JSON is archived for recovery; archive failures remain blocking and retryable.

    Proof: 141 focused migration tests passed on current main; packaged Doctor/Gateway proof preserved SQLite values, converged cleanly on the second run, and reached gateway readiness; hosted CI and Workflow Sanity passed. Thanks @Marvinthebored and the additional reporters for the upgrade evidence, and @Patrick-Erichsen for the fix.

    The separate Memory Core and state-directory cases mentioned in follow-up comments have different migration owners and are not folded into this plugin-install fix. Please open a focused issue, or ask to reopen this one, only with a reproduction of the same plugins/installs.json conflict on a release containing the landed commit.

    o Doctor warnings -------------------------------------------------------------------------+
    | |
    | - Left plugin install index in place because shared SQLite state has conflicting plugin |
    | install metadata for: openclaw-weixin, qqbot |
    | |
    +-------------------------------------------------------------------------------------------+
    14:29:46 [state-migrations] Legacy state migration warnings:

    • Left plugin install index in place because shared SQLite state has conflicting plugin install metadata for: openclaw-weixin, qqbot
      |
      o Doctor warnings -------------------------------------------------------------------------+
      | |
      | - Left plugin install index in place because shared SQLite state has conflicting plugin |
      | install metadata for: openclaw-weixin, qqbot |
      | |
      +-------------------------------------------------------------------------------------------+
      Updating OpenClaw...

    Failed to stop managed gateway service before update: Error: schtasks disable failed: 错误: 拒绝访问。

  11. 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

Labels

P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions