Sharding times out after several other shards launched successfully

Good afternoon everybody, I'm currently stuck with a sharding problem that only occurs on my external VPS. At the moment I can't really differenciate if it is because of said VPS or if it is problem with discord.js, that's why I'm here as my last option of help. When running the bot on my local computer everything works just fine. Every shard launches correctly and is ready to use afterwards. Now I tried to migrate everything to a VPS to try to put the bot into operation. The problem now is that after several shards launched successfully, the next one times out and I get the following error:
Error [ShardingReadyTimeout]: Shard 45's Client took too long to become ready.
at Timeout.onTimeout (/home/container/node_modules/discord.js/src/sharding/Shard.js:183:16)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
code: 'ShardingReadyTimeout'
}
Error [ShardingReadyTimeout]: Shard 45's Client took too long to become ready.
at Timeout.onTimeout (/home/container/node_modules/discord.js/src/sharding/Shard.js:183:16)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
code: 'ShardingReadyTimeout'
}
My sharding manager looks like this:
const { ShardingManager } = require('discord.js');

require('dotenv').config();

const manager = new ShardingManager('./bot.js', { token: process.env.TOKEN, respawn: true });

manager.on('shardCreate', shard => console.log(`Shard ${shard.id} launching...`));

manager.spawn({ delay: 1500, timeout: 30000 }).catch(error => console.log(error));
const { ShardingManager } = require('discord.js');

require('dotenv').config();

const manager = new ShardingManager('./bot.js', { token: process.env.TOKEN, respawn: true });

manager.on('shardCreate', shard => console.log(`Shard ${shard.id} launching...`));

manager.spawn({ delay: 1500, timeout: 30000 }).catch(error => console.log(error));
I hope someone finds the solution to this, thanks in advance!
5 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Aman
Aman8mo ago
You should set the timeout to -1 I guess
Nils
Nils8mo ago
No, it does not. Actually there is one, but it is far from being reached. It's the Ubuntu default of 31593 Oh wait, I've just checked again. It's 512 (the default of the Pterodactyl panel I'm using), but I could set it higher if needed.
Aman
Aman8mo ago
There's a similar issue posted on GitHub, maybe try this https://github.com/discordjs/discord.js/issues/7191#issuecomment-1193150881
GitHub
SHARDING_READY_TIMEOUT Shard 0's Client took too long to become rea...
Issue description My bot is currently at 11 shards for it, and when I try to start the bot on my VPS which has 4vCores and 4GB of ram, one shard out of the 11 randomly takes too long to respond, an...
Nils
Nils8mo ago
That apparently works even though I could've sworn I had already tried that. Thank you very much!
Want results from more Discord servers?
Add your server
More Posts