Repository navigation
docs: make the manual service-account update end with a running Gateway - #208629
fuller-stack-dev merged 16 commits into
Conversation
|
🦞👀 ClawSweeper review completeClawSweeper finished reviewing this revision. |
…al-update-reset-failed
…al-update-reset-failed
|
Codex review: passed. What this changesThis PR chains successful package installation with clearing systemd’s failed state and restarting the Gateway, and explains interruption recovery. Example: A systemd unit named openclaw-gateway.service reaches its start limit while npm replaces its package.
Review scores
ProductKind: Docs · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a documented recovery procedure that can leave the Gateway down; the change remains absent from current main, and no blocking defect was found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherPublished updaters direct cross-account system-service operators to this documentation, which guides root-owned package replacement while the service account retains ownership of Gateway state. flowchart TD
A[Published updater] --> B[Service account refusal]
B --> C[Manual update documentation]
C --> D[Successful npm installation]
D --> E[Clear systemd failed state]
E --> F[Restart existing Gateway unit]
Technical reviewBest possible solution: Land the focused documentation correction in the existing recovery section while preserving its backup, ownership, and inspection guidance. Do we have a high-confidence way to reproduce the issue? Current-main documentation omits reset-failed, and linked real-systemd logs demonstrate the resulting restart refusal; no target code was executed during this review. Is this the best way to solve the issue? The command-chain correction addresses the demonstrated failure through the existing procedure without reviving the abandoned generated-command machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 20725e6fbecf. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceDocs +11. Total +11 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 29, 2026, 6:20 PM ET / 23:20 UTC. |
|
Merged via squash.
|
…ay (openclaw#208629) * docs: clear the unit's failed state in the manual system-service update * docs: show the full install command for a Node outside secure_path * docs: start the service-account backup from a readable directory * docs: state the measured fast-install outage range * docs: restart only after a successful install and cover PATH for the backup * docs: cover partial npm failures and explicit package specs * docs: check root's npm global root instead of overriding PATH * docs: keep only the measured reset-failed and install guidance * docs: round the measured fast-install outage * docs: always restart after a successful install * docs: make reset-failed best effort and qualify the measurements
Related: #206343
What Problem This Solves
On Linux, a common layout is a root-owned global npm install of OpenClaw serving a systemd system unit whose
User=is a service account. When an already-published updater (2026.11.10 or 2026.11.12) runssudo openclaw update, the new release refuses and links the manual procedure in "Linux system service run by another account". Its step 3 installs the package and then runs a plainsystemctl restart. On a slow install that restart is refused and the Gateway stays down: while npm replaces the package, the running Gateway notices the change, restarts into the partly written package and fails until npm finishes, and the unit reaches systemd's start limit.User Impact
Step 3 now clears the unit's failed state before restarting it, and does both only after the install succeeds:
The restart is always attempted after a successful install, including when
reset-failedreports an error (|| truekeeps it best effort underset -etoo), which matches main's page: main also restarts unconditionally after the install. Short prose after the block says whyreset-failedis there, that--allow-scripts=openclawis required under npm 12's default script policy, that the outage depends on install time (with the measured values and install lengths), and to run the same commands again after an interrupted install. The install command and the rest of the section are unchanged from main, and the anchor#linux-system-service-run-by-another-account, which shipped refusals link to, keeps working.Why This Change Was Made
Each added sentence states a measured result. Earlier revisions also covered which
npmroot runs, the example version and the backup's working directory; those were cut because documentation cannot vouch for root's npm resolution, and the backup failure from root's home is a product bug that gets its own code fix.Production net lines: 0 (docs only).
Update behavior: none changed. Operators on 2026.11.10 and 2026.11.12 reach this section through the refusal's link; the page is published from
main.Evidence
Two cells. Cell 1 ran the red/green start-limit pair and the unloaded-unit case on
9b0b6eb6033c, whose block differs from this head only by|| trueon thereset-failedline; cell 2 ran this head's block (cut at7bce5a9d4544) with errexit. Cell 1, one container, run in order. Docker, Debian 12, systemd 252, Node 24.20.0, npm 11.19.0. Root-owned npm global install in/usr/local, unitopenclaw-gateway.servicewithUser=openclawand the restart settingsopenclaw doctorrecommends (RestartSec=5,StartLimitBurst=5per 60 s). Driver: published 2026.11.12, installed as root with umask 022. Candidate: packed from this branch atdf4c5e1ce4fa(production code identical tomainat42e5a830ca6c) under the unpublished version 2026.11.21, served by a local registry whoselatesttag points at it. Each block was cut from the page (main atf3d7932f1eb1for red, this branch at9b0b6eb6033cfor the rest) and pasted unchanged into a recorded root shell (umask 022, cwd/root) as one script traced with-x; output went throughcatsosystemctlandjournalctldid not start a pager.Slow install: the registry's responses were held to 12 Mbit/s (
tc netem) with root's npm cache cleared, and a watcher lifted the throttle as soon as systemd loggedStart request repeated too quickly, so npm finished inside the start-limit window.sudo openclaw update --yesInstallation replaced, restarted into the partial package 6 times (ERR_MODULE_NOT_FOUND), reached the start limit;systemctl restartexit 1 (Job for openclaw-gateway.service failed because the control process exited with error code.); unitfailed, /healthz 000, still down 60 s laterreset-failedexit 0,restartexit 0; active on 2026.11.21; 59.3 s without a 200 from/healthz(probe every 250 ms)daemon-reload(list-units --allempty); this PR's block under/bin/sh(dash)reset-failedprintedFailed to reset failed state of unit openclaw-gateway.service: Unit openclaw-gateway.service not loaded.;restartstill ran and started the unitopenclaw, package 2026.11.21, /healthz 200; every entry under the service home owned byopenclaw:openclawbefore and after (listing below)No failed start in the partly written package logged config, database, migration or plugin work (journal excerpts below).
Refusal:
c6-driver-2026.11.12-refusal.mp4
Red, main's block on a slow install:
c6-red-main-block-start-limit.mp4
Green, this PR's block on a slow install:
c6-green-new-block-start-limit.mp4
Unloaded unit, this PR's block under
/bin/sh:c6-unloaded-unit-new-block-sh.mp4
Refusal
Red: main's block, journal 23:19:20 to 23:23:47 (systemd lines, restart-into-partial-package lines)
Red: main's block, terminal output
Green: this PR's block, journal 23:24:14 to 23:27:39
Green: this PR's block, terminal output
Unloaded unit: unload step and this PR's block under /bin/sh
Unit, process, package and /healthz after each step
Service home listing before (after seeding, before the update) and after the last run
Cell 2, same image and setup, block cut from this head and run with errexit (
-ex):/bin/bash -ereset-failedandrestartexit 0; active on 2026.11.21 asopenclaw, /healthz 200; 58.6 s without a 200 (the old Gateway restarted into the partial package 12 s in)daemon-reload,list-units --allempty),/bin/bash -ereset-failedprintedUnit openclaw-gateway.service not loaded.; `/bin/sh -e(dash)reset-failederror,true,restartstarted the unit; script exit 0; /healthz 200Outage and install length across this PR's runs: about 10 s (9.5 s to 10.9 s) with installs of about 20 s; 58.6 s with a 55 s install; 59.3 s with a 3-minute throttled install (cell 1 green).
Standard state,
bash -e:c7-standard-bash-e.mp4
Unloaded unit,
bash -e:c7-unloaded-bash-e.mp4
Unloaded unit,
sh -e:c7-unloaded-sh-e.mp4
Cell 2 (std): terminal output
Cell 2 (unl-bash): terminal output
Cell 2 (unl-sh): terminal output
Cell 2: unload steps and unit, process, package and /healthz after each run
Measured earlier in #208376 and not rerun here: npm 12.2.3 without
--allow-scripts=openclawexits 0 and leaves.openclaw-lifecycle-pending; an npm install killed mid-replacement, followed by the same commands, ends serving the new version.Checks
pnpm docs:check-links: 0 broken.pnpm docs:check-links:anchors: 11 broken fragments, the same 11 lines onmainat42e5a830ca6c; none in this page.pnpm docs:check-mdx: passed.pnpm format:docs:check: clean.pnpm docs:spellcheck: no findings in this page.git diff --check: clean.pnpm docs:dev --build-onlyagainst theopenclaw/docssite: step 3's block and prose render inside the ordered list, and#linux-system-service-run-by-another-accountresolves to its H2.cf8f35044144) rated D with one P2 (set -eexits beforerestart) and two P3 (outage figure, npm 12 wording); all three are fixed in this head. This round follows.Not proven