Skip to content

Discord channel: uncaught exceptions crash gateway on network hiccups #54752

Description

@StarkTechIndustries

Summary

Discord channel errors (DNS resolution failures and WebSocket disconnects) cause uncaught exceptions that crash the entire OpenClaw gateway process.

Environment

  • OpenClaw: latest (npm global install)
  • OS: Windows 11
  • Channel: Discord (multiple bots configured)

Crash 1: DNS resolution failure

\
[openclaw] Uncaught exception: Error: getaddrinfo ENOTFOUND gateway.discord.gg
at GetAddrInfoReqWrap...
\\

A transient DNS failure for \gateway.discord.gg\ bubbles up as an uncaught exception and kills the process. This should be caught and retried.

Crash 2: WebSocket reconnect limit

\
[openclaw] Uncaught exception: Error: Max reconnect attempts (0) reached after code 1005
at Sa...
\\

The Discord WebSocket reconnect limit appears to be set to 0, so any disconnect (code 1005) is immediately fatal instead of retrying.

Impact

Three crashes in a single day from these two issues. The gateway restarts via scheduled task, but all active sessions are interrupted.

Expected behavior

  • DNS failures should be caught within the Discord channel plugin, logged, and retried with backoff.
  • WebSocket reconnect attempts should default to something reasonable (e.g., 5+ attempts with exponential backoff) rather than 0.
  • A single channel failing should not crash the entire gateway.

Workaround

Disabling Discord in \openclaw.json\ (\channels.discord.enabled: false) and restarting the gateway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions