Skip to content

Unhandled promise rejection in Slack provider crashes entire gateway #22865

@creditblake

Description

@creditblake

Summary

Network failures in the Slack provider cause unhandled promise rejections that crash the entire gateway process, triggering launchd restart loops.

Steps to Reproduce

  1. Run gateway with Slack channel configured
  2. Experience network interruption (DNS failure, connectivity loss)
  3. Observe gateway crash and restart loop

Expected Behavior

Network failures in one channel provider should be handled gracefully with retry logic. The gateway should continue running and serving other channels (iMessage, etc.) even if Slack is temporarily unreachable.

Actual Behavior

[ERROR] socket-mode:SocketModeClient:2 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 (/opt/homebrew/lib/node_modules/openclaw/node_modules/@slack/web-api/src/errors.ts:82:5)
    at WebClient.<anonymous> (/opt/homebrew/lib/node_modules/openclaw/node_modules/@slack/web-api/src/WebClient.ts:767:43)

The gateway crashes and launchd restarts it. If network is still down, it immediately crashes again, creating a rapid restart loop (~10 second intervals).

Environment

  • OpenClaw: 2026.2.19-2
  • Node.js: 25.6.0
  • macOS: Darwin 24.6.0 (arm64)
  • Running via launchd LaunchAgent

Impact

  • Gateway becomes unavailable during network issues
  • Restart loops can corrupt device pairing state (see related issue)
  • All channels go down, not just Slack

Suggested Fix

Wrap Slack WebClient operations in try/catch and implement graceful degradation with exponential backoff retry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions