discord.js icon indicating copy to clipboard operation
discord.js copied to clipboard

Random connection errors

Open virtual-designer opened this issue 3 years ago • 5 comments

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

virtual-designer avatar Aug 14 '22 14:08 virtual-designer

Possibly relevant: https://github.com/nodejs/undici/issues/1531

Jiralite avatar Aug 14 '22 15:08 Jiralite

having the same issues, but it's undici acting up, not d.js

Larsundso avatar Aug 19 '22 08:08 Larsundso

Having the same issue, but exceptionally on Ubuntu VPS, on Mac everything works properly.

eightless avatar Aug 30 '22 16:08 eightless

I had a similar problem that only started occuring when i selfhosted but i have an idea now, ill get back to you

Raz-js avatar Sep 06 '22 08:09 Raz-js

reproducible here

EduApps-CDG avatar Sep 11 '22 05:09 EduApps-CDG

Can reproduce too. Happens randomly on an Ubuntu VPS.

cwkhawand avatar Sep 24 '22 22:09 cwkhawand

Hey, I'm experiencing this issue. How do I fix it?

TheGalacticAce avatar Dec 21 '22 01:12 TheGalacticAce

Did anyone find a fax?

Satindar31 avatar Feb 25 '24 15:02 Satindar31