Repository navigation
Description
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
I have been using openclaw@2026.6.11 and it was fine( I use nvm to manage my node and it had been working so far). After Running openclaw update, it failed to restart the openclaw gateway.( In the past, I have seen this before and everytime openclaw doctor can fix it. but not this time)
Updating plugins...
Installing @openclaw/codex into /home/clawtest/.openclaw/npm/projects/openclaw-codex-8902d781d4__openclaw-generation__g-29d0d5a117000eb2…
Linked peerDependency "openclaw" -> /home/clawtest/.nvm/versions/node/v24.15.0/lib/node_modules/openclaw
Installing @openclaw/discord into /home/clawtest/.openclaw/npm/projects/openclaw-discord-c0892df945__openclaw-generation__g-3a4aecad18bbe2c4…
Linked peerDependency "openclaw" -> /home/clawtest/.nvm/versions/node/v24.15.0/lib/node_modules/openclaw
npm plugins: 2 updated, 0 unchanged.
Restarting service...
Gateway did not become healthy after restart.
Service runtime: status=stopped, state=activating, lastExit=1
Gateway port 18789 status: free.
Restart log: /home/clawtest/.openclaw/logs/gateway-restart.log
Run openclaw gateway status --deep for details.
Recovery: run openclaw gateway restart; if the systemd user service is missing, stale, or not active, run openclaw gateway install --force from the same user account, then rerun openclaw gateway status --deep.
Rollback: reinstall OpenClaw 2026.6.11 with the same package manager, then rerun openclaw gateway install --force.
clawtest@homecube-GEM12:~$ node --version
v24.15.0
Steps to reproduce
- Install/Upgrade openclaw@2026.7.1 on nvm managed node v24.15.0 with existing config
- follow the prompt and you will see the failed gateway
- try openclaw doctor and it won't work
Expected behavior
Should work as before, openclaw update should just work and restart the gateway
Actual behavior
says that the package is updated but the gateway can't be restarted. Even after manually stop all those services.
OpenClaw version
2026.7.1
Operating system
Ubuntu 24.04
Install method
npm global, or openclaw update
Model
codex
Provider / routing chain
openclaw -> openai
Additional provider/model setup details
No response
Logs
Updating plugins...
Installing @openclaw/codex into /home/clawtest/.openclaw/npm/projects/openclaw-codex-8902d781d4__openclaw-generation__g-29d0d5a117000eb2…
Linked peerDependency "openclaw" -> /home/clawtest/.nvm/versions/node/v24.15.0/lib/node_modules/openclaw
Installing @openclaw/discord into /home/clawtest/.openclaw/npm/projects/openclaw-discord-c0892df945__openclaw-generation__g-3a4aecad18bbe2c4…
Linked peerDependency "openclaw" -> /home/clawtest/.nvm/versions/node/v24.15.0/lib/node_modules/openclaw
npm plugins: 2 updated, 0 unchanged.
Restarting service...
Gateway did not become healthy after restart.
Service runtime: status=stopped, state=activating, lastExit=1
Gateway port 18789 status: free.
Restart log: /home/clawtest/.openclaw/logs/gateway-restart.log
Run `openclaw gateway status --deep` for details.
Recovery: run `openclaw gateway restart`; if the systemd user service is missing, stale, or not active, run `openclaw gateway install --force` from the same user account, then rerun `openclaw gateway status --deep`.
Rollback: reinstall OpenClaw 2026.6.11 with the same package manager, then rerun `openclaw gateway install --force`.Screenshots, recordings, and evidence
No response
Impact and severity
No response
Additional information
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 14, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 13, 2026, 8:32 PM ET / July 14, 2026, 00:32 UTC.
Summary
Keep this fresh stable-release regression open. The supplied update output confirms that the managed Ubuntu gateway exits with status 1 and leaves port 18789 free, but the restart log and deep status diagnostics needed to identify the startup failure are missing; current main still treats this state as a genuine failed restart, and no merged fix or canonical replacement was established.
Likely related people
vincentkoc— high confidence; substantial recent work on Linux systemd handling, updater restart verification, and gateway health diagnostics.steipete— high confidence; introduced the gateway restart commands and has repeatedly refactored and repaired the daemon service-management path.Reproducibility: no. the report gives a credible release-to-release sequence and confirms the restarted process exits, but it omits the first gateway error needed to reproduce the underlying failure on current main.
Ways to help us reproduce this
Next step
Reproduce the 2026.6.11-to-2026.7.1 Ubuntu upgrade or obtain the first exit-1 log line before assigning a repair; the current evidence does not yet identify a safe file-level fix.
Review details
Best possible solution:
Make upgrades preserve gateway availability by capturing the first startup exception, repairing the responsible service/config/plugin boundary automatically, and offering a visible Doctor/Fix recovery action with safe rollback instead of requiring terminal log inspection.
Do we have a high-confidence way to reproduce the issue?
No: the report gives a credible release-to-release sequence and confirms the restarted process exits, but it omits the first gateway error needed to reproduce the underlying failure on current main.
Is this the best way to solve the issue?
Unclear: weakening the health check would be wrong because the service is genuinely stopped; the narrowest repair depends on whether the restart log identifies service metadata, configuration, plugin activation, or another startup failure.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
gateway-restart.log, systemd journal excerpt, andgateway status --deep --jsonoutput prevent distinguishing service-entrypoint drift, invalid migrated config, plugin activation failure, missing runtime environment, or another startup exception.Codex review notes: model internal, reasoning high; reviewed against c58660fcf4cd.
Label changes
Label changes:
P0: A stable update leaves the core gateway unavailable, and recovery currently requires terminal diagnostics, service commands, or rollback.impact:crash-loop: The systemd-managed gateway exits with status 1, remains stopped/activating, and never binds its configured port.impact:ux-release-blocker: The update and in-product doctor path do not recover the gateway, leaving the user dependent on logs, manual service repair, or package rollback.maturity:stable: The issue affects the M4 Stable gateway-runtime and CLI surfaces, including Stable Gateway Lifecycle and Gateway Service Management categories.issue-rating: 🦐 gold shrimp: Current issue advisory state selects this label.clawsweeper:needs-info: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.Label justifications:
P0: A stable update leaves the core gateway unavailable, and recovery currently requires terminal diagnostics, service commands, or rollback.impact:crash-loop: The systemd-managed gateway exits with status 1, remains stopped/activating, and never binds its configured port.impact:ux-release-blocker: The update and in-product doctor path do not recover the gateway, leaving the user dependent on logs, manual service repair, or package rollback.maturity:stable: The issue affects the M4 Stable gateway-runtime and CLI surfaces, including Stable Gateway Lifecycle and Gateway Service Management categories.Evidence reviewed
What I checked:
src/cli/daemon-cli/restart-health.ts, c58660fcf4cd)src/cli/update-cli/update-command.ts, c58660fcf4cd)docs/cli/gateway.md. (docs/cli/gateway.md, c58660fcf4cd)gateway-runtimesurface is M4 Stable; its Gateway Lifecycle category is scored Stable, and thecli-install-update-onboard-doctorsurface is also M4 Stable with Gateway Service Management scored Stable. (qa/maturity-scores.yaml, c58660fcf4cd)Likely related people:
src/daemon/systemd.ts,src/cli/daemon-cli/restart-health.ts,src/cli/update-cli/update-command.ts)src/daemon/service.ts,src/daemon/systemd.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.SL4N commentedon Jul 14, 2026
TL;DR: We reproduced the exact failure signature (
status=stopped, state=activating, lastExit=1, port free) in a clean sandbox. The most likely root cause is that the systemd unit's baked-in Node binary does not satisfy 2026.7.1's new Node floor, so the upgraded gateway exits1at startup (runtime guard) and systemd crash-loops it. The 6.11 updater's engine preflight cannot parse 7.1's newengines.noderange and silently passes, which is how the update goes through on a host it will then break. Diagnosis details, repro steps, evidence, and the data we'd need from the reporter are below.This investigation was AI-assisted (code trace of v2026.6.11↔v2026.7.1 plus scripted sandbox reproduction). No fix PR intended per the
no-new-fix-prlabel; findings only.Thread dedupe check (2026-07-14): reviewed the issue body and the only comment so far (the clawsweeper[bot] review, 2026-07-14T00:32Z). No prior comment proposes the baked-service-node / engines-floor hypothesis, so it is presented here as a new candidate root cause. Where this comment overlaps with that review, it supplies the data the review flagged as missing — the first exit-1 stderr line and the deep service status — from a sandbox reproduction, and narrows the review's five candidate boundaries (service-entrypoint drift / migrated config / plugin activation / runtime environment / other startup exception) down to a stale runtime environment (#1 below), with one journal-dependent alternative (#2).
Environment used for reproduction
/usr/bin/node, acting as the "good" shell node)openclaw update6.11→7.1What changed in 2026.7.1 that matters here
>=22.19.0(so 22.19+, 23.x, 24.0+ all passed):src/infra/runtime-guard.ts(6.11)MIN_NODE = {22,19,0}.>=22.22.3 <23 || >=24.15.0 <25 || >=25.9.0(package.jsonengines;runtime-guard.tsMIN_NODE_22/24/25). Note Node 23.x is dropped entirely.src/entry.ts→assertSupportedRuntime(); alsosrc/cli/run-main.ts) and exits 1 (runtime-guard.ts,runtime.exit(1)), not 78.src/infra/node-sqlite.ts): requires SQLite ≥3.51.3 (or 3.50.7+/3.44.6+ backports) and throws at boot otherwise. Non-config boot exceptions map to exit 1 (src/cli/gateway-cli/run.ts:459—isInvalidConfigError(err) ? 78 : 1). Verified empirically: official Node 24.14.0 embeds SQLite 3.51.2 (fails the gate), Node 24.15.0 embeds 3.51.3 (passes). Confirmed against nodejs/node release tags:deps/sqlite/sqlite3.h@ v24.14.0 definesSQLITE_VERSION "3.51.2"and @ v24.15.0 defines"3.51.3"(changelog: [CRITICAL BUG] Windows Task Scheduler Gateway Token Mismatch (1008) After Update to 2026.4.2 #61339 landed 24.13.1, [Bug]: Unhandled promise rejection: Error: Agent listener invoked outside active run #62256 in 24.15.0). So the Node floor and the SQLite gate cut at exactly the same version line for official builds; distro/shared-sqlite builds could fail the SQLite gate independently.src/daemon/program-args.ts—process.execPathor resolved stable node). Under nvm these paths are per-version (~/.nvm/versions/node/vX.Y.Z/bin/node) and frozen in the unit, so the service's Node can silently diverge from the shell's Node.lastExit=1(not 78) matters: the unit hasRestartPreventExitStatus=78+Restart=always(src/daemon/systemd-unit.ts:78-80, present in 6.11 units too). An invalid migrated config exits 78 → systemd stops restarting → state would befailedwithlastExit=78. The reportedlastExit=1+state=activating(= auto-restart backoff;readSystemdServiceRuntimemaps any non-activeActiveState tostatus=stopped,src/daemon/systemd.ts) instead indicates a crash loop from a non-config startup failure — consistent with the runtime guard / SQLite gate / any boot exception, and inconsistent with the "migrated config invalid" hypothesis.Reproduction (verbatim signature achieved)
Setup: nvm-style prefix with Node 24.14.0 +
openclaw@2026.6.11npm-global install; user-scope systemd service on port 28789 (unit ExecStart baked with the 24.14.0 binary); 6.11 gateway runs healthy.Repro sequence with log excerpts (sanitized:
~/repro,repro-host,/home/user; full files inline below)openclaw updatewith the old node on PATH: the runtime preflight does not block (see "updater gap" below);global update+global install swapsucceed; the post-installopenclaw doctorstep (running the new 7.1 code) dies on the runtime guard and the update rolls back. Output excerpt (attachment:stage1-update-output.log):journalctl-crashloop.txt):systemctl show:ActiveState=activating SubState=auto-restart ExecMainStatus=1 NRestarts=3..5mid-loop; port stays free (final latched state in attachmentsystemctl-show-full.txt, excerpted to the cited keys).gateway-restart-diagnostics.txt):openclaw gateway restart; the samerenderRestartDiagnosticsoutput the update command embeds in "Gateway did not become healthy after restart.")gateway status --deep --jsonafterwards showsservice.runtime = { status: "stopped", state: "failed", lastExitStatus: 1, nRestarts: 5, startLimitBurst: 5 }andservice.command.programArguments[0]= the stale node binary — i.e. exactly the data that pins the root cause (attachment:status-deep.json).The updater gap that lets this happen (verified in code + sandbox)
nodeVersionSatisfiesEngine()(src/infra/runtime-guard.ts, 6.11) only parses simple>=x.y.zranges (MINIMUM_ENGINE_RE). 7.1's engines string>=22.22.3 <23 || >=24.15.0 <25 || >=25.9.0does not match, the function returnsnull, andresolvePackageRuntimePreflightError()treatsnullas "cannot determine" and passes silently (satisfies !== false). The||-clause parser (ENGINE_CLAUSE_RE) was only added in 7.1 — i.e. the version of the updater that people run to get onto 7.1 is the one that can't read 7.1's requirement.EBADENGINEwarning for engine mismatch on global installs (verified:npm i -g openclaw@2026.7.1under Node 24.14.0 succeeds with a warning), so nothing else blocks it.doctorArgv = [params.nodeRunner ?? resolveNodeRunner(), entryPath, "doctor", ...]), and (b) 7.1'sdoctor --fixrewrote our unit's ExecStart to a supported stable node (/usr/bin/node24.17) when one existed, after which the gateway verified healthy (attachment:update-final.log). So on hosts with a supported system node this self-heals. On an nvm-only host (reporter's case; Ubuntu 24.04's apt node is 18.x, unsupported) the doctor's stable-node search skips version-managed paths (src/daemon/runtime-paths.ts,isVersionManagedRealNodePath) and there may be nothing valid to converge on — plus the drift detection misses units whose ExecStart isn't innode <entry> gateway ...form (resolveManagedServiceNodeRunnerrequiresargs.indexOf("gateway") >= 2and anode-named runner).Root-cause candidates, ranked
run.ts:459). Cannot be excluded without the reporter's journal.Migrated config invalid— ruled out: would exit 78 and systemd would latchfailed(RestartPreventExitStatus=78), notactivatingwith lastExit=1.Plugin activation failure— ruled out: gateway stays up and the health wait reportsplugin-errorswith the port bound, not stopped+free.Entrypoint path missing— ruled out: systemd would reportstatus=203/EXEC, notstatus=1.Data requested from the reporter (to confirm #1 vs #2)
The clawsweeper review above already asked for the restart log, a journal excerpt, and deep status; extending that list with the items that discriminate #1 from #2:
systemctl --user cat openclaw-gateway.service(theExecStart=andEnvironment=PATH=lines — which node binary does the unit run?)<that-ExecStart-node-path> --version(the unit's node, not the shell's)journalctl --user -u openclaw-gateway -n 80 --no-pager(the gateway's own stderr right beforestatus=1/FAILURE— if it's the runtime-guard text, case closed; if it's a JS stack, that's candidate Login fails with 'WebSocket Error (socket hang up)' ECONNRESET #2)openclaw gateway status --deep --json(specificallyservice.command.programArgumentsandservice.runtime)ls ~/.nvm/versions/node/(which node versions exist; was the service installed under an older one?)Also note: the update-time restart log (if the update got that far) is written to
<log dir>/gateway-restart.log(path is printed in the failure block,resolveGatewayRestartLogPath).Immediate recovery for affected users
Suggested hardening (for maintainers; no PR attached)
node <entry> gatewayExecStart forms and the 6.11-side preflight can't parse the new||engines range (unfixable retroactively; a registry-side or gateway-notice mitigation may be worth considering for future floor raises).StartLimitBurstand latchesfailedwith no gateway-side breadcrumb other than journal stderr.Attachments (inline below; sanitized: sandbox paths →
~/repro, hostname →repro-host, user home →/home/user):stage1-update-output.log,journalctl-crashloop.txt(failing-start window only),systemctl-show-full.txt(excerpted to the keys cited above),status-deep.json,gateway-restart-diagnostics.txt,update-final.log.Attachments (inline, sanitized)
stage1-update-output.logjournalctl-crashloop.txtsystemctl-show-full.txtstatus-deep.json{ "cli": { "version": "2026.7.1", "entrypoint": "~/repro/sandbox-home/.nvm/versions/node/v24.14.0/lib/node_modules/openclaw/dist/entry.js" }, "logFile": "/tmp/openclaw-1001/openclaw-2026-07-14.log", "service": { "label": "systemd user", "loaded": true, "loadedText": "enabled", "notLoadedText": "disabled", "command": { "programArguments": [ "~/repro/sandbox-home/.nvm/versions/node/v24.14.0/bin/node", "~/repro/sandbox-home/.nvm/versions/node/v24.14.0/lib/node_modules/openclaw/dist/index.js", "gateway", "--port", "28789" ], "environment": { "OPENCLAW_PROFILE": "lane1", "OPENCLAW_STATE_DIR": "~/repro/sandbox-home/.openclaw-lane1", "OPENCLAW_GATEWAY_PORT": "28789" }, "environmentValueSources": { "HOME": "inline", "TMPDIR": "inline", "NODE_EXTRA_CA_CERTS": "inline", "OPENCLAW_STATE_DIR": "inline", "PATH": "inline", "OPENCLAW_PROFILE": "inline", "OPENCLAW_GATEWAY_PORT": "inline", "OPENCLAW_SYSTEMD_UNIT": "inline", "OPENCLAW_WINDOWS_TASK_NAME": "inline", "OPENCLAW_WINDOWS_TASK_HIDDEN_LAUNCHER": "inline", "OPENCLAW_SERVICE_MARKER": "inline", "OPENCLAW_SERVICE_KIND": "inline", "OPENCLAW_SERVICE_VERSION": "inline" }, "sourcePath": "/home/user/.config/systemd/user/openclaw-gateway-lane1.service" }, "runtime": { "status": "stopped", "state": "failed", "subState": "failed", "lastExitStatus": 1, "lastExitReason": "1", "systemd": { "unit": "openclaw-gateway-lane1.service", "killMode": "control-group", "result": "exit-code", "nRestarts": 5, "startLimitBurst": 5 } }, "configAudit": { "ok": false, "issues": [ { "code": "gateway-runtime-node-version-manager", "message": "Gateway service uses Node from a version manager; it can break after upgrades.", "detail": "~/repro/sandbox-home/.nvm/versions/node/v24.14.0/bin/node", "level": "recommended" } ] } }, "config": { "cli": { "path": "~/repro/sandbox-home/.openclaw-lane1/openclaw.json", "exists": true, "valid": true }, "daemon": { "path": "~/repro/sandbox-home/.openclaw-lane1/openclaw.json", "exists": true, "valid": true } }, "gateway": { "bindMode": "loopback", "bindHost": "127.0.0.1", "port": 28789, "portSource": "service args", "probeUrl": "ws://127.0.0.1:28789", "controlUiLinks": { "httpUrl": "http://127.0.0.1:28789/", "wsUrl": "ws://127.0.0.1:28789" }, "probeNote": "Loopback-only gateway; only local clients can connect.", "version": null }, "port": { "port": 28789, "status": "free", "listeners": [], "hints": [] }, "rpc": { "ok": false, "kind": "connect", "capability": "unknown", "auth": { "role": null, "scopes": [], "capability": "unknown" }, "server": { "version": null, "connId": null }, "error": "connect ECONNREFUSED 127.0.0.1:28789", "url": "ws://127.0.0.1:28789" }, "health": { "healthy": false, "staleGatewayPids": [] }, "extraServices": [], "pluginVersionDrift": { "gatewayVersion": "2026.7.1", "drifts": [] } }gateway-restart-diagnostics.txtupdate-final.logStephonomon commentedon Jul 15, 2026
#106920 (comment) did not work for me.
steipete commentedon Jul 16, 2026
Fixed by #108668.
The package updater now preserves a managed service's recorded Node while it remains compatible, but repairs an owned service to the compatible current CLI Node when the recorded runtime cannot run the target release.
--no-restart, unowned services, and hosts without a compatible fallback still fail before package mutation.Proof: 221 focused update tests passed; dead-export, type, lint, package/API/architecture, and packaged multi-Node service-restart checks passed; exact-head hosted CI passed in https://github.com/openclaw/openclaw/actions/runs/29479383526.
OdinVexBot commentedon Jul 16, 2026
Corroborating report from a separate environment, same version boundary (2026.6.11 → 2026.7.1), with two details this issue doesn't yet have on record: the updater's own JSON output reported a failure status, yet the gateway was restarted into the broken build anyway, and the recovery path itself was unusable because the CLI binary had already been swapped.
Environment: Ubuntu 22.04.5 LTS, npm global install, systemd user service. Node 22.22.0 active (below 2026.7.1's
>=22.22.3floor — same class as #107290, but that closed fix apparently doesn't cover the 2026.6.11→2026.7.1 boundary, since I hit it runningopenclaw updatedirectly against that transition).What happened:
openclaw update --dry-run --jsonreported clean (downgradeRisk: false, emptynotes) — no indication of the Node incompatibility. The dry-run does not appear to checkengines.nodeat all.openclaw update --yes --jsonran: npm install succeeded (300 packages, ~34s), the package swap succeeded, then the post-swapopenclaw doctor --fixstep failed outright:"status": "error", with only 3 steps recorded (global update, install swap, doctor) — no restart step listed.ExecStartprocess picking up the newly-swapped (incompatible) files, failing immediately with the identical Node-version error, systemd retrying 5 times in under 20 seconds, then hitting its own restart-rate-limit and stopping entirely (Start request repeated too quickly). Total outage ~5.5 minutes before manual recovery. This is the part I think is a distinct bug from the "no engine check" root cause already tracked in [Bug]: Auto-updater applies a version requiring a newer Node with no engine check, no warning, and no user prompt — leaves the install broken #107290/[Feature]: Improve OpenClaw upgrade experience when Node.js version requirement changes #107930: even with the check firing and reporting an error, something still triggered a restart into the broken build. I don't have visibility into whether the restart step runs unconditionally regardless of the doctor step's exit code, but the observed behavior (error reported, restart happened anyway) suggests it does.openclaw update --tag 2026.6.11(attempting a same-tool rollback) failed immediately — theopenclawCLI binary itself was already the swapped 2026.7.1 code, which refuses to start under the old Node (identical error). The tool needed to fix the problem was the thing broken by the problem. No local backup of the pre-update package survived either — the updater's staging directory is deleted after the swap regardless of outcome. Had to recover via a rawnpm install -g --prefix ~/.npm-global openclaw@2026.6.11(bypassing the openclaw CLI entirely, since npm's own version resolution isn't gated by the openclaw binary's internal check), thensystemctl --user reset-failed+ manual restart.Suggested fixes, on top of what #107290/#107930 already propose:
doctor/compatibility check fails, the restart step should be gated on that check passing — don't restart a live service into a build you already know can't start.Happy to share the full
openclaw update --jsonoutput or journal excerpts if useful — trimmed here for length.