You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Uncaught exception: Error: Max reconnect attempts (0) reached after code 1006 at GatewayPlugin.handleReconnectionAttempt #36055
18:49:51 [openclaw] Uncaught exception: Error: Max reconnect attempts (0) reached after code 1006
at GatewayPlugin.handleReconnectionAttempt (file:///C:/Users/phanm/AppData/Roaming/nvm/v22.17.1/node_modules/openclaw/node_modules/@buape/carbon/src/plugins/gateway/GatewayPlugin.ts:400:5)
at GatewayPlugin.handleClose (file:///C:/Users/phanm/AppData/Roaming/nvm/v22.17.1/node_modules/openclaw/node_modules/@buape/carbon/src/plugins/gateway/GatewayPlugin.ts:466:8)
at WebSocket.<anonymous> (file:///C:/Users/phanm/AppData/Roaming/nvm/v22.17.1/node_modules/openclaw/node_modules/@buape/carbon/src/plugins/gateway/GatewayPlugin.ts:376:9)
at WebSocket.emit (node:events:518:28)
at WebSocket.emitClose (C:\Users\phanm\AppData\Roaming\nvm\v22.17.1\node_modules\openclaw\node_modules\ws\lib\websocket.js:263:12)
at emitErrorAndClose (C:\Users\phanm\AppData\Roaming\nvm\v22.17.1\node_modules\openclaw\node_modules\ws\lib\websocket.js:1047:13)
at processTicksAndRejections (node:internal/process/task_queues:90:21)
Steps to reproduce
Setting new token bot for discord channel file openclaw.json
Expected behavior
Reload config instead of crash app for over maximum configuration of attempt reload
I hit what looks like the same crash class on macOS, but in a different trigger path, and it still happened for me on 2026.3.7.
Environment:
OpenClaw 2026.3.7
macOS 26.3 (arm64)
install method: npm global + OpenClaw.app installed
Discord enabled as a critical remote channel
Discord configured with an explicit local proxy (channels.discord.proxy = http://127.0.0.1:7897) while the machine was also using Clash Verge TUN
What happened:
Discord started failing with transient network/proxy/TLS errors rather than an obviously bad token
I saw repeated log lines like:
Failed to get gateway information from Discord: fetch failed
failed to deploy native commands: fetch failed
failed to fetch bot identity: TypeError: fetch failed
gateway error: Error: Client network socket disconnected before secure TLS connection was established
Then the gateway hit the uncaught reconnect path and exited:
Uncaught exception: Error: Max reconnect attempts (0) reached after code 1006
Observed impact:
ai.openclaw.gateway LaunchAgent stopped
ai.openclaw.node then also stopped because it could no longer connect to local gateway 127.0.0.1:18789
OpenClaw.app stayed open, but openclaw status showed gateway unreachable and both services stopped
Recovery:
Manual openclaw gateway restart
Manual openclaw node restart
After restart, openclaw channels status --probe returned Discord connected again
Why this might be useful:
This was not a stable misconfiguration like an invalid token. The same config later recovered and connected successfully.
So this seems to confirm that transient Discord/network failures can still escalate into a process-level gateway exit on a current release, at least in this proxy/TUN setup.
If helpful, I can also provide the exact log snippet sequence with timestamps from my local gateway.err.log / node.err.log.
Closing as duplicate of #54182, merged on March 25, 2026. That fix keeps the Discord 1006 reconnect failure from surfacing as an uncaught exception that crashes the gateway.
Activity
Octane0411 commentedon Mar 5, 2026
Submitted a fix in #36159.
codex/fix-36055-uncaughtRoot Cause
Fix
Verification
kkellyoffical commentedon Mar 9, 2026
I hit what looks like the same crash class on macOS, but in a different trigger path, and it still happened for me on 2026.3.7.
Environment:
channels.discord.proxy = http://127.0.0.1:7897) while the machine was also using Clash Verge TUNWhat happened:
Failed to get gateway information from Discord: fetch failedfailed to deploy native commands: fetch failedfailed to fetch bot identity: TypeError: fetch failedgateway error: Error: Client network socket disconnected before secure TLS connection was establishedUncaught exception: Error: Max reconnect attempts (0) reached after code 1006Observed impact:
ai.openclaw.gatewayLaunchAgent stoppedai.openclaw.nodethen also stopped because it could no longer connect to local gateway127.0.0.1:18789OpenClaw.appstayed open, butopenclaw statusshowed gateway unreachable and both services stoppedRecovery:
openclaw gateway restartopenclaw node restartopenclaw channels status --probereturned DiscordconnectedagainWhy this might be useful:
If helpful, I can also provide the exact log snippet sequence with timestamps from my local
gateway.err.log/node.err.log.steipete commentedon Mar 25, 2026
Closing as duplicate of #54182, merged on March 25, 2026. That fix keeps the Discord 1006 reconnect failure from surfacing as an uncaught exception that crashes the gateway.