[Bug Report] Gateway service check failed: systemctl is-enabled unavailable — No medium found (WSL2 + user service)
Environment:
- OS: Windows 11 with WSL2 (Ubuntu)
- Host: LAPTOP-6MDVC4PE
- OpenClaw version: 2026.4.15 (041266a)
- Deployment: Local, running as systemd user service (
openclaw-gateway.service) - systemd version: 255.4-1ubuntu8.15
Issue:
The gateway health check repeatedly throws the following error every ~10 seconds:
Gateway service check failed: Error: systemctl is-enabled unavailable: Failed to connect to bus: No medium found
What I verified:
- systemd is active and running (
ps -p 1 -o comm=→systemd) - D-Bus is healthy (
systemctl status dbus→active (running)) - The service is enabled (
systemctl is-enabled openclaw-gateway→enabled) - Both
DBUS_SESSION_BUS_ADDRESSandXDG_RUNTIME_DIRare present in the user session:DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/busXDG_RUNTIME_DIR=/run/user/1000/
- Running
systemctl is-enabled openclaw-gatewaymanually from the terminal works fine with no errors.
Root cause (suspected):
The health check subprocess spawned by OpenClaw does not inherit the necessary environment variables (DBUS_SESSION_BUS_ADDRESS, XDG_RUNTIME_DIR) from the parent process. As a result, it cannot connect to the D-Bus session bus even though everything is properly configured.
Impact:
The error itself does not affect functionality — the gateway runs normally, Telegram channel works, and the webchat UI connects successfully. However, the repeated error spam in the logs makes it harder to identify real issues.
Suggested fix:
When spawning the subprocess for the service check, ensure it inherits the user session environment variables, or explicitly pass DBUS_SESSION_BUS_ADDRESS and XDG_RUNTIME_DIR. Alternatively, consider using systemctl --user is-enabled instead of the system-level call when running in a user service context.