openclaw - ✅(Solved) Fix [Bug]: `openclaw gateway status` and `openclaw gateway install` falsely report user systemd unavailable while the user service is enabled and active [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63561Fetched 2026-04-10 03:42:48
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2labeled ×2referenced ×2commented ×1

On OpenClaw 2026.4.8 on Ubuntu, openclaw gateway status and openclaw gateway install report that user systemd services are unavailable and that the gateway service is disabled, even though systemctl --user status openclaw-gateway.service works in the same shell and shows the service enabled and active.

Error Message

$ systemctl --user status openclaw-gateway.service

● openclaw-gateway.service - OpenClaw Gateway (v2026.3.8) Loaded: loaded (/home/jeanclaude/.config/systemd/user/openclaw-gateway.service; enabled; preset: enabled) Active: active (running) ...

$ echo "$XDG_RUNTIME_DIR" /run/user/1001

$ echo "$DBUS_SESSION_BUS_ADDRESS" unix:path=/run/user/1001/bus

$ ~/.npm-global/bin/openclaw gateway status

[lcm] Plugin loaded (enabled=true, db=/home/jeanclaude/.openclaw/lcm.db, threshold=0.75) [lcm] Compaction summarization model: (unconfigured) [plugins] grafana-lens: plugin loaded but Grafana tools are disabled — grafana.url is required... [edicts] register: workspaceDir=/home/jeanclaude, configPath=edicts.yaml ... repeated several times ...

Service: systemd (disabled)

Config (cli): ~/.openclaw/openclaw.json Config (service): ~/.openclaw/openclaw.json

Runtime: unknown (systemctl --user unavailable: Failed to connect to bus: Permission denied Failed to read server status: Transport endpoint is not connected) RPC probe: ok

systemd user services unavailable. systemd user services are unavailable; install/enable systemd or run the gateway under your supervisor.

Listening: *:18789

$ ~/.npm-global/bin/openclaw gateway install

Gateway install failed: Error: systemctl --user unavailable: Failed to connect to bus: Permission denied Failed to read server status: Transport endpoint is not connected

$ systemctl --user restart openclaw-gateway.service $ systemctl --user status openclaw-gateway.service

● openclaw-gateway.service - OpenClaw Gateway (v2026.3.8) Loaded: loaded (...; enabled; preset: enabled) Active: active (running) Main PID: ... /usr/bin/node /home/jeanclaude/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789

Additional observed CLI startup/plugin evidence from the same environment:

[lcm] Compaction summarization model: (unconfigured) [plugins] grafana-lens: plugin loaded but Grafana tools are disabled — grafana.url is required... [edicts] register: workspaceDir=/home/jeanclaude, configPath=edicts.yaml

Observed config state:

  • ~/.openclaw/openclaw.json already contains:
    • plugins.entries.lossless-claw.config.summaryModel = openrouter/google/gemini-2.5-flash
    • plugins.entries.openclaw-grafana-lens.config.grafana.url = http://localhost:3000
    • plugins.entries.openclaw-grafana-lens.config.grafana.apiKey = <redacted>

Root Cause

This environment differs from #11805 because systemctl --user status openclaw-gateway.service succeeds in the same shell and the user service is already enabled and active.

Fix Action

Fixed

PR fix notes

PR #63625: fix: correct user systemd availability detection for gateway commands

Description (problem / solution / changelog)

Summary

Fixes false negative in systemd user service detection that caused gateway status and gateway install to incorrectly report "systemd user services unavailable" on working Linux systems.

Closes #63561

Root Cause

The isSystemctlMissingDetail function in systemd-unavailable.ts used a broad "not found" substring check intended to detect a missing systemctl binary. However, this pattern also matched the "not found" text that appears in systemctl show output when a specific unit is not found (e.g., "Unit openclaw-gateway.service not found.").

The false-positive classification cascaded through classifySystemdUnavailableDetail -> isSystemdUnavailableDetail, causing gateway status (via status.print.ts) and gateway install (via doctor-format.ts) to display systemd-unavailable warnings and hints even though systemd was fully operational.

Changes

  • Replaced the overly broad "not found" pattern in isSystemctlMissingDetail with two specific patterns:
    • "command not found" — matches shell-style missing binary errors
    • "systemctl: not found" — matches busybox/minimal-shell missing binary errors
  • The existing "spawn systemctl enoent" and "spawn systemctl eacces" patterns already cover Node.js execFile spawn failures, which is the primary code path
  • Added tests verifying that unit-level "not found" messages (e.g., "Unit openclaw-gateway.service not found.", "not-found") no longer trigger false unavailability classification
  • Added tests for the new specific patterns

Testing

  • All 53 existing tests in systemd.test.ts, systemd-unavailable.test.ts, and systemd-hints.test.ts continue to pass
  • New test cases confirm:
    • isSystemctlMissingDetail("Unit openclaw-gateway.service not found.") returns false
    • isSystemctlMissingDetail("not-found") returns false
    • classifySystemdUnavailableDetail("Unit openclaw-gateway.service not found.") returns null
    • isSystemctlMissingDetail("systemctl: command not found") returns true
    • isSystemctlMissingDetail("systemctl: not found") returns true

This PR was generated with AI assistance (Claude).

Changed files

Code Example

$ systemctl --user status openclaw-gateway.service

● openclaw-gateway.service - OpenClaw Gateway (v2026.3.8)
 Loaded: loaded (/home/jeanclaude/.config/systemd/user/openclaw-gateway.service; enabled; preset: enabled)
 Active: active (running)
 ...

$ echo "$XDG_RUNTIME_DIR"
/run/user/1001

$ echo "$DBUS_SESSION_BUS_ADDRESS"
unix:path=/run/user/1001/bus

$ ~/.npm-global/bin/openclaw gateway status

[lcm] Plugin loaded (enabled=true, db=/home/jeanclaude/.openclaw/lcm.db, threshold=0.75)
[lcm] Compaction summarization model: (unconfigured)
[plugins] grafana-lens: plugin loaded but Grafana tools are disabled — grafana.url is required...
[edicts] register: workspaceDir=/home/jeanclaude, configPath=edicts.yaml
... repeated several times ...

Service: systemd (disabled)

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Runtime: unknown (systemctl --user unavailable: Failed to connect to bus: Permission denied
Failed to read server status: Transport endpoint is not connected)
RPC probe: ok

systemd user services unavailable.
systemd user services are unavailable; install/enable systemd or run the gateway under your supervisor.

Listening: *:18789

$ ~/.npm-global/bin/openclaw gateway install

Gateway install failed: Error: systemctl --user unavailable: Failed to connect to bus: Permission denied
Failed to read server status: Transport endpoint is not connected

$ systemctl --user restart openclaw-gateway.service
$ systemctl --user status openclaw-gateway.service

● openclaw-gateway.service - OpenClaw Gateway (v2026.3.8)
 Loaded: loaded (...; enabled; preset: enabled)
 Active: active (running)
 Main PID: ... /usr/bin/node /home/jeanclaude/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789


Additional observed CLI startup/plugin evidence from the same environment:

[lcm] Compaction summarization model: (unconfigured)
[plugins] grafana-lens: plugin loaded but Grafana tools are disabled — grafana.url is required...
[edicts] register: workspaceDir=/home/jeanclaude, configPath=edicts.yaml


Observed config state:
- `~/.openclaw/openclaw.json` already contains:
  - `plugins.entries.lossless-claw.config.summaryModel = openrouter/google/gemini-2.5-flash`
  - `plugins.entries.openclaw-grafana-lens.config.grafana.url = http://localhost:3000`
  - `plugins.entries.openclaw-grafana-lens.config.grafana.apiKey = <redacted>`
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

On OpenClaw 2026.4.8 on Ubuntu, openclaw gateway status and openclaw gateway install report that user systemd services are unavailable and that the gateway service is disabled, even though systemctl --user status openclaw-gateway.service works in the same shell and shows the service enabled and active.

Steps to reproduce

  1. Install OpenClaw 2026.4.8 via npm global on Ubuntu.
  2. Run the gateway as a user systemd service:
    • systemctl --user restart openclaw-gateway.service
  3. Confirm the service is healthy:
    • systemctl --user status openclaw-gateway.service
  4. In the same shell session, run:
    • ~/.npm-global/bin/openclaw gateway status
  5. Observe that OpenClaw reports:
    • Service: systemd (disabled)
    • systemctl --user unavailable: Failed to connect to bus: Permission denied
    • systemd user services unavailable.
  6. In the same shell session, run:
    • ~/.npm-global/bin/openclaw gateway install
  7. Observe that the install command fails with the same systemctl --user unavailable error, while systemctl --user restart openclaw-gateway.service continues to work.

Expected behavior

When systemctl --user status openclaw-gateway.service succeeds in the current shell and shows the service enabled and active, openclaw gateway status should report the service as enabled/active instead of disabled/unavailable, and openclaw gateway install should not fail claiming that systemctl --user is unavailable.

Actual behavior

openclaw gateway status reports:

  • Service: systemd (disabled)
  • Runtime: unknown (systemctl --user unavailable: Failed to connect to bus: Permission denied ... )
  • systemd user services unavailable.

At the same time:

  • systemctl --user status openclaw-gateway.service succeeds
  • the service is enabled and active
  • the gateway is listening
  • RPC probe: ok

openclaw gateway install also fails with:

  • Gateway install failed: Error: systemctl --user unavailable: Failed to connect to bus: Permission denied

but systemctl --user restart openclaw-gateway.service succeeds immediately afterward.

OpenClaw version

2026.4.8 (9ece252)

Operating system

Ubuntu 24.04

Install method

npm global

Model

gpt-5.4

Provider / routing chain

openclaw -> litellm-main -> gpt-5.4

Additional provider/model setup details

Default runtime uses OpenClaw with local LiteLLM routing. Relevant gateway config is stored in ~/.openclaw/openclaw.json. The issue appears in CLI gateway status/install behavior and is not limited to a specific model response path.

Logs, screenshots, and evidence

$ systemctl --user status openclaw-gateway.service

● openclaw-gateway.service - OpenClaw Gateway (v2026.3.8)
 Loaded: loaded (/home/jeanclaude/.config/systemd/user/openclaw-gateway.service; enabled; preset: enabled)
 Active: active (running)
 ...

$ echo "$XDG_RUNTIME_DIR"
/run/user/1001

$ echo "$DBUS_SESSION_BUS_ADDRESS"
unix:path=/run/user/1001/bus

$ ~/.npm-global/bin/openclaw gateway status

[lcm] Plugin loaded (enabled=true, db=/home/jeanclaude/.openclaw/lcm.db, threshold=0.75)
[lcm] Compaction summarization model: (unconfigured)
[plugins] grafana-lens: plugin loaded but Grafana tools are disabled — grafana.url is required...
[edicts] register: workspaceDir=/home/jeanclaude, configPath=edicts.yaml
... repeated several times ...

Service: systemd (disabled)

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Runtime: unknown (systemctl --user unavailable: Failed to connect to bus: Permission denied
Failed to read server status: Transport endpoint is not connected)
RPC probe: ok

systemd user services unavailable.
systemd user services are unavailable; install/enable systemd or run the gateway under your supervisor.

Listening: *:18789

$ ~/.npm-global/bin/openclaw gateway install

Gateway install failed: Error: systemctl --user unavailable: Failed to connect to bus: Permission denied
Failed to read server status: Transport endpoint is not connected

$ systemctl --user restart openclaw-gateway.service
$ systemctl --user status openclaw-gateway.service

● openclaw-gateway.service - OpenClaw Gateway (v2026.3.8)
 Loaded: loaded (...; enabled; preset: enabled)
 Active: active (running)
 Main PID: ... /usr/bin/node /home/jeanclaude/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789


Additional observed CLI startup/plugin evidence from the same environment:

[lcm] Compaction summarization model: (unconfigured)
[plugins] grafana-lens: plugin loaded but Grafana tools are disabled — grafana.url is required...
[edicts] register: workspaceDir=/home/jeanclaude, configPath=edicts.yaml


Observed config state:
- `~/.openclaw/openclaw.json` already contains:
  - `plugins.entries.lossless-claw.config.summaryModel = openrouter/google/gemini-2.5-flash`
  - `plugins.entries.openclaw-grafana-lens.config.grafana.url = http://localhost:3000`
  - `plugins.entries.openclaw-grafana-lens.config.grafana.apiKey = <redacted>`

Impact and severity

Affected:

  • Linux users running OpenClaw gateway as a user systemd service

Severity:

  • High (breaks CLI service management/status accuracy and causes false recovery/install guidance)

Frequency:

  • Reproduced consistently in observed runs of openclaw gateway status, openclaw gateway install, and post-update restart flow

Consequence:

  • openclaw update falsely reports the gateway service as disabled
  • users must manually restart with systemctl --user restart openclaw-gateway.service
  • CLI troubleshooting output suggests incorrect remediations (enable linger, set XDG_RUNTIME_DIR, install/enable systemd) even when those are already satisfied

Additional information

Related but likely distinct from:

  • #11805
  • #33633
  • #34791
  • #24529

This environment differs from #11805 because systemctl --user status openclaw-gateway.service succeeds in the same shell and the user service is already enabled and active.

Also observed in the same CLI path:

  • repeated plugin bootstrap logs
  • false Grafana missing-config warning despite config being present
  • false LCM “Compaction summarization model: (unconfigured)” warning despite the configured summary model being actively used by the running gateway

Possible affected area:

  • CLI user-systemd probe / subprocess environment handling
  • CLI bootstrap/config hydration path for plugins

extent analysis

TL;DR

The issue can be resolved by ensuring the XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS environment variables are properly set and accessible to the OpenClaw CLI, allowing it to correctly interact with the user systemd service.

Guidance

  1. Verify Environment Variables: Confirm that XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS are set in the shell where OpenClaw CLI commands are executed. This can be done by running echo "$XDG_RUNTIME_DIR" and echo "$DBUS_SESSION_BUS_ADDRESS" in the terminal.
  2. Check systemd Service Status: Use systemctl --user status openclaw-gateway.service to verify the service is enabled and active, as this indicates the service itself is functioning correctly outside of the OpenClaw CLI's perception.
  3. Investigate CLI Bootstrap: Examine the OpenClaw CLI's bootstrap process for potential issues with environment variable propagation or systemd service detection, focusing on how it handles user systemd services and environment variables.
  4. Review Plugin Configuration: Although not directly related to the systemd issue, verify that plugin configurations, such as Grafana and LCM settings in ~/.openclaw/openclaw.json, are correctly set up and recognized by the OpenClaw CLI to avoid misleading error messages.

Example

No specific code example is provided due to the nature of the issue, which appears to be related to environment variable handling and systemd interaction rather than a code snippet fix.

Notes

The solution may involve modifying how the OpenClaw CLI accesses or sets environment variables, potentially requiring changes to the CLI's code or its configuration files. The issue seems specific to the interaction between the OpenClaw CLI and user systemd services on Linux, particularly how it detects and reports the status of these services.

Recommendation

Apply a workaround by ensuring that the necessary environment variables (XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS) are explicitly set before running OpenClaw CLI commands, potentially by adding them to the shell configuration or the command invocation script, until a permanent fix is implemented in the OpenClaw CLI.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When systemctl --user status openclaw-gateway.service succeeds in the current shell and shows the service enabled and active, openclaw gateway status should report the service as enabled/active instead of disabled/unavailable, and openclaw gateway install should not fail claiming that systemctl --user is unavailable.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING