question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bot loses connection to discord and cant reconnect after

See original GitHub issue

Please describe the problem you are having in as much detail as possible:

i’ve recently upgraded my bot to v12 and also moved to docker.

when i use it in production as part of a 70 shards bot, it will eventually disconnect from discord and not restart or reconnect. after forcefully restarting the docker container, it works for a few hours and then the same thing happens

Sharding: I currently use a custom sharding method and i provide each docker container with a shard id and a shard count and pass those to the discord.js client options. I spread the shards over multiple servers.

i was able to catch the following logs, i have no idea what the problem could be seeing this. the internet connection at that time seems fine as i can still ping 8.8.8.8 just fine when that happens.

It seems to be related to some websocket issue.

Logs / error output: https://gist.github.com/DELUUXE/e19ae15a6874947e2c6ea04ab6984a93

Include a reproducible code sample here, if possible: I currently do not have any sample code i can provide here, since testing this issue takes a while before it occurs, its also inconsistent, but around a few hours after starting.

Further details:

  • discord.js version: 12.1.1
  • Node.js version: v13.11.0 (node:latest (docker image hub))
  • Operating system: debian based docker image (node:latest ( v13.11.0)) Linux 2cd4bc2ad366 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
  • Priority this issue should have – please be realistic and elaborate if possible:

Since this issue is kind of annoying, i’d give it a 7/10

  • I have also tested the issue on latest master, commit hash:

Due to the time it takes before this issue happens, i have not been able to test it on the lastest commit on master.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vladfrangucommented, Apr 25, 2020

Yep, yep! Since the former is very spammy, and the latter shouldn’t have anything to do with this issue. I’m mostly interested in the API close codes and such

0reactions
DELUUXEcommented, May 7, 2020

Quick update; I moved to a kubernetes cluster a few days after my last comment, since then i have not had this issue within the same time as i had it before. Though i have not yet been able to run it for more than 2 consecutive days, due to other issues. I think its safe to close this issue as others don’t seem to have this issue. Thanks for your help and sorry for taking your time 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Fixed]: Discord Keeps Disconnecting and Reconnecting
General troubleshooting fixes if Discord keeps disconnecting for you · 1. Check if Discord servers are down · 2. Use the web app...
Read more >
python - Discord Bot fails to reconnect to voice chat after leaving
As far as I'm aware (from my own bot experience, at least) one of the usual causes for this is that the context...
Read more >
How to Fix Discord Keeps Disconnecting and Reconnecting?
This can be due to a number of reasons which include running Discord with insufficient permissions or the server region that you are...
Read more >
How to Fix Discord Connection Issues - Lifewire
Discord stuck on connecting is usually caused by technical problems on Discord's side, such as high volumes of traffic, or internet connectivity ...
Read more >
Discord Keeps Disconnecting - Here's How To Fix?
Basic Troubleshooting Steps. Step 1: Restart your PC; Step 2: Check your Internet Connection · Method To Fix Discord Keeps Disconnecting Issue.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found