discord.js
discord.js copied to clipboard
Websocket was closed before the connection was established / Connect Timeout Error
Which package is this bug report for?
discord.js
Issue description
I'm on version: 14.0.0-dev.1656158629-c4653f9
Got this on 29.06.2022 ~22:40 UTC:
Error: WebSocket was closed before the connection was established
at WebSocket.close (/home/pi/Node/CStoneBot/node_modules/discord.js/node_modules/ws/lib/websocket.js:285:14)
at WebSocketShard.destroy (/home/pi/Node/CStoneBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:807:27)
at Timeout.<anonymous> (/home/pi/Node/CStoneBot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:554:12)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)
App [CStoneBot:1] exited with code [1] via signal [SIGINT]
App [CStoneBot:1] starting in -fork mode-
App [CStoneBot:1] online
ConnectTimeoutError: Connect Timeout Error
at Timeout.onConnectTimeout [as _onTimeout] (/home/pi/Node/CStoneBot/node_modules/undici/lib/core/connect.js:108:24)
at listOnTimeout (node:internal/timers:559:11)
at processTimers (node:internal/timers:500:7) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
Code sample
No response
Package version
14.0.0-dev.1656158629-c4653f9
Node.js version
16.13.0
Operating system
Raspbian GNU/Linux 11 (bullseye) armv
Priority this issue should have
Medium (should be fixed soon)
Which partials do you have configured?
User, Channel, GuildMember, Message, Reaction, GuildScheduledEvent, ThreadMember
Which gateway intents are you subscribing to?
Guilds, GuildMembers, GuildBans, GuildEmojisAndStickers, GuildIntegrations, GuildWebhooks, GuildInvites, GuildVoiceStates, GuildPresences, GuildMessages, GuildMessageReactions, GuildMessageTyping, DirectMessages, DirectMessageReactions, DirectMessageTyping, MessageContent, GuildScheduledEvents
I have tested this issue on a development release
c4653f9
Happening to me too, shard won't reconnected until forced and my logs are spammed like hell.
Suggested: absorb the "close before connect" symptomatic exception, and maybe reinitialize the WebSocketShard with a limited retry loop and a exponential delay interval ??
I am having the same issue. Passing shards: 'auto'
into my Client Options causes this error. Removing it fixes this issue, but this should not be happening, if I'm correct
Hi I have the same error in Discord.js v13.13.1 and ws v8.12.1 . This error come randomly and the bot disconnect from the vc. I saw that a way to reproduce this error is to turn on the intents in dev portal than turn them off .
The WebSocket implementation has since been rewritten. If this issue can still be reproduced (on the latest version), please open a new one.