Skip to content

fix: let sudo openclaw update finish from older updaters on service-account installs - #207873

Open
fuller-stack-dev wants to merge 15 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-restart-hold
Open

fuller-stack-dev wants to merge 15 commits into
openclaw:mainfrom
fuller-stack-dev:fix/update-restart-hold

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Must not land before the update-path owner has reviewed the steps that run as root. Not ready either way: two rounds of independent review (below) left open P1 findings in the same classes, and the design needs a decision first. PR head de89a492c89: cells 4 and 10 ran on it; the other cells ran on earlier heads (see Evidence).

Related: #204775
Follows: #206343, #207304

What Problem This Solves

A common Linux layout has a root-owned global npm install and a systemd system unit that runs the Gateway as a service account (User=openclaw). sudo openclaw update there is driven by the installed updater. When that updater is an already-published release, the new release's admission refuses before the package swap (service-account-mismatch) and points to a manual procedure (#206343). #207304 fixes later hops, but every install that upgrades from a published release still hits the manual procedure once.

The published updater cannot be patched. After it swaps the package, the old Gateway's stale-install observer can restart the unit onto the new package within seconds, because it cannot see root's per-account update lease. Meanwhile the updater still holds the old package for rollback. A rollback after that point would put the old package over state the new Gateway already migrated.

User Impact

With a 2026.11.10, 2026.11.11 or 2026.11.12 updater (proven below), sudo openclaw update --yes on this layout now finishes by itself:

  • Before the swap, the new release runs only runuser -u <account> -- <runtime> --version. It then schedules one transient root unit that holds the Gateway unit down (Restart=no, empty RestartForceExitStatus=) until the updater process exits.
  • When the package is replaced, the transient unit stops the old Gateway. The update's Doctor step also stops it before the updater verifies the new package. The unit stays down while the updater can still roll back.
  • When the updater exits, the transient unit removes the hold and brings the unit back: start if it is stopped, restart if it is running a replaced package. If the update failed before the swap, it only removes the hold. The unit's own boot as User= migrates the service's state.
  • The command exits 0. Its warning says the unit restarts after the command exits and that the command does not verify that restart. It also says how to check (systemctl status <unit>, journalctl -u <unit>) and that the hold's own journal records, 120 s later, whether the unit is active. A unit that is not active then is logged at error priority.

The service does not serve from the package replacement until the updater exits and the new Gateway is up. That was 87–157 s in the passing cells below. These are coarse numbers: another lane's container ran on the same Docker host during most of the cells, under --memory 4g --cpus 4.

Still refused, with the documented manual procedure and the old Gateway left serving:

  • --no-restart is passed: the old Gateway restarts itself onto a replaced package, so the flag cannot be kept. The refusal says to run without it.
  • The update's effective state or config directory overlaps the service's, resolved on both sides through the state and config path owners (OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATH, OPENCLAW_HOME, profile).
  • Root cannot read the unit or its EnvironmentFile=.
  • User= does not resolve.
  • There is no root-owned runuser.
  • The runtime probe fails, the runtime cannot run the package, or the candidate declares no Node engine.
  • The transient unit cannot be scheduled.
  • The unit sets RefuseManualStart=yes.
  • The hold is not effective: another drop-in keeps Restart= or a RestartForceExitStatus=.

Not reachable from the candidate: 2026.12.1-beta.1 (cell 3) and, by the same code, 2026.12.1-beta.2. That updater does not call the candidate's update admit. It runs its own release-update path (stageReleaseService → readSystemdServiceExecStart), which throws on this unit before anything changes. The fix for that hop belongs to the update path itself; see "Not proven".

Why This Change Was Made

A published updater runs three pieces of candidate code around the swap: update admit before it, then the update-migrated-finalize.worker.js --doctor and post-core children after it. The bridge is one module (src/cli/update-cli/update-command-restart-hold.ts) with two call sites.

  • update admit acts only when fix: update system service packages without root state changes #207304's identification finds a system unit that runs this package as a non-root User=, and the process is root. It runs the state-free probe, then systemd-run --unit=openclaw-update-hold-<run>.service --collect --setenv=HELD_UNIT=<unit>. ExecStopPost= removes the drop-in and reloads systemd.
    • The transient unit itself writes /run/systemd/system/<unit>.d/zz-openclaw-update-hold-<run>.conf and reloads, so the drop-in cannot exist without the unit that removes it. The name is per run, so one run's cleanup never removes another run's hold.
    • Admission then requires systemctl show to list that drop-in, with effective Restart=no, no forced exit statuses and RefuseManualStart not yes. Otherwise, and also when systemd-run itself fails, it stops the transient unit, removes the drop-in, reloads, and refuses.
    • A repeated admission of the same run reuses the hold and never stops it.
  • --doctor: when this run's hold unit is active, it stops the held unit synchronously, then runs the normal Doctor. If the stop fails, the Doctor fails, the updater rolls back, and the waiter starts the unit again once the updater exits.

Root still runs its own Doctor and post-core. The published updater checks after Doctor that its own state (/root/.openclaw, which it created itself) reached the candidate's schema. Skipping root's Doctor failed every run with "Shared state migration did not finish: expected schema 42, found 40" (observed on the head before d315284). Root's Doctor and post-core never open the service's state.

The waiter runs node -e <constant script> with root-derived arguments:

  • It waits for the updater: the admission process's parent, which must match the context's supervisor.pid, pinned by its /proc start time.
  • It stops the unit as soon as the package's dist/build-info.json hash changes.
  • When the updater is gone, it removes the drop-in and brings the unit back as described above. 120 s later it logs whether the unit is active. Its systemctl calls are bounded at 300 s each.
  • It never reads state and never switches account.

At a deadline while the updater is still alive: the transient unit has no deadline of its own. It keeps waiting and logs every 10 minutes:

  • Restarting while the updater lives would recreate the rollback-over-migrated-state problem.
  • Removing the drop-in alone would not bring the Gateway back.
  • The updater's own timeout bounds the wait. An operator who stops a hung updater releases the hold automatically.
  • systemctl stop openclaw-update-hold-<run>.service removes the drop-in through ExecStopPost= without a restart.

Host reboot mid-run: /run is cleared, so the drop-in and the transient unit are gone. The unit starts at boot as usual, on whatever package the interrupted updater left.

Size. 347 added production lines (295 in the module, 340 net) against a 150–180 target. After the review fixes I looked once for code the final design no longer needs. Removing the --no-restart hold branch was the only candidate, and it is gone. Where the rest goes:

  • The waiter script is about 30 lines, because it must be self-contained outside the package being swapped.
  • There is a copy of fix: update system service packages without root state changes #207304's runtime probe, because src/update/cli-system-service.ts keeps it inline and that file belongs to the update-path owner. A shared probeServiceAccountRuntime there would remove about 35 lines here.
  • The rest is the verification and cleanup paths the cells below exercised.

What runs as root, and on which state

The installed updater runs as root and performs its own steps (package install, staging, swap, database snapshot of root's own state, rollback, run record and report in /root/.openclaw). This PR cannot change those. The candidate code it calls, in order (line numbers at de89a492c89):

  1. update admit, before the swap (update-command-admit.ts:126 → update-command-admit-service-account.ts:37 → update-command-restart-hold.ts:81). It reads the selected unit and its effective environment through systemd, including EnvironmentFile= (:116); NSS for User= (:128); the effective state and config directories on both sides through the state and config path owners (:138); the root-owned runuser (:149); and the package's dist/build-info.json (:179). It runs the unit's runtime --version as the account (:158), then systemd-run (:189), then systemctl show on the unit (:216). On any failure after systemd-run, including systemd-run itself failing, it stops its own transient unit, removes the drop-in and reloads (:252). It opens no OpenClaw state, root's or the service's.
  2. The transient unit openclaw-update-hold-<run>.service (script at :37). It writes /run/systemd/system/<unit>.d/zz-openclaw-update-hold-<run>.conf (:45) and reloads; it stops the unit when the package hash changes (:53); after the updater exits it removes the drop-in, reloads, and starts or restarts the unit (:57–:63); 120 s later it logs whether the unit is active (:66). ExecStopPost= removes the drop-in and reloads on every exit (:196–:198). It reads only /proc/<updater>/stat and build-info.json.
  3. --doctor (update-migrated-finalize.worker.ts:437). It first stops the held unit (update-command-restart-hold.ts:283, systemctl stop at :298), then runs the normal Doctor on root's own state. Root's Doctor is unchanged by this PR; the installed updater requires it (it checks root's own schema afterwards).
  4. Post-core and the finalize worker: unchanged, on root's own state.

1. What can a hostile or compromised service account make the root-run steps do?

Nothing beyond refusing the hold or breaking its own Gateway. Input by input:

  • Unit name. Discovery reads unit files through systemd; the name must match ^[A-Za-z0-9_.@:-]+\.service$ (:28), so it has no /, space, $ or %, and cannot traverse out of /run/systemd/system/<unit>.d/. Only an administrator can place or link a system unit; an account that can edit its own unit file already controls what root's systemd starts at the next boot.
  • User=. Passed only to getent passwd and, after NSS confirms it (name or uid match, :128), as the account for runuser -u <account> -- (:158). Root and 0 refuse (:96).
  • EnvironmentFile= and Environment=. Parsed by the existing root reader as data. The values are used only to resolve the service's state and config directories for the overlap check (:138). None of them reaches a root command line, a root-written path or the transient unit. A crafted value can only make the overlap check refuse.
  • Service home. Used only as one of the directories in the overlap check, through realpath. A symlinked home can only make the check refuse.
  • The runtime's --version output. The account controls the binary if ExecStart= points into its home. It runs as the account with PATH only and no unit environment (:158). Its output reaches root's terminal only if it matches ^v?[\w.+-]{1,40}$, so it cannot inject terminal escapes into the refusal text.
  • Drop-in path. Built from the validated unit name and run id under /run/systemd/system, which only root can write.
  • PID and start time. The updater is the admission process's own parent, must equal the root-written context's supervisor.pid (:105), and is pinned by its /proc start time. The account cannot choose root's PIDs.
  • Environment of the transient unit. systemd-run gives it the manager's environment plus HELD_UNIT=<unit> (:192); nothing from the caller or the account is passed. Every argument matches [A-Za-z0-9_./@:+-] and the script has no $ or %, so systemd expands nothing (asserted by the first admission test).
  • What it can do: make its own Gateway fail to start (cell 4), or make admission refuse. It cannot change what root runs.

2. TOCTOU between identification, scheduling, the drop-in and the restart

  • Unit file replaced after identification. Admission decides on systemd's effective view after the waiter wrote the drop-in and reloaded: it requires the drop-in in DropInPaths, Restart=no, no forced statuses and RefuseManualStart not yes (:216–:239). A unit changed later (root only) is stopped and started by name, the same way systemd would at boot.
  • Drop-in directory swapped for a symlink. /run/systemd/system and its subdirectories are root-only, so no non-root account can swap them.
  • PID reuse. The waiter checks the start time on every tick (:41). If the updater exits before the waiter starts, the waiter refuses to hold and exits 1 (:43); admission then sees no drop-in and an inactive hold, cleans up and refuses. A recycled PID never extends the hold (Linux test "holds nothing for a recycled updater PID").
  • A retry while the previous waiter is still reporting. Drop-ins are per run (:94), so the earlier waiter's ExecStopPost= removes only its own file.
  • Package hash. Read by admission before the swap and compared by the waiter; a swap before the waiter starts still reads as changed.

3. What root's Doctor does on root's own, near-empty state

From cell 10 (driver 2026.11.12) on de89a492c89, comparing full listings of /etc, /run/systemd, /root and the service home before and after the update (path, type, owner, mode, size, mtime):

  • /etc: no change at all. No unit file or drop-in was installed or edited under /etc/systemd. systemctl list-unit-files 'openclaw*' shows only openclaw-gateway.service before and at the end, and the hold's transient unit while it ran. No user unit exists for root or for the account (~/.config/systemd/user is absent on both, before and after).
  • /run/systemd: only the hold. The run-specific drop-in zz-openclaw-update-hold-<run>.conf and the transient unit appeared, plus systemd's own journal-stream and invocation entries. Both were gone at the end.
  • /root: root's own state only. /root/.openclaw (state database at schema 42, completions, plugin skills, client, control, logs, tmp, session migration runs), the updater's own /root/.openclaw.update-captures/<run>, and /root/.cache/openclaw. (/root/.config/asciinema is the cell's recorder.)
  • Service home: nothing written by root. Every entry was owned by openclaw before, after and at the end. Every change during the update has an mtime at or before 12:00:33, the moment the waiter stopped the old Gateway (the old Gateway's own log, seal and lock files). The only later mtimes are the database -shm/-wal files at 12:01:51. That is the cell's own read-only sqlite3 … pragma user_version in its schemas after step, the same second as the snapshot. The service's schemas stayed at 40/42 until its own boot migrated them to 42/45.
  • Cell 4′ (driver 2026.11.10, same head) agrees: no change under /etc; under /run/systemd/system only the hold's per-run drop-in; root's changes only under /root/.openclaw, /root/.openclaw.update-captures, /root/.cache and the recorder's /root/.config; every service-home entry owned by openclaw.
  • No Gateway to talk to. The journal shows the unit Stopped at 12:00:33. The process sampler first shows the root --doctor worker at 12:00:33.7 and the doctor --lint child at 12:01:08. The unit's next Started is 12:01:52, after the updater exited. No runuser or account switch came from Doctor.

4. Is the user told when the new Gateway does not come back?

The command has exited by the time the waiter restarts the unit, so it cannot print the result. Smallest truthful change, in this PR: the admission warning says the command does not verify the restart and names the hold's journal (journalctl -u openclaw-update-hold-<run>.service). 120 s after the start or restart, the waiter logs <unit> is active 120 s after the update. or, at journal error priority, <unit> is <state>, not active, 120 s after the update. Check: journalctl -u <unit> (:66). It does not block or roll back. Cell 10 on de89a492c89 shows the success line. Cell 4′ on the same head shows the error line; the journal prints it without the <3>, which journald consumed as the priority (see Evidence).

5. Exit paths: can any leave the unit stopped with Restart=no in place?

Path What happens Proof
Normal: updater exits after the swap drop-in removed, reload, start/restart, settle check cells 1, 2, 10; Linux test "package was replaced"
Updater fails before the swap drop-in removed; unit untouched cell 5; Linux test "releases without a restart"
Updater fails after the swap, rolls back drop-in removed; unit started on the old package cell 6
Updater SIGKILLed after the swap waiter sees it gone, starts the unit cell 9
Waiter SIGTERM (operator stop of the hold unit) exits; ExecStopPost= removes the drop-in and reloads; no start ExecStopPost= at :196
Waiter SIGKILLed or crashes ExecStopPost= still runs: drop-in removed, reload. If the unit was already stopped at the swap it stays stopped with Restart= restored; see "Not proven" not run in a cell
Host reboot /run is cleared: no drop-in, no transient unit; the unit starts at boot systemd semantics; not run
systemd-run fails or times out admission stops the hold unit if it exists, removes the drop-in, reloads, refuses admission test "the waiter cannot be scheduled"
Hold not effective (Restart=always, forced status, RefuseManualStart=yes) admission stops its hold, removes the drop-in, reloads, refuses; old Gateway keeps serving cell 8; three admission tests
daemon-reload fails in the waiter at hold time systemd never lists the drop-in; admission times out after 10 s, cleans up and refuses admission poll loop :216
daemon-reload fails at release the file is gone but systemd may keep Restart=no loaded; the unit is still started; ExecStopPost= reloads again not run; the unit runs, it is not left stopped
systemctl hangs each waiter call is bounded at 300 s (:40); a missing systemctl is logged, not thrown Linux run of the waiter without systemctl on PATH
Admission killed after systemd-run the updater sees the failed admission and exits; the waiter sees it gone, removes the drop-in follows from the normal release path

No path leaves Restart=no in place with the unit stopped. One path can leave the unit stopped with its normal Restart= restored: the waiter itself dying after it stopped the unit at the swap.

Update behavior

The installed updater runs first and cannot be patched. This change reaches published updaters only through the candidate entry points they already call: update admit (protocol 1, with supervisor.pid and run.id) and the --doctor child. The marker shared by both is the run's transient unit, openclaw-update-hold-<run.id>.service, which only root can create. A hop driven by main never calls update admit; it uses #207304's path and is unchanged.

Removal plan: delete the module and its two call sites once the oldest supported first hop is a release that contains #207304.

Evidence

Each cell ran in Linux Docker with systemd as PID 1, under --memory 4g --cpus 4:

  • a published updater installed as root with npm, and a unit User=openclaw with state in /var/lib/openclaw/.openclaw, seeded by that updater's Gateway (state 40, agent 42);
  • the candidate packed as unpublished 2026.12.2 and served as latest by a local registry;
  • no ExecStart wrapper, so the candidate identifies the real unit;
  • a 250 ms /healthz probe and a process sampler for the whole run;
  • every step run inside the container.

Red is origin/main bc3700e98 (2026.11.10 driver). Green is the current head de89a492c89 for cells 10 and 4′, b969edcaea8 for cells 1 and 6, and bcc3ab2ee86 for the rest. Rows on earlier heads are evidence for those heads only (see "Not proven").

Cell Driver Exit Not serving (coarse) Final package · service state/agent schema Not owned by openclaw Bridge leftovers
Red 2026.11.10 1 in 66 s, service-account-mismatch + manual procedure 0 s 2026.11.10 · 40/42 0 none
1 normal 2026.11.10 0 in 1,234 s, "✅ OpenClaw updated to 2026.12.2" (and 0 in 933 s on bcc3ab2ee86) 157 s (147 s) 2026.12.2 · 42/45 0 none
2 normal 2026.11.11 0 in 155 s 87 s 2026.12.2 · 42/45 0 none
3 normal 2026.12.1-beta.1 1 in 81 s; the updater's own release path throws before any change; candidate never called 0 s 2026.12.1-beta.1 · 41/43 0 none
4 new Gateway refuses to start 2026.11.10 0 in 1,080 s; the waiter's start fails; systemd keeps retrying under the restored Restart=always still down at the end (444 s+) 2026.12.2 · 40/42 (old state intact) 0 none
5 updater interrupted before the swap 2026.11.10 130 in 57 s (SIGINT); waiter: "Package unchanged and … active; not restarted" 0 s 2026.11.10 · 40/42 0 none
6 updater fails after the swap (held Doctor's stop refused by RefuseManualStop=yes) 2026.11.10 1 in 1,308 s; updater rolled the package back and restored root's databases; waiter started the unit (bcc3ab2ee86: 1 in 1,104 s; updater kept the new package with rollback-state-unverified, waiter started it, 42/45) 120 s (70 s) 2026.11.10 · 40/42 (unmigrated) 0 none
7 --no-restart (bcc3ab2ee86; on de89a492c89 this now refuses before the swap) 2026.11.10 0 in 832 s; warning names the --no-restart behavior 142 s 2026.12.2 · 42/45 0 none
8 site drop-in keeps Restart=always 2026.11.10 1 in 46 s; refused with the manual procedure ("the restart hold did not take effect (effective Restart=always)") 0 s 2026.11.10 · 40/42 0 none (the site's own drop-in stays)
9 updater tree SIGKILLed right after the swap 2026.11.10 137 in 892 s; waiter started the unit 60 s 2026.12.2 · 42/45 0 none
10 normal, on de89a492c89 2026.11.12 (npm latest) 0 in 174 s; hold journal: "openclaw-gateway.service is active 120 s after the update." 89 s 2026.12.2 · 42/45 0 none
4′ new Gateway refuses to start, on de89a492c89 2026.11.10 0 in 1,177 s; the waiter's start fails; 120 s later the hold journal logs, at error priority, "openclaw-gateway.service is activating, not active, 120 s after the update." still down at the end (588 s+) 2026.12.2 · 40/42 (old state intact) 0 none

"Not owned" counts entries under the service home not owned by openclaw:openclaw, before, after and at the end of each cell. "Bridge leftovers" covers OpenClaw drop-ins and openclaw-update-hold-* units at the end. Cell 3 ran with an earlier pack (fb9ec4a7458); its result does not depend on candidate code.

Recordings (terminal, 2× speed, idle capped):

Raw logs for cells 1–9 on bcc3ab2ee86, cell 3 and the Gate A prototype are in this comment; the blocks below cover the current head, b969edcaea8 and red.

c10 on de89a49: driver 2026.11.12
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stops when the package is replaced and stays stopped until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart; 120 s later, journalctl -u openclaw-update-hold-ee4c5f7f-b56d-4166-bc27-72c5e2518ed1.service records whether openclaw-gateway.service is active. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater a
    [update] Doctor migration: Recorded webhook listener decisions; removed pins will not be recreated.
✅ OpenClaw updated to 2026.12.2.
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stops when the package is replaced and stays stopped until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart; 120 s later, journalctl -u openclaw-update-hold-ee4c5f7f-b56d-4166-bc27-72c5e2518ed1.service records whether openclaw-gateway.service is active. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater a
exit 0 in 174s
--- transient unit journal
2026-11-29T11:59:52+0000 systemd[1]: Started openclaw-update-hold-ee4c5f7f-b56d-4166-bc27-72c5e2518ed1.service - Hold openclaw-gateway.service until OpenClaw update ee4c5f7f-b56d-4166-bc27-72c5e2518ed1 exits.
2026-11-29T11:59:52+0000 node[10220]: Holding openclaw-gateway.service while updater 1161 runs.
2026-11-29T12:00:33+0000 node[10220]: Package replaced; stopping openclaw-gateway.service until the updater exits: stopped
2026-11-29T12:01:52+0000 node[10220]: Updater exited; start openclaw-gateway.service; checking it again in 120 s.
2026-11-29T12:03:52+0000 node[10220]: openclaw-gateway.service is active 120 s after the update.
2026-11-29T12:03:52+0000 systemd[1]: openclaw-update-hold-ee4c5f7f-b56d-4166-bc27-72c5e2518ed1.service: Deactivated successfully.
--- schemas (before, after, end)
== before 11:58:51
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.11.12
MainPID=353 NRestarts=0 ActiveState=active SubState=running
== after 12:01:51
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=0 ActiveState=inactive SubState=dead
== end 12:03:53
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 42
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 45
package 2026.12.2
MainPID=31586 NRestarts=0 ActiveState=active SubState=running
c4 on de89a49: new Gateway refuses to start (settle check at error priority)
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stops when the package is replaced and stays stopped until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart; 120 s later, journalctl -u openclaw-update-hold-122c109f-52ae-4ba7-946a-3eef39bb5a48.service records whether openclaw-gateway.service is active. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater a
    [update] Doctor migration: Recorded webhook listener decisions; removed pins will not be recreated.
✅ OpenClaw updated to 2026.12.2.
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stops when the package is replaced and stays stopped until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart; 120 s later, journalctl -u openclaw-update-hold-122c109f-52ae-4ba7-946a-3eef39bb5a48.service records whether openclaw-gateway.service is active. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater a
exit 0 in 1177s
--- transient unit journal
2026-11-29T12:08:52+0000 systemd[1]: Started openclaw-update-hold-122c109f-52ae-4ba7-946a-3eef39bb5a48.service - Hold openclaw-gateway.service until OpenClaw update 122c109f-52ae-4ba7-946a-3eef39bb5a48 exits.
2026-11-29T12:08:52+0000 node[6853]: Holding openclaw-gateway.service while updater 1079 runs.
2026-11-29T12:18:55+0000 node[6853]: Updater 1079 still running; openclaw-gateway.service stays held.
2026-11-29T12:25:14+0000 node[6853]: Package replaced; stopping openclaw-gateway.service until the updater exits: stopped
2026-11-29T12:27:53+0000 node[6853]: Updater exited; start openclaw-gateway.service failed: Job for openclaw-gateway.service failed because the control process exited with error code.
2026-11-29T12:27:53+0000 node[6853]: See "systemctl status openclaw-gateway.service" and "journalctl -xeu openclaw-gateway.service" for details.; checking it again in 120 s.
2026-11-29T12:29:53+0000 node[6853]: openclaw-gateway.service is activating, not active, 120 s after the update. Check: journalctl -u openclaw-gateway.service
2026-11-29T12:29:53+0000 systemd[1]: openclaw-update-hold-122c109f-52ae-4ba7-946a-3eef39bb5a48.service: Deactivated successfully.
--- schemas (before, after, end)
== before 12:08:10
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== after 12:27:52
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=0 ActiveState=inactive SubState=dead
== end 12:35:00
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=196 ActiveState=activating SubState=auto-restart
c1 on b969edc: driver 2026.11.10
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
    [update] Doctor migration: Recorded webhook listener decisions; removed pins will not be recreated.
✅ OpenClaw updated to 2026.12.2.
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
exit 0 in 1234s
--- transient unit journal
2026-11-29T09:49:33+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T09:49:33+0000 node[10302]: Holding openclaw-gateway.service while updater 1031 runs.
2026-11-29T09:59:36+0000 node[10302]: Updater 1031 still running; openclaw-gateway.service stays held.
2026-11-29T10:06:39+0000 node[10302]: Package replaced; stopping openclaw-gateway.service until the updater exits: stopped
2026-11-29T10:09:06+0000 node[10302]: Updater exited; start openclaw-gateway.service; is-active: active
2026-11-29T10:09:06+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
--- schemas (before, after, end)
== before 09:48:26
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== after 10:09:05
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=0 ActiveState=inactive SubState=dead
== end 10:09:17
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 42
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 45
package 2026.12.2
MainPID=200280 NRestarts=0 ActiveState=active SubState=running
c6 on b969edc: held Doctor's stop refused; updater rolls back
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
    Failing check openclaw doctor (doctor-failed): Post-install Doctor reported an error without diagnostic details.
    Failing check openclaw doctor (command-failed): The held Gateway service could not be stopped before verification.
    The held Gateway service could not be stopped before verification.
  ✓ database rollback (1.35s)
Rollback: reinstall OpenClaw 2026.11.10 with the same package manager, then rerun `openclaw gateway install --force`.
⚠️ OpenClaw update failed: doctor-failed.
Update safety checks ran in the candidate updater (2026.12.2).
Admission checks: managed-service-account: warn.
Restored pre-migration databases from /usr/local/lib/node_modules/.openclaw.package-backup-1066-1795947292126.databases.
Migrated database file retained for manual recovery: ~/.openclaw/client/credentials.sqlite.migrated-b2ea7e9f-0d0a-4443-a84e-9e363b15819c
Migrated database file retained for manual recovery: ~/.openclaw/state/openclaw.sqlite.migrated-b2ea7e9f-0d0a-4443-a84e-9e363b15819c
Migrated database file retained for manual recovery: ~/.openclaw/state/openclaw.sqlite.migrated-b2ea7e9f-0d0a-4443-a84e-9e363b15819c-wal
Migrated database file retained for manual recovery: ~/.openclaw/state/openclaw.sqlite.migrated-b2ea7e9f-0d0a-4443-a84e-9e363b15819c-shm
Phases: requested (35.93s) → staging (37ms) → validating (39.47s) → activating (1216.95s)
Failed: activating
Failed: openclaw doctor — exit; Post-install Doctor reported an error without diagnostic details.; The held Gateway service could not be stopped before 
Failing check openclaw doctor (doctor-failed)
Failing check openclaw doctor (command-failed): The held Gateway service could not be stopped before verification.
Failed: gateway recovery verification — Exit code: 1; Gateway readiness was not verified; service status: stopped; startup phase: waiting for managed service. Check openclaw 
Failing check settled (stopped-free): Gateway readiness was not verified; service status: stopped; startup phase: waiting for managed service. Check openclaw gateway status --deep.
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
Recorded recovery: not serving (stopped-free).
Recorded verification: service stopped; channels not ready; HTTP not ready.
Managed gateway remains stopped because update recovery could not prove a runnable installation (Failing check settled (stopped-free): Gateway readiness was not verified; service status: stopped; startup phase: waiting for managed service. Check openclaw gateway status --deep.). Run `openclaw update repair` and `openclaw gateway status --deep`. Run `openclaw triage` on this machine to open a coding agent that can diagnose and repair the installation.
exit 1 in 1308s
--- transient unit journal
2026-11-29T10:14:27+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T10:14:27+0000 node[7782]: Holding openclaw-gateway.service while updater 1066 runs.
2026-11-29T10:24:30+0000 node[7782]: Updater 1066 still running; openclaw-gateway.service stays held.
2026-11-29T10:32:47+0000 node[7782]: Package replaced; stopping openclaw-gateway.service until the updater exits: stop failed Failed to stop openclaw-gateway.service: Operation refused, unit openclaw-gateway.service may be requested by dependency only (it is configured to refuse manual start/stop).
2026-11-29T10:32:47+0000 node[7782]: See system logs and 'systemctl status openclaw-gateway.service' for details.
2026-11-29T10:34:32+0000 node[7782]: Updater 1066 still running; openclaw-gateway.service stays held.
2026-11-29T10:35:35+0000 node[7782]: Updater exited; start openclaw-gateway.service; is-active: active
2026-11-29T10:35:35+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
--- schemas (before, after, end)
== before 10:13:41
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== after 10:35:34
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.11.10
MainPID=0 NRestarts=0 ActiveState=inactive SubState=dead
== end 10:35:40
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.11.10
MainPID=212693 NRestarts=0 ActiveState=active SubState=running
Red: origin/main bc3700e as 2026.12.2, driver 2026.11.10
$ sudo openclaw update --yes
⚠️ OpenClaw update failed: service-account-mismatch.
Update safety checks ran in the candidate updater (2026.12.2).
Admission checks: managed-service-account: refuse.
Phases: requested (30.71s) → staging (10.71s)
Failed: staging
Failed: candidate-admission — [{"name":"managed-service-account","status":"refuse","detail":"Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root; the candidate cannot check that account's state."}]
Failed: service-account-mismatch — Exit code: 1; Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root; the candidate cannot check that
Failing check candidate-admission (service-account-mismatch): Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root; the candidate cannot check that account's state.
Failing check update (update-failed)
This installed updater cannot safely update another account's state. Follow the manual package replacement and ownership-repair instructions at https://docs.openclaw.ai/install/updating#linux-system-service-run-by-another-account.
exit 1 in 66s
--- transient unit journal
--- schemas (before, after, end)
== before 02:11:50
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== after 02:13:01
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== end 02:13:02
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running

What the cells found along the way. Each item was fixed in this branch unless noted.

  • Doctor that did nothing (91bc8ad): the 2026.11.10 updater probed Gateway health as root right after its Doctor step. When the old Gateway had not exited yet, the probe was rejected for missing authentication and the updater rolled back. Fixed by stopping the held unit on swap and in the held Doctor.
  • Root's own state (d315284): the same updater requires its own state at the candidate's schema after Doctor, so root's Doctor has to run on root's own state (see above).
  • Forced exit statuses (c4ba2ca, found by review): RestartForceExitStatus= overrides Restart=no. The hold now clears it and admission verifies it.
  • RefuseManualStop=yes (bcc3ab2): on the previous head, cell 6 rolled the package back to 2026.11.10, and the waiter's restart was refused for this unit, leaving it stopped. The waiter now starts a stopped unit and restarts only a running one. On b969edcaea8, cell 6 rolled back again and the unit came back on 2026.11.10 with unmigrated state.
  • Contention runs: two runs on this head ended in the published updater's own "Package rollback verification timed out" after 1,363–1,570 s of activation, while another container ran on the host. The package was never replaced; the bridge released the hold without a restart and the old Gateway served throughout. Cells 1 and 4 were rerun.
  • Fault injection: killing the Doctor child does not trigger a package rollback in 2026.11.10 (it reports doctor-processes-unsettled). Editing the swapped package breaks the updater's own rollback verification. So cell 6 fails the step through the unit's configuration instead.

Gate A (shell prototype of the hold against the real 2026.11.10 updater, before production code). Candidate main 4b78b6829f7 as 2026.11.13. A throwaway script installed the hold when the updater started update admit and froze the updater at the swap:

  • The old Gateway exited 1.3 s after the swap, and the unit stayed down for the 661 s freeze with schemas at 40/42.
  • After the thaw, the updater exited 0 ("✅ OpenClaw updated to 2026.11.13"). The transient unit removed the drop-in and restarted the unit; the new Gateway migrated to 42/45 and answered /healthz about 11 s after the updater exited. No drop-in and no transient unit were left.
  • The rollback half did not isolate a clean rollback. With root's Doctor in place, the updater refused to roll back once root's own state had migrated (state-migrated-no-rollback), and the other injections broke rollback as described above. Cells 6 and 9 cover the after-swap failures with the real bridge.

Tests on de89a492c89.

  • src/cli/update-cli/update-command-admit.service-account.test.ts (whole file audited again). Admission runs through the real updateAdmitCommand entry; systemd, NSS, runuser and procfs answers are faked at their boundaries. Cases:
    • admits with the hold. It checks the probe argv, the scheduled argv (including the per-run drop-in and the settle argument), that no $ or % reaches systemd, and that the warning names the hold's journal;
    • a custom unit name;
    • a repeated admission reuses the hold and never stops it;
    • ten refusal cases schedule nothing and leave the fixture untouched. New since b969edcaea8: --no-restart, and both sides' OPENCLAW_HOME resolving to a service directory outside its passwd home;
    • schedule failure, Restart=always, RefuseManualStart=yes and a forced restart status each refuse and clean up. Schedule failure now also stops a hold it may have started;
    • the seven "not this layout" cases still fall through and schedule nothing;
    • the held Doctor's stop: not held, stopped, stop failed;
    • on Linux, the scheduled waiter script runs against a stand-in systemctl and a live process as the updater: it holds, stops on swap, restarts a running unit or starts a stopped one, and logs the settle check (at <3> error priority when the unit is not active). It releases without a restart when nothing changed, and holds nothing for a recycled PID.
  • src/infra/update-migrated-finalize.worker.test.ts (whole file audited): stopped and stop-failed. A successful stop runs Doctor. A failed stop writes an error result, exits 1, and runs neither Doctor nor the predecessor stop.
  • Pruned, to stay inside the +400 test-line ratchet:
    • The standalone --no-restart wording case is gone: that behavior is now a refusal row.
    • The nested OPENCLAW_STATE_DIR refusal row is gone. The check now resolves every selector through resolveStateDir / resolveConfigPath (tested by their owner), and the OPENCLAW_HOME and OPENCLAW_CONFIG_PATH rows exercise the same overlap path.
    • The worker's not-held row is gone, because every other case in that file runs with the hold absent and asserts that Doctor runs.
    • The exact-order assertion on admission's systemctl calls is gone, as an implementation mirror. The non-systemctl command list is still asserted.
    • A redundant dropInLeft assertion for the recycled PID is gone: no systemctl call and exit 1 already prove nothing was held.
    • Three comments, and two assertions folded into one line each.
  • Red-first:
    • The round-1 tests on b969edcaea8's module: 2 failed (the hold-journal warning, and schedule-failure cleanup).
    • The round-2 tests on 773d88aa353's module: 8 failed. Three are new behavior: --no-restart, the OPENCLAW_HOME overlap and RefuseManualStart=yes. The other five changed only in message text or because the drop-in is now per run.
  • Green: 25 passed with the 4 Linux-only cases skipped on macOS; worker 35 passed. On Linux CI (checks-node-changed-compact-small-11, job 141333682490, on de89a492c89), all four waiter cases passed. On 773d88aa353 one of them failed on the fixture bug the review also found (job 141325847225).
  • The same waiter script was also run directly on Linux (Node 24 in the cell image, no network). The four scenarios match the test expectations, and a run with no systemctl on PATH logs each failure without throwing.
  • Also run on de89a492c89:
    • node scripts/check-changed.mjs: everything for the changed files passes. The only failure is the dead-export scan, for exports in files this branch does not touch (src/agents/command/types.ts, src/plugins/native-module-require.ts, two ui/ files).
    • The test-line ratchet: +400/400.

Earlier review (previous worker). Autoreview on the Codex route (--max-priority P2 --thinking high, branch mode, with source context) ran eight passes up to b969edcaea8. Its two P2 findings were fixed: the Doctor reported success when the stop failed, and RestartForceExitStatus= overrode the hold.

Base movement. The branch merged origin/main at d88223e2c35 (7687b6b4c0f, no conflicts). Between the old merge base and that commit, main changed nothing in admission, the finalize worker, the systemd readers or anything the hold imports. In adjacent paths it changed the launcher exit-78 handling, preflight.ts's npm-missing message, run.ts's plugin-changed flag, plugin-record reloads and the host memory sampler in src/process/child-memory.ts. None of these is on the hold's path, so no cell was rerun because of base movement.

Independent review (local ClawSweeper)

Two rounds of clawsweeper review --local-range (GPT 6.2 Sol through ClawRouter), each in a fresh output directory, against d88223e2c35 (the origin/main merged into this branch). Both rated F/F/F, with a maintainer question open. The bar for handing this on is B with no open P2, so this PR is not ready: the second round found the same two classes of fault as the first, and I stopped point-fixing to ask for a design decision instead.

Round 1, on 773d88aa353. Every finding was checked against source; all fixed in de89a492c89 except where noted.

  • [P1] Root could reach the service's state through OPENCLAW_HOME: the overlap check compared only two explicit selectors. Fixed: both sides now resolve through resolveStateDir / resolveConfigPath. A red-first test covers it.
  • [P1] A waiter in its 120 s settle window could remove a retry's drop-in through ExecStopPost=. Fixed: the drop-in is now named per run.
  • [P2] RefuseManualStart=yes units could be stopped but not started again. Fixed: admission refuses them. A red-first test covers it.
  • [P2] Unbounded systemctl calls in the waiter, and null output on spawn failure. Fixed: calls are bounded at 300 s and output is normalized, shown in a Linux run with no systemctl.
  • [P2] The waiter fixture took the settle argument as the build hash. Fixed. CI on 773d88aa353 failed on that exact case.
  • [P2] The docs claimed 2026.12.1-beta.1 is bridged. Fixed.
  • [P2] Share the runtime probe with src/update/cli-system-service.ts. Not done: that file is owned by the update path and is outside this PR's scope. The divergence the review named is fixed: the hold now refuses when there is no Node engine.
  • Maintainer question on --no-restart: I took the recommended option. --no-restart now refuses.

Round 2, on de89a492c89. Open; not fixed on this head:

  • [P1] A relative OPENCLAW_STATE_DIR or a --profile in ExecStart= resolves against the candidate's cwd, not the unit's WorkingDirectory=. The overlap check can then miss shared state. Same class as round 1's first P1: proving state separation by comparing paths.
  • [P1] Two system units under different accounts sharing one global package: only the selected unit is held. New class.
  • [P2] The root EnvironmentFile= read is unbounded and accepts non-regular files. This is in the shared reader src/daemon/systemd-environment-files.ts:108.
  • [P2] A missing build-info.json reads as a swap, so the waiter would stop the unit at once. Valid, small.
  • [P2] A unit the operator had already stopped is started when no swap happened. Valid, small.
  • [P2] RefuseManualStop=yes passes admission and makes the update roll back (cell 6 shows the rollback recovering). Same class as round 1's RefuseManualStart: unit properties that the hold cannot drive.
  • [P2] The legacy 50,000-entry tree-limit refusal runs after the held verdict returns. Valid, small (update-command-admit.ts).
  • [P2] Probe sharing again; see round 1.
  • [P3] The module comment still lists 2026.12.1-beta.1, and the old body text described --no-restart as holding.
  • Maintainer question: whether a root-managed hold should replace the manual first hop at all. It caps the tier at C whatever the patch does.

Not proven

  • Open review findings (see "Independent review"): relative and profile selectors resolved outside the unit's context; two units sharing one package; the unbounded root EnvironmentFile= read; a missing build-info.json; starting a unit the operator had stopped; RefuseManualStop=yes; the legacy tree-limit ordering.
  • Waiter death after the swap: if the waiter itself is SIGKILLed or crashes after it stopped the unit, ExecStopPost= removes the drop-in, but nothing starts the unit again. Restart=no is not left in place. Not run in a cell.
  • 2026.12.1-beta.1 and beta.2 cannot be reached from the candidate (cell 3, and the same convert-service.ts:26 read in v2026.12.1-beta.2), and neither can a 2026.12.1 stable cut from that line. Updaters from 2026.9.7 through 2026.11.9 were read from code (the same update admit and --doctor contract), not run.
  • Cells not rerun on de89a492c89: 1, 2, 5, 6, 7, 8 and 9 ran on earlier heads. Since then the waiter's release path has gained the settle check and bounded calls, the drop-in name is per run, and admission refuses --no-restart and RefuseManualStart=yes. So row 7 no longer describes this head (it now refuses), and the others are evidence for the earlier heads only.
  • Which way a failed post-swap step goes is the updater's decision: in cell 6 it rolled back on b969edcaea8 and on fb9ec4a7458, but kept the new package on bcc3ab2ee86.
  • Frozen updater lines: the published updater still prints its own lines about root's state, skipped service restarts and openclaw update repair. The admission warning tells the reader they do not apply to the unit.
  • Coverage: no pnpm or Bun installs, no EnvironmentFile= units, and no units without ExecStopPost= support were run. Linux systemd only.

…dater exits

Published updaters (2026.9.7 through 2026.12.1-beta.1) refused a root npm
install whose system unit runs as another account, because the old Gateway
restarts onto the new package while the updater still holds its rollback.
Candidate admission now schedules one transient root unit that holds the
unit with a runtime Restart=no drop-in until the updater exits, then
restarts it; Doctor and post-core do no state work as root.
@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: L labels Nov 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 29, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 29, 2026
@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head d5e75c6a38bf6dbbe5205ffae2841af563a691ab, but the PR head is now bcc3ab2ee866c65f3fb7e3ac0a879bfbc9e2fdd6. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (1 earlier review cycle)
  • reviewed 2026-11-29T01:40:16.732Z sha d5e75c6 :: passed. :: none

The 2026.11.10 updater checks Gateway health as root right after its
Doctor step. When the old Gateway's observer had not exited it yet, the
probe met a live old Gateway, failed authentication and rolled back. The
waiter now stops the unit as soon as the package is replaced, and a held
run's Doctor stops it synchronously before returning.
The 2026.11.10 updater requires its own state to reach the candidate's
schema after Doctor ("expected schema 42, found 40"). A held run now only
stops the unit before Doctor; Doctor and post-core run on root's own state
as before and never open the service's state.
A unit with RefuseManualStop=yes also refuses restart jobs, so after a
rolled-back update the waiter left it stopped. It now starts a stopped
unit and restarts only an active one, and logs both results.
@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 29, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review November 29, 2026 10:39
The waiter now checks the Gateway unit two minutes after it starts or
restarts it and logs the result to its journal, at error priority when the
unit is not active; the admission warning names that journal. A failed
systemd-run also stops a waiter it may have started. A service runtime's
--version output reaches the refusal text only when it looks like a version.
Review findings on the restart hold:

- Compare the update's effective state and config directories with the
  service's, through the state and config path owners, so OPENCLAW_HOME on
  either side cannot slip past the overlap check.
- Name the drop-in per run, so a waiter that is still reporting the restart
  never removes a retry's hold.
- Refuse units with RefuseManualStart=yes, which the waiter could stop but
  not start again.
- Refuse --no-restart instead of starting the unit anyway.
- Bound the waiter's systemctl calls and tolerate a missing systemctl.
- Refuse when the candidate declares no Node engine.
- Pass the waiter fixture the build hash, not the new settle argument.
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Raw logs for the cells that ran on earlier heads (bcc3ab2ee86, fb9ec4a7458 and the Gate A prototype), moved out of the PR body to keep it under GitHub's size limit. They ran on bcc3ab2ee86, except c3 (pack fb9ec4a7458) and the Gate A prototype.

c1: driver 2026.11.10
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
    [update] Doctor migration: Recorded webhook listener decisions; removed pins will not be recreated.
✅ OpenClaw updated to 2026.12.2.
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
exit 0 in 933s
--- transient unit journal
2026-11-29T07:45:28+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T07:45:28+0000 node[7315]: Holding openclaw-gateway.service while updater 1057 runs.
2026-11-29T07:55:31+0000 node[7315]: Updater 1057 still running; openclaw-gateway.service stays held.
2026-11-29T07:58:07+0000 node[7315]: Package replaced; stopping openclaw-gateway.service until the updater exits: stopped
2026-11-29T08:00:24+0000 node[7315]: Updater exited; start openclaw-gateway.service; is-active: active
2026-11-29T08:00:24+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
--- schemas (before, after, end)
== before 07:44:46
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== after 08:00:24
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=154299 NRestarts=0 ActiveState=active SubState=running
== end 08:00:34
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 42
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 45
package 2026.12.2
MainPID=154299 NRestarts=0 ActiveState=active SubState=running
c2: driver 2026.11.11
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
    [update] Doctor migration: Recorded webhook listener decisions; removed pins will not be recreated.
✅ OpenClaw updated to 2026.12.2.
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
exit 0 in 155s
--- transient unit journal
2026-11-29T07:08:29+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T07:08:30+0000 node[6417]: Holding openclaw-gateway.service while updater 1128 runs.
2026-11-29T07:09:16+0000 node[6417]: Package replaced; stopping openclaw-gateway.service until the updater exits: stopped
2026-11-29T07:10:35+0000 node[6417]: Updater exited; start openclaw-gateway.service; is-active: active
2026-11-29T07:10:35+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
--- schemas (before, after, end)
== before 07:07:54
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.11
MainPID=354 NRestarts=0 ActiveState=active SubState=running
== after 07:10:34
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=0 ActiveState=inactive SubState=dead
== end 07:10:44
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 42
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 45
package 2026.12.2
MainPID=28509 NRestarts=0 ActiveState=active SubState=running
c3: driver 2026.12.1-beta.1
$ sudo openclaw update --yes
Update failed: /lib/node_modules/openclaw/dist/systemd-service-files-YrVzFdgu.mjs:19:4088)
exit 1 in 81s
--- transient unit journal
--- schemas (before, after, end)
== before 04:44:05
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 41
package 2026.12.1-beta.1
MainPID=354 NRestarts=0 ActiveState=active SubState=running
== after 04:45:31
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 41
state /root/.openclaw/state/openclaw.sqlite 41
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 43
package 2026.12.1-beta.1
MainPID=354 NRestarts=0 ActiveState=active SubState=running
== end 04:45:32
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 41
state /root/.openclaw/state/openclaw.sqlite 41
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 43
package 2026.12.1-beta.1
MainPID=354 NRestarts=0 ActiveState=active SubState=running
c4: new Gateway refuses to start
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
    [update] Doctor migration: Recorded webhook listener decisions; removed pins will not be recreated.
✅ OpenClaw updated to 2026.12.2.
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
exit 0 in 1080s
--- transient unit journal
2026-11-29T08:59:00+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T08:59:00+0000 node[9128]: Holding openclaw-gateway.service while updater 1136 runs.
2026-11-29T09:09:04+0000 node[9128]: Updater 1136 still running; openclaw-gateway.service stays held.
2026-11-29T09:13:50+0000 node[9128]: Package replaced; stopping openclaw-gateway.service until the updater exits: stopped
2026-11-29T09:16:07+0000 node[9128]: Updater exited; start openclaw-gateway.service failed: Job for openclaw-gateway.service failed because the control process exited with error code.
2026-11-29T09:16:07+0000 node[9128]: See "systemctl status openclaw-gateway.service" and "journalctl -xeu openclaw-gateway.service" for details.; is-active: activating
2026-11-29T09:16:07+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
--- schemas (before, after, end)
== before 08:58:00
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=275 NRestarts=0 ActiveState=active SubState=running
== after 09:16:06
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=0 ActiveState=inactive SubState=dead
== end 09:21:12
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=142 ActiveState=activating SubState=auto-restart
c5: updater interrupted before the swap
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
⚠️ OpenClaw update failed: update-failed.
Update safety checks ran in the candidate updater (2026.12.2).
Admission checks: managed-service-account: warn.
Phases: requested (32.1s) → staging (63ms) → validating (12.55s)
Failed: validating — Exit code: 1; Could not record update step "updater-runtime-retention" (in_progress): CLI stopping (SIGINT)
Failing check validating (Error) at dist/update-command-admission-report-HG1jTRN6.mjs:17:3790
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
exit 130 in 57s
--- transient unit journal
2026-11-29T09:26:10+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T09:26:10+0000 node[10610]: Holding openclaw-gateway.service while updater 1091 runs.
2026-11-29T09:26:33+0000 node[10610]: Package unchanged and openclaw-gateway.service active; not restarted.
2026-11-29T09:26:33+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
--- schemas (before, after, end)
== before 09:25:30
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=277 NRestarts=0 ActiveState=active SubState=running
== after 09:26:33
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.11.10
MainPID=277 NRestarts=0 ActiveState=active SubState=running
== end 09:26:34
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.11.10
MainPID=277 NRestarts=0 ActiveState=active SubState=running
injector: 1795944371.807 SIGINT updater tree 1072 1073 1074 1091 1713 1986  after hold, build=2026.11.10 2026.11.10-release-6ea542fd97e2-2026-11-24T23-17-47.129Z
c6: held Doctor's stop refused (RefuseManualStop=yes)
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
    Failing check openclaw doctor (doctor-failed): Post-install Doctor reported an error without diagnostic details.
    Failing check openclaw doctor (command-failed): The held Gateway service could not be stopped before verification.
    The held Gateway service could not be stopped before verification.
  ✓ database rollback (2.15s)
Rollback: unavailable; rollback safety could not be verified, so keep this installation installed.
⚠️ OpenClaw update failed: rollback-state-unverified.
Update safety checks ran in the candidate updater (2026.12.2).
Admission checks: managed-service-account: warn.
Restored pre-migration databases from /usr/local/lib/node_modules/.openclaw.package-backup-1074-1795932967387.databases.
Migrated database file retained for manual recovery: ~/.openclaw/client/credentials.sqlite.migrated-5d10b9ff-678e-4c15-bd6c-ee7424e1d798
Migrated database file retained for manual recovery: ~/.openclaw/state/openclaw.sqlite.migrated-5d10b9ff-678e-4c15-bd6c-ee7424e1d798
Migrated database file retained for manual recovery: ~/.openclaw/state/openclaw.sqlite.migrated-5d10b9ff-678e-4c15-bd6c-ee7424e1d798-wal
Migrated database file retained for manual recovery: ~/.openclaw/state/openclaw.sqlite.migrated-5d10b9ff-678e-4c15-bd6c-ee7424e1d798-shm
Phases: requested (28.81s) → staging (31ms) → validating (32.83s) → activating (1028.74s)
Failed: openclaw doctor — exit; Post-install Doctor reported an error without diagnostic details.; The held Gateway service could not be stopped before 
Failing check openclaw doctor (doctor-failed)
Failing check openclaw doctor (command-failed): The held Gateway service could not be stopped before verification.
Failed: package-backup-retention — Exit code: 1; Installation recovery is unverified; inspect the installation and backups in [redacted-path]
Failing check package-swap (swap-failed)
Failed: gateway recovery verification — Exit code: 1; Gateway readiness was not verified; service status: stopped; startup phase: waiting for managed service. Check openclaw 
Failing check settled (stopped-free): Gateway readiness was not verified; service status: stopped; startup phase: waiting for managed service. Check openclaw gateway status --deep.
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
Recorded recovery: not serving (stopped-free).
Recorded verification: service stopped; channels not ready; HTTP not ready.
Managed gateway remains stopped because update recovery could not prove a runnable installation (Failing check settled (stopped-free): Gateway readiness was not verified; service status: stopped; startup phase: waiting for managed service. Check openclaw gateway status --deep.). Run `openclaw update repair` and `openclaw gateway status --deep`. Run `openclaw triage` on this machine to open a coding agent that can diagnose and repair the installation.
exit 1 in 1104s
--- transient unit journal
2026-11-29T06:15:46+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T06:15:46+0000 node[6392]: Holding openclaw-gateway.service while updater 1074 runs.
2026-11-29T06:25:49+0000 node[6392]: Updater 1074 still running; openclaw-gateway.service stays held.
2026-11-29T06:31:35+0000 node[6392]: Package replaced; stopping openclaw-gateway.service until the updater exits: stop failed Failed to stop openclaw-gateway.service: Operation refused, unit openclaw-gateway.service may be requested by dependency only (it is configured to refuse manual start/stop).
2026-11-29T06:31:35+0000 node[6392]: See system logs and 'systemctl status openclaw-gateway.service' for details.
2026-11-29T06:33:40+0000 node[6392]: Updater exited; start openclaw-gateway.service; is-active: active
2026-11-29T06:33:40+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
--- schemas (before, after, end)
== before 06:15:10
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== after 06:33:39
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=0 ActiveState=inactive SubState=dead
== end 06:33:51
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 42
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 45
package 2026.12.2
MainPID=179831 NRestarts=0 ActiveState=active SubState=running
c7: --no-restart
$ sudo openclaw update --yes --no-restart
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then starts it: no installed updater can keep the old Gateway serving after the package is replaced, so --no-restart cannot leave it running on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gate
    [update] Doctor migration: Recorded webhook listener decisions; removed pins will not be recreated.
✅ OpenClaw updated to 2026.12.2.
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then starts it: no installed updater can keep the old Gateway serving after the package is replaced, so --no-restart cannot leave it running on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gate
exit 0 in 832s
--- transient unit journal
2026-11-29T07:15:37+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T07:15:37+0000 node[6339]: Holding openclaw-gateway.service while updater 1030 runs.
2026-11-29T07:25:40+0000 node[6339]: Updater 1030 still running; openclaw-gateway.service stays held.
2026-11-29T07:26:44+0000 node[6339]: Package replaced; stopping openclaw-gateway.service until the updater exits: stopped
2026-11-29T07:28:58+0000 node[6339]: Updater exited; start openclaw-gateway.service; is-active: active
2026-11-29T07:28:58+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
--- schemas (before, after, end)
== before 07:15:00
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== after 07:28:58
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=0 ActiveState=inactive SubState=dead
== end 07:29:07
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 42
state /root/.openclaw/state/openclaw.sqlite 42
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 45
package 2026.12.2
MainPID=138678 NRestarts=0 ActiveState=active SubState=running
c8: site drop-in keeps Restart=always
$ sudo openclaw update --yes
⚠️ OpenClaw update failed: service-account-mismatch.
Update safety checks ran in the candidate updater (2026.12.2).
Admission checks: managed-service-account: refuse.
Phases: requested (23.72s) → staging (10.12s)
Failed: staging
Failed: candidate-admission — [{"name":"managed-service-account","status":"refuse","detail":"Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root; the candidate cannot check that account's state, and the restart hold did not take effect (effective Restart=always).…
Failed: service-account-mismatch — Exit code: 1; Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root; the candidate cannot check that
Failing check candidate-admission (service-account-mismatch): Gateway service openclaw-gateway.service runs as openclaw, but this update runs as root; the candidate cannot check that account's state, and the restart hold did not take effect (effective Restart=al
Failing check update (update-failed)
This installed updater cannot safely update another account's state. Follow the manual package replacement and ownership-repair instructions at https://docs.openclaw.ai/install/updating#linux-system-service-run-by-another-account.
exit 1 in 46s
--- transient unit journal
2026-11-29T07:33:56+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T07:33:56+0000 node[5554]: Holding openclaw-gateway.service while updater 1077 runs.
2026-11-29T07:33:56+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
2026-11-29T07:33:56+0000 systemd[1]: Stopped openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
--- schemas (before, after, end)
== before 07:33:25
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== after 07:34:16
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== end 07:34:16
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
c9: updater tree SIGKILLed after the swap
$ sudo openclaw update --yes
Warning: openclaw-gateway.service runs as openclaw: this update replaces only the package. openclaw-gateway.service stays stopped from the moment the old Gateway exits until this command exits, then restarts it on the installed package; its boot as openclaw migrates the service's state. This command does not verify that restart. Check it with: systemctl status openclaw-gateway.service; journalctl -u openclaw-gateway.service. Lines from this updater about restarting the service, openclaw update r
exit 137 in 892s
--- transient unit journal
2026-11-29T08:39:05+0000 systemd[1]: Started openclaw-update-hold-<run>.service - Hold openclaw-gateway.service until OpenClaw update <run> exits.
2026-11-29T08:39:05+0000 node[10212]: Holding openclaw-gateway.service while updater 1094 runs.
2026-11-29T08:49:09+0000 node[10212]: Updater 1094 still running; openclaw-gateway.service stays held.
2026-11-29T08:52:28+0000 node[10212]: Package replaced; stopping openclaw-gateway.service until the updater exits: stopped
2026-11-29T08:53:18+0000 node[10212]: Updater exited; start openclaw-gateway.service; is-active: active
2026-11-29T08:53:18+0000 systemd[1]: openclaw-update-hold-<run>.service: Deactivated successfully.
--- schemas (before, after, end)
== before 08:38:21
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
package 2026.11.10
MainPID=270 NRestarts=0 ActiveState=active SubState=running
== after 08:53:18
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 40
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 42
package 2026.12.2
MainPID=0 NRestarts=0 ActiveState=inactive SubState=dead
== end 08:53:28
state /var/lib/openclaw/.openclaw/state/openclaw.sqlite 42
state /root/.openclaw/state/openclaw.sqlite 40
agent /var/lib/openclaw/.openclaw/agents/main/agent/openclaw-agent.sqlite 45
package 2026.12.2
MainPID=208730 NRestarts=0 ActiveState=active SubState=running
injector: 1795942398.033 SIGKILL updater tree 1080 1081 1082 1094 2181 2482 14092  after swap to 2026.12.2 2026.12.2-bcc3ab2ee866-2026-11-29T06-05-02.583Z
Gate A raw log (epoch, event, unit Restart / MainPID / NRestarts / state, package, schemas, /healthz)
1795912815.674 start mode=normal unit=always 294 0 active running pkg=2026.11.10 state=40 agent=(not yet created) healthz=200
1795912815.696 driver top 556
1795912837.690 admit 5664 parent 573 start 11587308 cmd=openclaw                                                                                                                
Running as unit: openclaw-update-hold-proto.service
1795912837.770 hold installed, effective Restart=no unit=no 294 0 active running pkg=2026.11.10 state=40 agent=42 healthz=200
1795913528.959 swap seen: 2026.11.13 2026.11.13-4b78b6829f73-2026-11-28T22-07-18.918Z; froze 556 565 573 1081 1331 8713 
1795914190.233 thawed unit=no 0 0 inactive dead pkg=2026.11.13 state=40 agent=42 healthz=000
1795914277.619 updater 573 exited unit=no 0 0 inactive dead pkg=2026.11.13 state=40 agent=42 healthz=000
1795914283.704 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=000
1795914293.743 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914303.794 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914313.851 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914323.892 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914333.936 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914343.982 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914354.028 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914364.081 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914374.125 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914384.180 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914394.230 after unit=always 233927 0 active running pkg=2026.11.13 state=42 agent=45 healthz=200
1795914404.244 dropins: ls: cannot access '/run/systemd/system/openclaw-gateway.service.d': No such file or directory  transient: 
2026-11-29T01:04:38+0000 bash[5695]: updater 573 exited after 1431s
2026-11-29T01:04:43+0000 bash[5695]: is-active: active
(frozen samples every 30 s, first and last:)
1795913559.037 frozen unit=no 0 0 inactive dead pkg=2026.11.13 state=40 agent=42 healthz=000
1795914160.189 frozen unit=no 0 0 inactive dead pkg=2026.11.13 state=40 agent=42 healthz=000

@obviyus

obviyus commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Update-path review: please don't land this. I'd suggest closing it.

Thanks for flagging it as needing a decision. Here's the decision, and it's recorded in #204775 ("Rules for changes in this area"):

  • It adds new moving parts to a frozen updater path: a transient root unit that holds the Gateway down, restart-hold timing, and a command that exits 0 without verifying the restart. Rule 2 rules out new mechanisms, and rule 7 says hops by already-published updaters get an early refusal with one exact command, not new orchestration.
  • It runs more steps as root around a service account's install, and two review rounds still leave open P1s in that area. That's the riskiest place to add code.
  • Users already get a clean outcome for this hop: the new release refuses before the package swap (fix: refuse root updates of a system service that runs as another account #206343) and points to the manual procedure. Later hops go through fix: update system service packages without root state changes #207304, which replaces only the package and restarts the unit.

What would help instead, and is welcome:

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Read, along with the rules section on #204775. This will not land, and work on it has stopped.

A third review round, on a reworked head that was never pushed, found the same two classes again:

  • State separation: the root-only check could validate a different file than the one opened when a path went through a symlink.
  • Unit shape: UpheldBy=, KillMode=none and OnFailure= slipped past the recognition table.

Three rounds finding the same classes in root-run code is its own answer, separate from rules 2, 3 and 7.

Your suggestion is being done as a separate PR: the #206343 refusal prints the exact command for this layout, with the detected unit name and the target version, plus a test. Its proof is a cell per published driver (2026.11.10 and 2026.11.12) that pastes the printed command after the refusal and checks the Gateway serves the new version under the service account. It will be linked here.

Two corrections to what I wrote on #204775 for this PR:

  • The runtime-probe export and the environment-file reader bounds were only needed by this bridge. Both asks are withdrawn.
  • The convert-service.ts:26 note about release/2026.12.1 does not depend on this PR and still stands there.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Outcome of the exact-command suggestion above:

The docs commit does not apply cleanly to release/2026.12.1, where that procedure is split into separate numbered steps; it would need a hand port.

@obviyus

obviyus commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the follow-up. #208629's measurements are exactly what the manual procedure needed. Since #208376 closed on purpose and the docs now carry what it proved, nothing here still needs to land, so I'd suggest closing this PR. Package-only updates (#207304) cover later hops, and the refusal plus the corrected manual procedure covers the first hop from an already-published updater.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants