hermes - 💡(How to fix) Fix [Bug]: launchd_restart() fails with bootstrap failed: 5 when plist is missing [1 pull requests]

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…

Error Message

  1. The restart fails with Bootstrap failed: 5: Input/output error
  2. Same error occurs Bootstrap failed: 5: Input/output error

Additional Logs / Traceback (optional)

launchd_restart() in hermes_cli/gateway.py has a fallback path (line ~3054) that handles the case where the launchd job is not loaded. It attempts to launchctl bootstrap the plist, but never checks whether the plist file actually exists on disk first. If the plist is missing, bootstrap fails with error 5 (EIO).

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

Report       https://paste.rs/7MMct
  agent.log    https://paste.rs/5Z3bI
  gateway.log  https://paste.rs/Ez4DX

---
RAW_BUFFERClick to expand / collapse

Bug Description

When running hermes gateway setup to configure a platform (e.g. Telegram) on macOS, the setup wizard offers to restart the gateway to pick up changes. If the gateway was running but the launchd plist was never installed (or was deleted), the restart fails with:

Steps to Reproduce

1. On macOS, ensure the gateway is running (e.g. hermes gateway run in foreground, or installed as a launchd service)
2. Delete the launchd plist: rm ~/Library/LaunchAgents/ai.hermes.gateway.plist
3. Run hermes gateway setup and configure any platform (e.g. Telegram)
4. When prompted "Restart the gateway to pick up changes?", select Yes
5. The restart fails with Bootstrap failed: 5: Input/output error

Alternatively, without the setup wizard:

1. Delete the plist: rm ~/Library/LaunchAgents/ai.hermes.gateway.plist
2. Ensure the gateway is running: hermes gateway status
3. Run: hermes gateway restart
4. Same error occurs

Expected Behavior

launchd_restart() should self-heal a missing plist, the same way launchd_start() already does (line ~2943).

Actual Behavior

⚠ Gateway drain timed out after 180s — forcing launchd restart Could not find service "ai.hermes.gateway" in domain for user gui: 501 ↻ launchd job was unloaded; reloading Bootstrap failed: 5: Input/output error ✗ Restart failed

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

Telegram, Discord, Slack, WhatsApp

Debug Report

Report       https://paste.rs/7MMct
  agent.log    https://paste.rs/5Z3bI
  gateway.log  https://paste.rs/Ez4DX

Operating System

macos 15.6.1

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

launchd_restart() in hermes_cli/gateway.py has a fallback path (line ~3054) that handles the case where the launchd job is not loaded. It attempts to launchctl bootstrap the plist, but never checks whether the plist file actually exists on disk first. If the plist is missing, bootstrap fails with error 5 (EIO).

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

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

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

hermes - 💡(How to fix) Fix [Bug]: launchd_restart() fails with bootstrap failed: 5 when plist is missing [1 pull requests]