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.
Jump to Section
The Error in Gateway Logs
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
npm install -g openclaw@latest
Step 2: Regenerate the Slack App-Level Token
Regenerate in Slack Developer Portal
- 1. Go to api.slack.com/apps
- 2. Select your OpenClaw app
- 3. Click Basic Information in the left sidebar
- 4. Scroll to App-Level Tokens
- 5. Find your token (or create one) with
connections:writescope - 6. Click Regenerate (or Generate Token and Scopes)
- 7. Copy the new
xapp-...token
Step 3: Update Token in OpenClaw Config
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:writechannels:readchannels:historyapp_mentions:readim:readim:historyim:writeApp-Level Token Scopes (xapp-)
connections:writeApp-Level Token is required for Socket Mode — it's different from the Bot Token.
Still Crashing?
Check the exact crash location in logs:
openclaw logs --follow | grep -i slack
Run the Doctor
Checks channel configuration, token validity, and gateway health.
Related Channel Issues
Similar issues on other platforms:
Fix It Faster With Our Tools
Did this guide solve your problem?