#bot going casually offline

73 messages · Page 1 of 1 (latest)

torpid burrow
#

i have a bot of ~550 guilds that casually goes offline sometimes and i have to restart that manually. i have other bots on the same vps that have fewer servers and do not have this problem (if u want to reply for a solution or smth pls ping me)

sour coral
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

torpid burrow
#

now ill send debug logs for when the bot crashes (kinda hard to get the exact moment because it happens casually). read #djs-help-v14 message for more

#

here is one (the ready log is from the ready event that occurred after i manually restarted the bot)

#

and here is another one (didnt restart the bot yet here, its still offline)

storm bear
#

The logs are not clear at all

storm bear
#

The logs are not clear

torpid burrow
#

how can i make them more clear

storm bear
#

Copy the logs

#

And paste them here

#

Or using sourcebin

torpid burrow
#

ill try to send the whole pm2 logs file

torpid burrow
storm bear
#

Please send your query in #djs-help-v14

#

I don't think I know enough to solve your problem

torpid burrow
#

alr thanks anyways

soft moon
#

just to catch you up
this issue has been ongoing for a while now and has had two separate prs that have each fixed the issue for some but not others
qjuh mentioned the author of the second pr in #djs-help-v14, but it seems they haven't responded yet

jolly cloakBOT
torpid burrow
#

so it isnt fixed yet? is there any patch available?

#

the crashes are happening like once a hour its becoming impossible to be there and always restart

soft moon
#

it was supposed to have been fixed twice, and the suggestion to use the dev build was to test those two fixes for your case

#

with this we'll need to investigate further

torpid burrow
#

alright. what i find really weird is that two days ago the bot was fine (on stable 14.7.0) then yesterday it started out of nowhere to crash and the dev just didnt change anything

soft moon
versed prism
#

@torpid burrow Hey, try setting the presence after 30s of the ready event using timeout.

#

also provide me with more logs and the ready event code

#

@soft moon hey since you are actively helping people, Can you please tell me how common is this issue happening and the frequency of it?

#

The last log @torpid burrow sent has no crash so I am a bit confused here

soft moon
#

it hasn't been happening as frequently since the two prs got merged
for frequency, I personally have only seen one or two since then

versed prism
#

hmm, from what I can see
It can be an issue because of network issue or slow vps if the process is not crashing

#

if the process is still crashing for them then its a library issue

#

as I said last log shows no sign or process exit or crash but rather shows a fine reconnect

copper sedge
torpid burrow
#

hi. uhm, yesterday i tried to convert the bot to another library to see if it was a djs problem and it crashed anyways (Error: connection reset by peer) so i think it might be a problem with my vps

copper sedge
shrewd nexus
versed prism
#

also the network

versed prism
#
sudo apt install iperf3
iperf3 -c iperf.par2.as49434.net -fm -p9204 -O2 -P5 -4
#

try this

#

and show the network response also show the config

shrewd nexus
#

what is that

versed prism
#

google iperf3

shrewd nexus
versed prism
#

send me latest logs where in the process crashes and ready event code(if you are updating presence in that event)

versed prism
shrewd nexus
# versed prism send me latest logs where in the process crashes and ready event code(if you are...

https://pastebin.com/683uR2Vh

but right now we're not using djs since clauz rewrote it to check if djs was the issue, should i also send that one? (it's the same except it uses eris methods ofc) and the process doesn't crash, i think the ws connection just dies because the bot silently goes offline

copper sedge
shrewd nexus
#

huh (crashed again, using eris tho)

#

no wait it came back

shrewd nexus
#

i will prob contact discord support soon if i don't find a fix

versed prism
#

its not a discord issue. If it was then it would have been common

shrewd nexus
# versed prism can be "your" issue or vps issue

i dont think it's a vps issue since i tested on 3 different machines (my pc, a hetzner dedicated server and the oracle cloud vps i use for main hosting) with two different libs (discord.js and eris), the hetzner server lasted a little bit longer but the bot went offline again

shrewd nexus
#

yeah i was thinking abt that

versed prism
#

we have never experienced that issue in our bot, we have 80+ shards and is one of the most active game bots out there

shrewd nexus
# versed prism so its your code

the only problem is that it's difficult to test because i really can't replicate the 550 guilds without testing in production :/

shrewd nexus
#

i will prob leave it overnight to check if it fixed

shrewd nexus
#

yeah.. it looks like a commit @torpid burrow pushed made the entire bot crash without logs, we still don't know what caused this crash but i'm pretty sure it's related to the db, well it's been a long journey, thanks to everyone for helping us

versed prism
#

👍

shrewd nexus
#

fuck my life

versed prism
shrewd nexus
# versed prism

looks like i fixed it for real now, there was a while loop that managed to break the event loop if ran for too long