hermes - ✅(Solved) Fix [Bug]: `systemctl --user` is functional but "✗ User systemd not reachable" on `hermes gateway restart` [5 pull requests, 1 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
NousResearch/hermes-agent#17243Fetched 2026-04-30 06:48:55
View on GitHub
Comments
0
Participants
1
Timeline
10
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×5labeled ×4closed ×1

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #17253: fix(gateway): check for systemd private socket in preflight (fixes #17243)

Description (problem / solution / changelog)

What does this PR do?

<!-- Describe the change clearly. What problem does it solve? Why is this approach the right one? -->

On Debian 13 and similar distros, the D-Bus socket at /run/user/{uid}/bus may not exist even when linger is enabled, but systemctl --user still works by connecting to the per-user systemd private socket at /run/user/{uid}/systemd/private. This PR added detection for per-user systemd private socket besides per-user D-Bus socket.

Related Issue

<!-- Link the issue this PR addresses. If no issue exists, consider creating one first. -->

Fixes #17243

Type of Change

<!-- Check the one that applies. -->
  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

<!-- List the specific changes. Include file paths for code changes. -->
  • _preflight_user_systemd() now checks for both the D-Bus socket and the systemd private socket before reporting "user systemd not reachable"
  • Added _user_systemd_private_socket_path() helper function
  • Added test_noop_when_systemd_private_socket_exists() test for the Debian 13 scenario
  • Updated 4 existing tests to mock the _user_systemd_private_socket_path function

How to Test

<!-- Steps to verify this change works. For bugs: reproduction steps + proof that the fix works. -->
  1. Reproduce #17243
  2. Switch to this PR
  3. It works

Checklist

<!-- Complete these before requesting review. -->

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Debian 13.4 cloud image <!-- e.g. Ubuntu 24.04, macOS 15.2, Windows 11 -->

Documentation & Housekeeping

<!-- Check all that apply. It's OK to check "N/A" if a category doesn't apply to your change. -->
  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

<!-- If applicable, add screenshots or log output showing the fix/feature in action. -->

N/A

Changed files

  • hermes_cli/gateway.py (modified, +9/-1)
  • tests/hermes_cli/test_gateway_service.py (modified, +34/-0)

PR #17260: fix(gateway): relax systemd preflight to handle missing D-Bus socket

Description (problem / solution / changelog)

Problem

On Debian 13 (trixie) the per-user D-Bus socket /run/user/UID/bus may not exist even though systemd --user is fully functional. The current preflight in _wait_for_user_dbus_socket() and _preflight_user_systemd() only checks for this socket, causing false negatives that block gateway startup.

Fixes #17243

Solution

  1. _systemd_private_socket_path() — checks the systemd private socket at /run/user/UID/systemd/private as an alternative indicator
  2. _probe_systemctl_user() — runs systemctl --user is-system-running (3s timeout) as a definitive fallback probe
  3. _wait_for_user_dbus_socket() — now also checks the private socket before sleeping
  4. _preflight_user_systemd() — early-returns if the private socket exists or the probe succeeds; uses probe as final fallback before raising

Only states where the user manager is actually usable (initializing, starting, running, degraded, maintenance) are accepted — offline and stopping are excluded.

Tests

17 new unit tests covering all new functions, the Debian 13 scenario, and edge cases (timeout, missing binary, unexpected states).

Changed files

  • hermes_cli/gateway.py (modified, +46/-1)
  • tests/hermes_cli/test_gateway_preflight_dbus.py (added, +213/-0)

PR #17358: fix: detect user systemd via private socket on Debian 13+

Description (problem / solution / changelog)

What does this PR do?

_preflight_user_systemd checks for /run/user/{uid}/bus (D-Bus socket) to determine if user systemd is reachable. On Debian 13, the per-user systemd socket is at /run/user/{uid}/systemd/private instead — causing a false negative that blocks hermes gateway restart.

Related Issue

Fixes #17243

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/gateway.py: add _user_systemd_private_socket_path() and _user_systemd_socket_exists() that checks both D-Bus and systemd private sockets. Replace 3 call sites that only checked D-Bus.

How to Test

  1. On Debian 13 (trixie), verify /run/user/{uid}/systemd/private exists but /run/user/{uid}/bus does not
  2. Run hermes gateway restart
  3. Before fix: aborts with "User systemd not reachable"
  4. After fix: restarts successfully

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix
  • Cross-platform: only affects Linux systemd detection; no impact on macOS/Windows

Changed files

  • hermes_cli/gateway.py (modified, +14/-4)
  • plugins/memory/holographic/holographic.py (modified, +7/-0)
  • plugins/memory/holographic/retrieval.py (modified, +8/-0)

PR #17363: fix: accept user systemd private socket during gateway preflight

Description (problem / solution / changelog)

Summary

  • treat either /run/user/<uid>/bus or /run/user/<uid>/systemd/private as a valid user-systemd control socket during gateway preflight
  • keep the existing env setup behavior, but stop falsely blocking gateway service control on distros where only the private socket exists
  • add regression tests for the private-socket path and update existing preflight tests to stub both socket probes explicitly

Verification

  • scripts/run_tests.sh tests/hermes_cli/test_gateway_service.py
  • scripts/run_tests.sh tests/hermes_cli/test_gateway_service.py tests/hermes_cli/test_gateway_linger.py
  • independent review pass via delegated reviewer (no security or logic issues found)

Notes

  • Followed CONTRIBUTING.md and AGENTS.md guidance.

Closes #17243

Changed files

  • hermes_cli/gateway.py (modified, +28/-12)
  • tests/hermes_cli/test_gateway_service.py (modified, +40/-0)

PR #17427: fix(gateway): accept user systemd private socket during preflight (#17243)

Description (problem / solution / changelog)

Summary

Gateway restart works on Debian 13 (and any distro where systemctl --user reaches user systemd via /run/user/{uid}/systemd/private instead of a D-Bus bus socket). Preflight in #14531 only checked $XDG_RUNTIME_DIR/bus, so working systems were falsely rejected.

Salvage of #17363 by @rylena onto current main. Credits @Librazy (issue reporter + first submitter in #17253) and @luyao618 (#17260) — all three reached the same diagnosis within hours.

Changes

  • hermes_cli/gateway.py: new _user_systemd_private_socket_path() + _user_systemd_socket_ready() helper; early-return, polling loop, and linger-wait all use the combined check.
  • Tests: 2 new + 5 updated.
  • scripts/release.py: AUTHOR_MAP entry for @rylena.

Validation

BeforeAfter
Debian 13 scenario (private socket only)UserSystemdUnavailableErrorpasses
Both sockets missingraisesraises (unchanged)
Bus socket presentpassespasses (unchanged)
tests/hermes_cli/test_gateway_service.py107/107107/107

Closes #17243, supersedes #17363 #17253 #17260.

Changed files

  • hermes_cli/gateway.py (modified, +28/-12)
  • scripts/release.py (modified, +1/-0)
  • tests/hermes_cli/test_gateway_service.py (modified, +40/-0)

Code Example

User systemd not reachable:
  User D-Bus socket is missing even though linger is enabled.
    systemctl --user cannot reach the user D-Bus session in this shell.

    To fix:
    systemctl start user@1000.service
    (may require sudo; try again after the command succeeds)

    Alternative: run the gateway in the foreground (stays up until
    you exit / close the terminal):
      hermes gateway run

---

version:          0.11.0 (2026.4.23) [f023854e]
os:               Linux 6.12.74+deb13+1-amd64 x86_64
python:           3.11.15
openai_sdk:       2.32.0
profile:          default
hermes_home:      ~/.hermes
model:            qwen3.6-plus
provider:         custom
terminal:         local

---

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.4
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

$ echo XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS:$DBUS_SESSION_BUS_ADDRESS
XDG_RUNTIME_DIR:/run/user/1000 DBUS_SESSION_BUS_ADDRESS:

$ hermes gateway restart
User systemd not reachable:
  User D-Bus socket is missing even though linger is enabled.
    systemctl --user cannot reach the user D-Bus session in this shell.

    To fix:
    systemctl start user@1000.service
    (may require sudo; try again after the command succeeds)

    Alternative: run the gateway in the foreground (stays up until
    you exit / close the terminal):
      hermes gateway run

$ strace -e connect systemctl --user status hermes-gateway.service
connect(3, {sa_family=AF_UNIX, sun_path="/run/user/1000/systemd/private"}, 33) = 0
● hermes-gateway.service - Hermes Agent Gateway - Messaging Platform Integration
     Loaded: loaded (/home/librazy/.config/systemd/user/hermes-gateway.service; enabled; preset: enabled)
     Active: active (running) since Wed 2026-04-29 10:30:12 CST; 38min ago
 Invocation: bedb414b38d04e58877c322b7df6d3d3
   Main PID: 1474126 (python)
      Tasks: 3 (limit: 19072)
     Memory: 88.7M (peak: 90.7M)
        CPU: 2.559s
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/hermes-gateway.service
             └─1474126 /home/librazy/.hermes/hermes-agent/venv/bin/python -m hermes_cli.main gateway run --replace

Apr 29 10:30:12 claw-walker systemd[695]: Started hermes-gateway.service - Hermes Agent Gateway - Messaging Platform Integration.
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1483213, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
+++ exited with 0 +++
RAW_BUFFERClick to expand / collapse

Bug Description

In recent PR to detect non-functional systemctl --user, _preflight_user_systemd checks existence of per-user D-Bus socket path, and abort if the path /run/user/{uid}/bus didn't show up. But in some distro like Debian 13 (at lease cloud image), there is no /run/user/{uid}/bus but /run/user/{uid}/systemd/private, and systemctl --user works by connecting to per-user systemd private socket.

Steps to Reproduce

  1. Install Hermes Agent on Debian 13 as normal user and run hermes gateway install
  2. Check systemctl --user status hermes-gateway.service is working
  3. Run hermes gateway restart

Expected Behavior

It works.

Actual Behavior

It aborts with

✗ User systemd not reachable:
  User D-Bus socket is missing even though linger is enabled.
    systemctl --user cannot reach the user D-Bus session in this shell.

    To fix:
    systemctl start [email protected]
    (may require sudo; try again after the command succeeds)

    Alternative: run the gateway in the foreground (stays up until
    you exit / close the terminal):
      hermes gateway run

despite systemctl --user restart hermes-gateway.service is working properly.

Affected Component

Setup / Installation

Messaging Platform (if gateway-related)

No response

Debug Report

version:          0.11.0 (2026.4.23) [f023854e]
os:               Linux 6.12.74+deb13+1-amd64 x86_64
python:           3.11.15
openai_sdk:       2.32.0
profile:          default
hermes_home:      ~/.hermes
model:            qwen3.6-plus
provider:         custom
terminal:         local

Operating System

Debian GNU/Linux 13 (trixie)

Python Version

3.11.15

Hermes Version

v0.11.0

Additional Logs / Traceback (optional)

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.4
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

$ echo XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS:$DBUS_SESSION_BUS_ADDRESS
XDG_RUNTIME_DIR:/run/user/1000 DBUS_SESSION_BUS_ADDRESS:

$ hermes gateway restart
✗ User systemd not reachable:
  User D-Bus socket is missing even though linger is enabled.
    systemctl --user cannot reach the user D-Bus session in this shell.

    To fix:
    systemctl start [email protected]
    (may require sudo; try again after the command succeeds)

    Alternative: run the gateway in the foreground (stays up until
    you exit / close the terminal):
      hermes gateway run

$ strace -e connect systemctl --user status hermes-gateway.service
connect(3, {sa_family=AF_UNIX, sun_path="/run/user/1000/systemd/private"}, 33) = 0
● hermes-gateway.service - Hermes Agent Gateway - Messaging Platform Integration
     Loaded: loaded (/home/librazy/.config/systemd/user/hermes-gateway.service; enabled; preset: enabled)
     Active: active (running) since Wed 2026-04-29 10:30:12 CST; 38min ago
 Invocation: bedb414b38d04e58877c322b7df6d3d3
   Main PID: 1474126 (python)
      Tasks: 3 (limit: 19072)
     Memory: 88.7M (peak: 90.7M)
        CPU: 2.559s
     CGroup: /user.slice/user-1000.slice/[email protected]/app.slice/hermes-gateway.service
             └─1474126 /home/librazy/.hermes/hermes-agent/venv/bin/python -m hermes_cli.main gateway run --replace

Apr 29 10:30:12 claw-walker systemd[695]: Started hermes-gateway.service - Hermes Agent Gateway - Messaging Platform Integration.
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1483213, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
+++ exited with 0 +++

Root Cause Analysis (optional)

_preflight_user_systemd only checks for per-user D-Bus socket path, but not per-user systemd private socket.

Proposed Fix (optional)

Also check for per-user systemd private socket in _preflight_user_systemd

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

Modify the _preflight_user_systemd function to check for both the per-user D-Bus socket path and the per-user systemd private socket.

Guidance

  • Update the _preflight_user_systemd function to include a check for the per-user systemd private socket path /run/user/{uid}/systemd/private in addition to the existing check for /run/user/{uid}/bus.
  • Verify that the systemctl --user command works as expected after making this change.
  • Consider adding a fallback or alternative check to handle cases where the per-user systemd private socket is not present.
  • Review the strace output to ensure that the connect call is successful when using the per-user systemd private socket.

Example

def _preflight_user_systemd(uid):
    # Existing check for per-user D-Bus socket path
    bus_socket_path = f"/run/user/{uid}/bus"
    if not os.path.exists(bus_socket_path):
        # New check for per-user systemd private socket
        private_socket_path = f"/run/user/{uid}/systemd/private"
        if os.path.exists(private_socket_path):
            # Use the private socket path if it exists
            return private_socket_path
        else:
            # Handle the case where neither socket path exists
            raise Exception("User systemd not reachable")
    # Existing logic for handling the D-Bus socket path

Notes

This fix assumes that the per-user systemd private socket is a suitable alternative to the per-user D-Bus socket for the purposes of the _preflight_user_systemd function. Additional testing and verification may be necessary to ensure that this change does not introduce any regressions.

Recommendation

Apply the proposed fix to update the _preflight_user_systemd function to check for both socket paths, as this should resolve the issue on Debian 13 and other systems that use the per-user systemd private

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING