discord.js
discord.js copied to clipboard
Random connection errors
Which package is this bug report for?
discord.js
Issue description
Random connection errors especially when using slash commands. I'm 100% sure my connection is strong enough. The error is given below:
ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (D:\Rakin\Projects\sudobot-v2\node_modules\undici\lib\core\connect.js:131:24)
at D:\Rakin\Projects\sudobot-v2\node_modules\undici\lib\core\connect.js:78:46
at Immediate._onImmediate (D:\Rakin\Projects\sudobot-v2\node_modules\undici\lib\core\connect.js:117:33)
at processImmediate (node:internal/timers:464:21) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
Code sample
// client = discord client
// this code might not always fail - for me the error was coming randomly
client.on('interactionCreate', async (interaction) => {
if (interaction.isChatInputCommand()) {
// do some stuff like bulk deleting messages or warning users
await interaction.reply({ content: 'Done' });
}
});
Package version
v14.2.0
Node.js version
v16.13.0
Operating system
Windows 10
Priority this issue should have
Medium (should be fixed soon)
Which partials do you have configured?
Channel
Which gateway intents are you subscribing to?
Guilds, GuildMembers, GuildBans, GuildEmojisAndStickers, GuildInvites, GuildPresences, GuildMessages, GuildMessageReactions, GuildMessageTyping, DirectMessages, DirectMessageReactions, DirectMessageTyping, MessageContent
I have tested this issue on a development release
No response
Possibly relevant: https://github.com/nodejs/undici/issues/1531
having the same issues, but it's undici acting up, not d.js
Having the same issue, but exceptionally on Ubuntu VPS, on Mac everything works properly.
I had a similar problem that only started occuring when i selfhosted but i have an idea now, ill get back to you
reproducible here
Can reproduce too. Happens randomly on an Ubuntu VPS.
I found two instances of requests from djs that uses fetch as it'srequest source:
My bet would be in the first one, since it's called on every bot start!!
Hey, I'm experiencing this issue. How do I fix it?
Did anyone find a fax?