hermes - 💡(How to fix) Fix graceful_shutdown: Discord 403 during shutdown notification can delay clean exit [3 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

During gateway shutdown, the gateway attempts to send a shutdown notification message to Discord. If the Discord bot has lost access to a channel (403 Forbidden), the error can delay the shutdown sequence, causing systemd to kill the process with SIGKILL after TimeoutStopSec. ERROR gateway.platforms.discord: [Discord] Failed to send Discord message: 403 Forbidden (error code: 50001): Missing Access Traceback from gateway/platforms/discord.py during the send() call in the shutdown sequence. May 07 01:01:39 ERROR gateway.platforms.discord: [Discord] Failed to send Discord message: 403 Forbidden (error code: 50001): Missing Access

Fix Action

Fixed

Code Example

ERROR gateway.platforms.discord: [Discord] Failed to send Discord message: 403 Forbidden (error code: 50001): Missing Access

---

May 07 01:01:38 systemd: Stopping hermes-gateway.service...
May 07 01:01:39 ERROR gateway.platforms.discord: [Discord] Failed to send Discord message: 403 Forbidden (error code: 50001): Missing Access
May 07 01:03:08 systemd: State stop-sigterm timed out. Killing.
RAW_BUFFERClick to expand / collapse

Bug Description

During gateway shutdown, the gateway attempts to send a shutdown notification message to Discord. If the Discord bot has lost access to a channel (403 Forbidden), the error can delay the shutdown sequence, causing systemd to kill the process with SIGKILL after TimeoutStopSec.

Steps to Reproduce

  1. Run the Hermes gateway with Discord enabled
  2. Have the Discord bot removed from a server (or have its permissions revoked)
  3. Send SIGTERM to the gateway process (e.g., via auto-update cron or systemctl restart)
  4. Gateway tries to send shutdown notification to Discord
  5. Discord returns 403 Forbidden (Missing Access)
  6. Shutdown is delayed; systemd may timeout and force-kill

Actual Behavior

ERROR gateway.platforms.discord: [Discord] Failed to send Discord message: 403 Forbidden (error code: 50001): Missing Access

Traceback from gateway/platforms/discord.py during the send() call in the shutdown sequence.

Expected Behavior

Shutdown notifications to a platform that returns 403 should be handled gracefully - log a warning and continue. A failed goodbye message should not materially delay process exit.

Environment

  • Linux (Ubuntu 24.04)
  • Gateway systemd service with Restart=always
  • Discord bot token configured

Logs from Incident

May 07 01:01:38 systemd: Stopping hermes-gateway.service...
May 07 01:01:39 ERROR gateway.platforms.discord: [Discord] Failed to send Discord message: 403 Forbidden (error code: 50001): Missing Access
May 07 01:03:08 systemd: State stop-sigterm timed out. Killing.

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