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

ConnectTimeoutError #96

Open
iced-queen opened this issue May 10, 2024 · 6 comments
Open

ConnectTimeoutError #96

iced-queen opened this issue May 10, 2024 · 6 comments

Comments

@iced-queen
Copy link

Describe the bug
I hope the screenshot explains enough, because I am not entirely sure why I am getting this error.
I started getting this error approximately 3 weeks ago, before that I have never gotten it.

(To Reproduce)

Expected behavior
No error 😅

Screenshots & Error Stack
image

Discord.js Version

  • Latest (14.15.2)

Additional context
So I don't know, but could it be caused by slow internet. In that case is there a way to increase the timeout and if so would that be a proper solution?

@iced-queen
Copy link
Author

I think I fixed the issue by downgrading Node.js to version 18.20.2. I'm not entirely sure though.

@meister03
Copy link
Owner

@iced-queen what are your spawn options?

@meister03 meister03 reopened this May 12, 2024
@iced-queen
Copy link
Author

@iced-queen what are your spawn options?

const manager = new ClusterManager(`bot.js`, {
	totalShards: `auto`,
	shardsPerClusters: 3,
	respawn: true,
	token: process.env.NODE_ENV == `production` ? login.production_token : login.development_token,
	mode: `process`,
	restarts: {
		max: 5,
		interval: 1000 * 60 * 60 // 1 hour
	}
});

manager.extend(
	new HeartbeatManager({
		interval: 5000,
		maxMissedHeartbeats: 1
	}),
	new ReClusterManager()
);

@iam-green
Copy link

iam-green commented Aug 1, 2024

The same problem happens to me.
Node.js version : v20.16.0
discord.js version : ^14.15.3
discord-hybrid-sharding version : ^2.2.0
spawn option code :

const manager = new ClusterManager(
  `${__dirname}/start.${process.argv[1].endsWith('.js') ? 'js' : 'ts'}`,
  {
    token: process.env.BOT_TOKEN,
    shardsPerClusters: 4,
    totalShards: 'auto',
    mode: 'process',
    respawn: true,
    restarts: {
      max: 6,
      interval: 1000 * 60 * 60,
    },
    ...(process.argv[1].endsWith('.ts') && {
      execArgv: ['-r', 'ts-node/register'],
    }),
  },
);
await manager.spawn({ timeout: -1 });

error log :
image

@meister03
Copy link
Owner

should actually not happen, if its on -1.

Does the issue appear on the djs sharding manager? My first guess would be that you are starting the ts file.

@iam-green
Copy link

The above error occurs when using this template.
Start the cluster using this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants