Skip to content

Auto-update handoff on Linux systemd user service still runs updater inside Gateway process tree #91823

Closed

Description

@hanyizuo

Bug type

Auto-update / managed-service handoff bug

Summary

On a Linux systemd user-service install, the stable auto-update reached its rollout window and attempted to apply an available npm package update. The update failed because the spawned updater still detected itself as running inside the Gateway process tree and refused to stop/restart the Gateway that owns it.

This appears to violate the documented managed-service update contract: package-manager updates requested through the live Gateway should start a detached handoff outside the running Gateway process, then let the normal openclaw update --yes --json path stop the service, replace the package, refresh service metadata, restart, and verify reachability.

Environment

  • OS: Linux, systemd user service
  • Install method: global npm install
  • Channel: stable
  • Auto-update: enabled
  • Before: OpenClaw 2026.6.1
  • Target/latest: OpenClaw 2026.6.5
  • Gateway service: openclaw-gateway.service managed by systemctl --user
  • Gateway bind: loopback

Relevant auto-update config

{
  update: {
    channel: "stable",
    checkOnStart: true,
    auto: {
      enabled: true,
      stableDelayHours: 6,
      stableJitterHours: 12,
      betaCheckIntervalHours: 1
    }
  }
}

Timeline

  1. Gateway detected 2026.6.5 while running 2026.6.1.
  2. Stable rollout defer behaved as expected until the deterministic jitter window elapsed.
  3. Auto-update attempted to apply the update.
  4. The attempt failed with auto-update attempt failed reason: non-zero-exit.
  5. A manual CLI update from a shell outside the Gateway service succeeded, and the Gateway now runs 2026.6.5.

Observed log excerpt

[gateway] auto-update attempt failed
openclaw update detected it is running inside the gateway process tree.
Gateway PID <redacted> is an ancestor of this process, so this updater cannot safely stop or restart the gateway that owns it.
Run `openclaw update` from a shell outside the gateway service, or stop the gateway service first and then update.
auto-update attempt failed reason: non-zero-exit

Expected behavior

For a managed Linux systemd user-service install, the Gateway auto-update path should either:

  1. Start a truly detached update handoff outside openclaw-gateway.service before invoking openclaw update --yes, or
  2. Refuse before attempting the update and report a clear actionable message that auto-update cannot safely run in this service topology.

It should not start an update path that immediately fails because the updater is still a descendant of the Gateway process it needs to stop/restart.

Actual behavior

The auto-update attempt invoked an updater that was still in the Gateway process tree. The CLI self-protection correctly refused to continue, so the update did not apply automatically.

Manual external update worked:

OpenClaw 2026.6.5
Gateway version: 2026.6.5
Connectivity probe: ok

Related notes

This is adjacent to other managed-service update handoff issues, but the concrete failure mode here is Linux/systemd user-service auto-update failing before package swap because the updater has not escaped the Gateway process tree. It is not the stale hashed-bundle case and not a macOS launchd recovery case.

The local service file was refreshed successfully after manual update. The service is now healthy; the report is about the auto-update handoff path that failed before the manual workaround.

Privacy note

Hostnames, IP addresses, user paths beyond standard OpenClaw/systemd locations, session identifiers, chat/channel identifiers, and private configuration values were intentionally omitted/redacted.

Activity

  1. clawsweeper commented on Jun 10, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 11, 2026, 6:30 PM ET / 22:30 UTC.

    Summary
    Codex review failed: retryable codex transport failure (exit 1).

    Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    Next step
    Review did not complete, so no work-lane recommendation was made.

    Review details

    Best possible solution:

    Retry the Codex review after fixing the execution failure.

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

    Unclear. The review failed before ClawSweeper could establish a reproduction path.

    Is this the best way to solve the issue?

    Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

    AGENTS.md: unclear because the file could not be read completely.

    Remaining risk / open question:

    • No close action taken because the review did not complete.

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

    Label changes

    Label changes:

    • add issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.
    • add clawsweeper:needs-info: Current issue advisory state selects this label.
    • remove P2: Current review triage priority is none.
    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.
    • remove clawsweeper:queueable-fix: Current issue advisory state no longer selects this label.
    • remove clawsweeper:source-repro: Current issue advisory state no longer selects this label.
    • remove issue-rating: 🦞 diamond lobster: Current issue advisory state no longer selects this label.
    • remove impact:other: Current review selected no impact labels.
    Evidence reviewed

    What I checked:

    • failure reason: retryable codex transport failure.
    • codex failure detail: Codex review failed for this issue with exit 1.
    • codex stderr: or addressed**: Linux Gateway auto-update with only generic OpenClaw service markers (OPENCLAW_SERVICE_MARKER=openclaw, OPENCLAW_SERVICE_KIND=gateway) previously was not classified as supervised, so startup auto-update could spawn openclaw update --yes --channel ... --json as a child of the live Gateway process. This patch classifies that Linux marker set as systemd, which routes auto-update through startManagedServiceUpdateHandoff and avoids invoking the direct updater under the Gateway process tree.\n- Real environment tested: PR fix(update): route Linux service auto-updates through handoff #91833 head 1fd06a257acfe83531400b19e954e4704a011e28; local source checkout /Users/andy/openclaw-91823-auto-update-handoff; live Lima Ubuntu Linux aarch64 VM with user systemd running; transient user service openclaw-gateway.service started by systemd-run --user; compiled PR bundle from node scripts/tsdown-build.mjs.\n- Exact steps or command run after this patch:\n ```sh\n node scripts/run-vitest.mjs src/infra/update-startup.test.ts src/infra/supervisor-markers.test.ts src/infra/update-managed-service-handoff.test.ts src/infra/process-respawn.test.ts src/cli/update-cli.test.ts\n pnpm exec oxfmt --check --threads=1 src/infra/update-startup.test.ts src/infra/supervisor-markers.ts src/infra/supervisor-markers.test.ts src/infra/update-startup.ts src/infra/process-respawn.test.ts\n git diff --check\n node scripts/tsdown-build.mjs\n limactl shell memory-mcp-tes.

    Likely related people:

    • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2Normal backlog priority with limited blast radius.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 10, 2026
  3. self-assigned this
    on Jun 11, 2026
  4. joshavant commented on Jun 12, 2026

    @joshavant
    Collaborator

    Thanks for the report, @hanyizuo.

    This was a real Linux service auto-update breakage. Older/stale user systemd gateway services could have only the generic OpenClaw service markers (OPENCLAW_SERVICE_MARKER=openclaw, OPENCLAW_SERVICE_KIND=gateway) without the newer systemd-specific hints. In that shape, startup auto-update did not recognize the gateway as managed by systemd, so it tried to run openclaw update inside the live Gateway process tree. The updater then correctly refused to mutate the active gateway service process.

    Fixed by #92282, merged as 8673c65. The fix keeps generic supervisor detection unchanged, but makes the update-specific paths recognize OpenClaw’s Linux gateway service markers and route auto-update through the existing managed-service handoff.

    We verified both sides with a real user systemd service on Testbox:

    • patched branch: marker-only service started auto-update handoff started
    • current main before the fix: same marker-only service reproduced auto-update attempt failed

    Closing this as fixed. Thanks again for catching it.

  5. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions