Skip to content

Slack SocketModeClient DNS error causes unhandled rejection → process crash #21082

Description

@mafresh-max

Bug Description

The OpenClaw gateway process terminates when the Slack SocketModeClient encounters a DNS resolution failure (getaddrinfo ENOTFOUND slack.com). The error propagates as an unhandled promise rejection, which kills the entire Node.js process.

Environment

  • OpenClaw Version: 2026.2.15
  • Node.js: v22.22.0
  • OS: macOS (Darwin 25.2.0, arm64)
  • Slack Mode: Socket Mode (mode: "socket")

Reproduction

Occurs during transient DNS failures (e.g., brief network glitch, sleep/wake cycle). Happened 2x in 2 days (Feb 18 + Feb 19, 2026) with identical stack traces.

Stack Trace

[ERROR]  socket-mode:SocketModeClient:0 Failed to retrieve a new WSS URL
         (error: Error: A request error occurred: getaddrinfo ENOTFOUND slack.com)
[openclaw] Unhandled promise rejection: Error: A request error occurred: getaddrinfo ENOTFOUND slack.com
    at requestErrorWithOriginal (@slack/web-api/src/errors.ts:82:5)
    at WebClient.<anonymous> (@slack/web-api/src/WebClient.ts:767:43)
    at Generator.throw (<anonymous>)
    at rejected (@slack/web-api/dist/WebClient.js:39:65)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)

Key Observation

In the same gateway run, there were 61 non-fatal unhandled rejections (caught by OpenClaw's global handler as Non-fatal unhandled rejection (continuing)) but 2 fatal ones — both from @slack/web-api's SocketModeClient. This suggests the Slack Socket Mode client's promise rejection bypasses the global handler in certain timing conditions.

Expected Behavior

DNS resolution failures in the Slack client should be caught and retried gracefully (with backoff), not crash the entire gateway process.

Workaround

Using launchctl / KeepAlive to auto-restart the gateway after crash. This limits downtime but doesn't prevent data loss (e.g., in-flight session logs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions