Discord.js: Invalid shard settings WebSocketManager

Created on 16 Dec 2019  Â·  10Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
Impossible to load any of my shards with sharding manager after latest commit https://github.com/discordjs/discord.js/pull/3393

Include a reproducible code sample here, if possible:

0|Koya  | WebSocketShard {
0|Koya  |   _events: [Object: null prototype] {
0|Koya  |     allReady: [Function],
0|Koya  |     close: [Function],
0|Koya  |     invalidSession: [Function],
0|Koya  |     destroyed: [Function]
0|Koya  |   },
0|Koya  |   _eventsCount: 4,
0|Koya  |   _maxListeners: undefined,
0|Koya  |   manager: WebSocketManager {
0|Koya  |     _events: [Object: null prototype] {},
0|Koya  |     _eventsCount: 0,
0|Koya  |     _maxListeners: undefined,
0|Koya  |     gateway: 'wss://gateway.discord.gg/',
0|Koya  |     totalShards: 1,
0|Koya  |     shards: Collection [Map] { 102 => [Circular] },
0|Koya  |     status: 3,
0|Koya  |     destroyed: false,
0|Koya  |     reconnecting: false,
0|Koya  |     sessionStartLimit: { total: 1000, remaining: 963, reset_after: 59382501 }
0|Koya  |   },
0|Koya  |   id: 102,
0|Koya  |   status: 3,
0|Koya  |   sequence: -1,
0|Koya  |   closeSequence: 0,
0|Koya  |   sessionID: undefined,
0|Koya  |   ping: -1,
0|Koya  |   lastPingTimestamp: -1,
0|Koya  |   lastHeartbeatAcked: true
0|Koya  | }
0|Koya  | 23:29:25 | shardDisconnect Error
0|Koya  | Code : 4010
0|Koya  | [object Object]
0|Koya  | 23:29:25 | Login Error
0|Koya  | Code : SHARDING_INVALID
0|Koya  | Error [SHARDING_INVALID]: Invalid shard settings were provided.
0|Koya  |     at WebSocketManager.createShards (/home/koyamie/Koya/node_modules/discord.js/src/client/websocket/WebSocketManager.js:267:15)
0|Koya  |     at processTicksAndRejections (internal/process/task_queues.js:93:5)

Further details:

  • discord.js version: latest master
  • Node.js version: 12.13.1
  • Operating system: debian 9
  • Priority this issue should have – please be realistic and elaborate if possible: very high
  • [ ] I have also tested the issue on latest master, commit hash:
unverified gateway bug

Most helpful comment

@kyranet No it's not, I am using Discord.js Sharding Manager

All 10 comments

Can you share a reproducible code sample for this issue? I haven't had any issues, but I might have missed something!

Can you share a reproducible code sample for this issue? I haven't had any issues, but I might have missed something!

well basic sharding manager constructor

const Manager = new ShardingManager('./koyabot.js', {
    totalShards: 130,
    token: TOKEN,
    shardArgs: ['--trace-warnings']
});

I think there is something internally wrong with the Manager as right now I am recieving the same error when trying to create a second shard. I also get the INVALID_SHARD error code.

EDIT:
I am using Windows 10 and have this commit installed:
https://github.com/discordjs/discord.js/commit/5519d6fbaa61abccc27b742f97ad725bf4259

So I did some testing.

If I revert back one commit to https://github.com/discordjs/discord.js/commit/f56b442e83e4016015c9123d4308dbf9209eea76,
Everything functions as normal. The recommended amount of shards is spawned and everything is well in the world.

When we try to update to https://github.com/discordjs/discord.js/commit/5519d6fbaa61abccc27b742f97ad725bf4259, Discord no longer likes the shard settings of the second shard and shoves all guilds onto the first shard.

I have tested this with Node 13.3.0, NPM 6.13.1 and Yarn 1.21.1

In case of @Kashalls, they're using kurasuta, which is very highly likely that it hasn't been updated for the latest commit, and will obviously not work as it contained some internal breaking changes.

Is that also your case? @Koyamie

@kyranet No it's not, I am using Discord.js Sharding Manager

@Koyamie I am unable to reproduce your issue with latest master... Are you per chance manually parsing the shard ID/total? Are you actually able to reproduce the issue locally with a basic test with two simple files, and not with your bot?

@Koyamie I am unable to reproduce your issue with latest master... Are you per chance manually parsing the shard ID/total? Are you actually able to reproduce the issue locally with a basic test with two simple files, and not with your bot?

tried with my dev bot and it worked without issue so this is weird

@Koyamie I am unable to reproduce your issue with latest master... Are you per chance manually parsing the shard ID/total? Are you actually able to reproduce the issue locally with a basic test with two simple files, and not with your bot?

tried with my dev bot and it worked without issue so this is weird

If you'd want, you can contact me on Discord (Vladdy#0002) and I can try to aid you into debugging your issue (and to not clog up peoples emails). This should be fairly simple to debug tho, so no worries!

Tried with https://github.com/discordjs/discord.js/commit/50ed3293a57aeb0f9c094f00d49ed9874dc5d87a and it worked, havn't found the source of the issue but it is working so I am closing.
Thanks to everyone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DatMayo picture DatMayo  Â·  3Comments

kvn1351 picture kvn1351  Â·  3Comments

Alipoodle picture Alipoodle  Â·  3Comments

ghost picture ghost  Â·  3Comments

ghost picture ghost  Â·  3Comments