ClawKit Logo
ClawKitReliability Toolkit

Fix Slack Socket Mode Crash

Known Bug — Build 2026.2.19-2

This crash is a confirmed bug in the Slack plugin's EventEmitter initialization. The fix is to update to the latest version and regenerate your Slack App Token.

The Slack channel crashes immediately on startup with Cannot read properties of undefined (reading 'listeners'). The gateway enters an exponential backoff retry loop but never recovers without a fix.

The Error in Gateway Logs

Cannot read properties of undefined (reading 'listeners')
[slack] channel exited
Retrying in 5000ms...
Retrying in 10000ms...

The crash happens during channel initialization before any messages are processed. The Slack socket connection never completes, and exponential backoff retries all fail the same way.

Fix: Update OpenClaw + Regenerate App Token

Step 1: Update to Latest Version

Update
npm install -g openclaw@latest

Step 2: Regenerate the Slack App-Level Token

Regenerate in Slack Developer Portal

  1. 1. Go to api.slack.com/apps
  2. 2. Select your OpenClaw app
  3. 3. Click Basic Information in the left sidebar
  4. 4. Scroll to App-Level Tokens
  5. 5. Find your token (or create one) with connections:write scope
  6. 6. Click Regenerate (or Generate Token and Scopes)
  7. 7. Copy the new xapp-... token

Step 3: Update Token in OpenClaw Config

Update App Token
openclaw config set channels.slack.appToken "xapp-YOUR-NEW-TOKEN"
openclaw gateway restart

Alternative: Rebuild the Slack App Configuration

If regenerating the token doesn't fix it, try creating a brand new Slack app and configuring it fresh. Some configuration combinations trigger the EventEmitter bug in ways that a token regeneration alone can't fix.

Verify Slack App Setup

Socket Mode is enabled

Slack App → Settings → Socket Mode → Enable Socket Mode

App-Level Token has connections:write

Basic Information → App-Level Tokens → Token must include connections:write scope

Bot Token Scopes are correct

OAuth & Permissions → Bot Token Scopes: chat:write, channels:read, channels:history, app_mentions:read

Event Subscriptions are enabled

Event Subscriptions → Enable Events → Subscribe to: message.channels, app_mention

Required Slack Scopes

Bot Token Scopes (xoxb-)

chat:write
channels:read
channels:history
app_mentions:read
im:read
im:history
im:write

App-Level Token Scopes (xapp-)

connections:write

App-Level Token is required for Socket Mode — it's different from the Bot Token.

Still Crashing?

Check the exact crash location in logs:

Debug Logs
openclaw logs --follow | grep -i slack

Run the Doctor

npx clawkit-doctor@latest

Checks channel configuration, token validity, and gateway health.

Did this guide solve your problem?

Need Help?

Try our automated tools to solve common issues instantly.