discord.js: Bot loses connection to discord and cant reconnect after
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.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (6 by maintainers)
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