Nils
Nils
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
actually getting a completely new error now:
[11/07/2024-20:28:46.833] [ERROR] Error: spawn /usr/local/bin/node EAGAIN
at Process.ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -11,
code: 'EAGAIN',
syscall: 'spawn /usr/local/bin/node',
path: '/usr/local/bin/node',
spawnargs: [ '/home/container/bot.js' ]
}
[11/07/2024-20:28:46.833] [ERROR] Error: spawn /usr/local/bin/node EAGAIN
at Process.ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -11,
code: 'EAGAIN',
syscall: 'spawn /usr/local/bin/node',
path: '/usr/local/bin/node',
spawnargs: [ '/home/container/bot.js' ]
}
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
alright I will try
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
I could try again, but since it's working now I wouldn't like to shut down the bot again and put it on auto
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
there isn't actually
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
Well if listed in app directory it shows the amount of guilds there
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
it's a bit of a workaround, but it's working now again at least
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
Guilds is the number of guilds the bot is in, with limit I can adjust the total number of guilds per shard. I actually got it to work now with a higher guild number. I suspect the problem was too many guilds on one shard, however that wouldn't explain why auto sharding wasn't working.
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
ShardingManager.js
const fs = require('fs');
const { ShardingManager } = require('discord.js');
require('console-stamp')(console, 'dd/mm/yyyy-HH:MM:ss.l');

require('dotenv').config();

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

console.log(`Shards to spawn: ${manager.totalShards}`);

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

manager.spawn({ amount: manager.totalShards, delay: 5500, timeout: 60000 })
.then(() => console.log(`All shards ready!`));
const fs = require('fs');
const { ShardingManager } = require('discord.js');
require('console-stamp')(console, 'dd/mm/yyyy-HH:MM:ss.l');

require('dotenv').config();

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

console.log(`Shards to spawn: ${manager.totalShards}`);

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

manager.spawn({ amount: manager.totalShards, delay: 5500, timeout: 60000 })
.then(() => console.log(`All shards ready!`));
Error
[11/07/2024-19:55:05.290] [ERROR] Error [ShardingReadyDied]: Shard 44's process exited before its Client became ready.
at Shard.onDeath (/home/container/node_modules/discord.js/src/sharding/Shard.js:178:16)
at Object.onceWrapper (node:events:634:26)
at Shard.emit (node:events:519:28)
at Shard.emit (node:domain:488:12)
at Shard._handleExit (/home/container/node_modules/discord.js/src/sharding/Shard.js:439:10)
at ChildProcess.emit (node:events:519:28)
at ChildProcess.emit (node:domain:488:12)
at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12) {
code: 'ShardingReadyDied'
}
[11/07/2024-19:55:05.290] [ERROR] Error [ShardingReadyDied]: Shard 44's process exited before its Client became ready.
at Shard.onDeath (/home/container/node_modules/discord.js/src/sharding/Shard.js:178:16)
at Object.onceWrapper (node:events:634:26)
at Shard.emit (node:events:519:28)
at Shard.emit (node:domain:488:12)
at Shard._handleExit (/home/container/node_modules/discord.js/src/sharding/Shard.js:439:10)
at ChildProcess.emit (node:events:519:28)
at ChildProcess.emit (node:domain:488:12)
at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12) {
code: 'ShardingReadyDied'
}
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
it's shard 44 now
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
I just removed the totalshard limit so it automatically adjusts the number of shards and am receiving the same error as before, at a different shard tho
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
well this only pushes the error back to a different shard
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
what is weird though is that the bot worked completely fine before but now is crashing every time due to this error. I did not change anything at all.
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
weird enough discord does not want to send the message with the bot.js, here it is in a pastebin https://pastebin.com/uRaweVq7
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 7/11/2024 in #djs-questions
Sharding not working anymore out of nowhere
ShardingManager.js
const fs = require('fs');
const { ShardingManager } = require('discord.js');
require('console-stamp')(console, 'dd/mm/yyyy-HH:MM:ss.l');

require('dotenv').config();

const manager = new ShardingManager('./bot.js', {
token: process.env.TOKEN,
totalShards: Math.ceil(process.env.GUILDS / process.env.LIMIT),
timeout: -1,
respawn: true
});

console.log(`Shards to spawn: ${manager.totalShards}`);

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

manager.spawn({ amount: manager.totalShards, delay: 5500, timeout: 60000 })
.then(() => console.log(`All shards ready!`));
const fs = require('fs');
const { ShardingManager } = require('discord.js');
require('console-stamp')(console, 'dd/mm/yyyy-HH:MM:ss.l');

require('dotenv').config();

const manager = new ShardingManager('./bot.js', {
token: process.env.TOKEN,
totalShards: Math.ceil(process.env.GUILDS / process.env.LIMIT),
timeout: -1,
respawn: true
});

console.log(`Shards to spawn: ${manager.totalShards}`);

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

manager.spawn({ amount: manager.totalShards, delay: 5500, timeout: 60000 })
.then(() => console.log(`All shards ready!`));
16 replies
DIAdiscord.js - Imagine an app
Created by Nils on 11/14/2023 in #djs-questions
Sharding times out after several other shards launched successfully
That apparently works even though I could've sworn I had already tried that. Thank you very much!
9 replies
DIAdiscord.js - Imagine an app
Created by Nils on 11/14/2023 in #djs-questions
Sharding times out after several other shards launched successfully
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.
9 replies
DIAdiscord.js - Imagine an app
Created by Nils on 11/14/2023 in #djs-questions
Sharding times out after several other shards launched successfully
It's the Ubuntu default of 31593
9 replies
DIAdiscord.js - Imagine an app
Created by Nils on 11/14/2023 in #djs-questions
Sharding times out after several other shards launched successfully
Actually there is one, but it is far from being reached.
9 replies
DIAdiscord.js - Imagine an app
Created by Nils on 11/14/2023 in #djs-questions
Sharding times out after several other shards launched successfully
No, it does not.
9 replies