#Shards are Still being spawned + Sharding Ready died

54 messages · Page 1 of 1 (latest)

livid seal
simple aspen
#

And the bot has been recoded several times after that

livid seal
#

Qjuh's acting like he's going on a rampage

#

Therefore, i have not been able to reach a solution for about 5 hours

#

Thanks for your reply anyway :)

wintry merlin
# livid seal Qjuh's acting like he's going on a rampage

Maybe you shouldn’t talk like that about someone who spent hours to help you and literally told you what to do to fix it (and also did so in this thread if you scrolled up). Everyone on this server is a volunteer and has a life outside of it, so be a bit more respectful to those that dedicate time to help you

livid seal
#

I saw in your old posts that you run the handler when all the shards are running and I did it this way. This fixed that bug but created another bug. Now when I use the commands I get "ConnectTimeoutError: Connect Timeout Error (attempted addresses: IP:443, IP:443, IP:443, IP:443, IP:443, IP:443)"

#

If i don't put the mongo connect function there, i get the mongo failed to connect error

livid seal
#

Only move connectMongo function in allShardsReady process and use setTimeout

simple aspen
#

Code is fine. Token is fine. Works with Staging but not on main (i know sorta a replica but other errors)

#

Preparing to connect to the gateway...
[WS => Manager] Fetched Gateway Information
URL: wss://gateway.discord.gg
Recommended Shards: 1
[WS => Manager] Session Limit Information
Total: 1000
Remaining: 341
[WS => Manager] Spawning shards: 0
[WS => Shard 0] [CONNECT]
Gateway : wss://gateway.discord.gg/
Version : 9
Encoding : json
Compression: none
[WS => Shard 0] Setting a HELLO timeout for 20s.
[WS => Shard 0] [CONNECTED] Took 238ms
[WS => Shard 0] Clearing the HELLO timeout.
[WS => Shard 0] Setting a heartbeat interval for 41250ms.
[WS => Shard 0] [IDENTIFY] Shard 0/2 with intents: 515
[WS => Shard 0] [READY] Session 5f736b66acd5fe1f916f99abf52d1515.
[WS => Shard 0] [ReadyHeartbeat] Sending a heartbeat.
[WS => Shard 0] Heartbeat acknowledged, latency of 830ms.
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^

#

Error [SHARDING_IN_PROCESS]: Shards are still being spawned.
at ShardingManager._performOnShards (F:\marzt\Documents\Dev\prns\node_modules\discord.js\src\sharding\ShardingManager.js:285:75)
at ShardingManager.fetchClientValues (F:\marzt\Documents\Dev\prns\node_modules\discord.js\src\sharding\ShardingManager.js:266:17)
at Shard._handleMessage (F:\marzt\Documents\Dev\prns\node_modules\discord.js\src\sharding\Shard.js:359:22)
at ChildProcess.emit (node:events:527:28)
at emit (node:internal/child_process:936:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Node.js v18.2.0
F:\marzt\Documents\Dev\prns\node_modules\discord.js\src\sharding\Shard.js:161
reject(new Error('SHARDING_READY_DIED', this.id));
^

Error [SHARDING_READY_DIED]: Shard 0's process exited before its Client became ready.
at Shard.onDeath (F:\marzt\Documents\Dev\prns\node_modules\discord.js\src\sharding\Shard.js:161:16)
at Object.onceWrapper (node:events:642:26)
at Shard.emit (node:events:527:28)
at Shard._handleExit (F:\marzt\Documents\Dev\prns\node_modules\discord.js\src\sharding\Shard.js:407:10)
at ChildProcess.emit (node:events:527:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
[Symbol(code)]: 'SHARDING_READY_DIED'
}

#

_

_

#

The Staging Bot works more than fine

#

its just the main Bot

topaz spoke
#

you are using client.shard.fetchClientValues() before every shard is spawned

#

likely because "Staging Bot" only has one shard

simple aspen
#

Cuz the Presence sets as soon as one shard is running

#

Seems like that is not fixing it tho

wintry merlin
simple aspen
#

i actually dont know how to

sour galleonBOT
#

Documentation suggestion for @simple aspen:
interface ClientOptions
Options for a client.

simple aspen
#

And it seems like its not a thing that the presence is doing

simple aspen
#

Even with the code removed it does not work

wintry merlin
#

Then you have another fetchClientValues somewhere.

simple aspen
#

Could i maybe let the bot wait that it does nothing at all until all shards are done loading?

#

Like is there a way to tell it to wait?

#

Now it takes too long to become ready

#

nvm

#

same error

#

everything that somehow calls fetchClientValues is removed

#

that makes literally no sense

topaz spoke
#

both fetchClientValues and broadcastEval cannot be called until all shards have spawned

wintry merlin
#

You can simply catch the error and reschedule the same function call to be done later…

simple aspen
wintry merlin
simple aspen
#

Its only in Files that are only called when for example guildCreate is triggered

#

In ready its been removed aka commented out

topaz spoke
#

any event can be triggered before all other shards are spawned

#

e.g. if the first shard is ready, it can receive guildCreate events before the rest of the shards have spawned

simple aspen
#

Is there a way to check the Status of all shards? if yes i could theoretically put all events that just continue its stuff when every shard is ready

wintry merlin
simple aspen
#

Okay now i may have a solutuion

#

but its always timing out

#

so no way to test it

simple aspen
#

okay i think i fixed it

#

but the Timeouts are getting on my nerves

simple aspen
#

Okay seems like i fixed it. thx for ur help