Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random connection errors #8489

Closed
virtual-designer opened this issue Aug 14, 2022 · 9 comments · Fixed by #8679
Closed

Random connection errors #8489

virtual-designer opened this issue Aug 14, 2022 · 9 comments · Fixed by #8679

Comments

@virtual-designer
Copy link

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

@Jiralite
Copy link
Member

Possibly relevant: nodejs/undici#1531

@Larsundso
Copy link
Contributor

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

@eightless
Copy link

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

@Raz-js
Copy link

Raz-js commented Sep 6, 2022

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

@EduApps-CDG
Copy link

reproducible here

@cwkhawand
Copy link

Can reproduce too. Happens randomly on an Ubuntu VPS.

@JPBM135
Copy link
Contributor

JPBM135 commented Sep 25, 2022

I found two instances of requests from djs that uses fetch as it'srequest source:

const response = await fetch(RouteBases.api + Routes.gatewayBot(), {

const res = await fetch(resource);

My bet would be in the first one, since it's called on every bot start!!

@TheGalacticAce
Copy link

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

@Satindar31

This comment was marked as abuse.

@discordjs discordjs locked as resolved and limited conversation to collaborators Feb 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants