Shard #1 and #2 work, but Shard #3 fails at startup
What's the problem? Hello! I am hosting a bot in ~8k servers. Recently, I have been encountering an issue during startup. Shard #1 and Shard #2 start perfectly. However, Shard #3 fails to start (hindering ongoing startups).
What have you tried From the error and logging, I have not yet identified the issue. I can imagine several reasons that I could not verify - Guild in shard #3 is bugged - Recent update? I use the newest stable discord.js - I also tried increasing the startup time limit
Error:
0|. | Shard #3 is online.0|. | Error [ShardingReadyTimeout]: Shard 3's Client took too long to become ready.0|. | at Timeout.onTimeout (/root/snaky/node_modules/discord.js/src/sharding/Shard.js:190:16)0|. | at listOnTimeout (node:internal/timers:573:17)0|. | at process.processTimers (node:internal/timers:514:7) {0|. | code: 'ShardingReadyTimeout'0|. | }
0|. | Shard #3 is online.0|. | Error [ShardingReadyTimeout]: Shard 3's Client took too long to become ready.0|. | at Timeout.onTimeout (/root/snaky/node_modules/discord.js/src/sharding/Shard.js:190:16)0|. | at listOnTimeout (node:internal/timers:573:17)0|. | at process.processTimers (node:internal/timers:514:7) {0|. | code: 'ShardingReadyTimeout'0|. | }
Sharding Code:
var manager = new ShardingManager("./bot.js", { token: auth[key], execArgv: ['--trace-uncaught', '--trace-warnings', '--inspect=0'], totalShards: 'auto', timeout: 120_000 }); manager.spawn({ amount: 'auto', delay: 10000, timeout: 120000}); // Track when all shards are ready let readyShards = new Set(); manager.on("shardCreate", shard => { console.log(`Shard #${shard.id} is online.`); // THIS FIRES FOR SHARD 1, 2, and 3 shard.on("ready", () => { // THIS ONLY FIRES FOR SHARD 1 and 2 readyShards.add(shard.id); console.log(`Shard #${shard.id} is ready. (${readyShards.size}/${manager.totalShards} shards ready)`); if (readyShards.size === manager.totalShards) { console.log("All shards are now ready!"); } }); });}
var manager = new ShardingManager("./bot.js", { token: auth[key], execArgv: ['--trace-uncaught', '--trace-warnings', '--inspect=0'], totalShards: 'auto', timeout: 120_000 }); manager.spawn({ amount: 'auto', delay: 10000, timeout: 120000}); // Track when all shards are ready let readyShards = new Set(); manager.on("shardCreate", shard => { console.log(`Shard #${shard.id} is online.`); // THIS FIRES FOR SHARD 1, 2, and 3 shard.on("ready", () => { // THIS ONLY FIRES FOR SHARD 1 and 2 readyShards.add(shard.id); console.log(`Shard #${shard.id} is ready. (${readyShards.size}/${manager.totalShards} shards ready)`); if (readyShards.size === manager.totalShards) { console.log("All shards are now ready!"); } }); });}
I appreciate any help and hints. Thank you!
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
d-Iaa
discord.js - Imagine an app
Support server for discord.js, a Node.js module to interact with Discord's apps API.