Skip to content

openclaw update fails to refresh gateway service environment when systemd unit scope is missing/mismatched #87490

@hanyizuo

Description

@hanyizuo

Summary

After running openclaw update from the CLI, the update appeared to install the new package but failed while refreshing the gateway service environment from the updated install. A full server reboot recovered the gateway.

Environment

  • OpenClaw after update: 2026.5.26 (10ad3aa)
  • Platform: Linux
  • Node: 22.22.2
  • Install/update channel: stable / pnpm-managed install
  • Gateway service mode after recovery: systemd user service

Error

The CLI update path printed an error like:

Restarting service...
Failed to refresh gateway service environment from updated install:
Error: updated install refresh failed (/usr/lib/node_modules/openclaw/dist/index.js):
Gateway install failed:
Error: systemctl enable failed:
Failed to enable unit: Unit file openclaw-gateway.service does not exist.

After rebooting the server, the gateway came back normally.

Expected behavior

openclaw update should refresh/restart the correct gateway service after updating, or at least detect whether the installation is using a user systemd unit versus a system-level unit and call the matching systemctl --user / system-level command.

Actual behavior

The refresh/install step attempted to enable openclaw-gateway.service but failed because the unit file was not found in the scope it used. The gateway was left in a state where manual server reboot was needed to recover.

Why this might be happening

This looks like a service-scope mismatch during the post-update refresh path:

  • The healthy recovered state uses a systemd user service.
  • The update refresh path appears to call a systemctl enable path that cannot find the expected unit.
  • The error message does not tell the user whether it checked user units, system units, or a stale/legacy service name.

Suggested fix

  • During update refresh, detect the active gateway service scope and unit path before enabling/restarting.
  • Prefer systemctl --user when the active gateway is a user service.
  • If the unit is missing, run the same install/repair path used by openclaw doctor or provide a precise command for recovery.
  • Make the error actionable, e.g. include which systemctl scope was used and which unit paths were checked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions