Users are reporting that the bot is Offline (Shows offline status, doesn't respond) in some certain servers. Bot shows Online Status and responds in that server after restart.
Bot should respond to commands in the server and show an Online Status.
N/A
int shard_count = 15;
JDABuilder shardbuilder = new JDABuilder();
shardbuilder.setToken("TOKEN");
for (int i = 0; i < shard_count; i++)
{
shards[i] = shardbuilder.useSharding(i, shard_count).build();
shards[i].addEventListener(new com.ctection.commands.handlers.ListenerDivider());
}
N/A
You're using the deprecated JDABuilder constructor. For sharding, you should use DefaultShardManagerBuilder instead. Are you sure that your bot is big enough to require sharding? It comes with a few downsides like shards taking 5 seconds per connection to start. The DefaultShardManager will automatically choose the recommended amount by default, which might solve the issue.
Yeah the bot is large enough to require 15 shards.
This only seems to occur after the bot has been running for a couple of days - I'll provide debug logs as well as a thread dump as soon as I get a user report of the bot being offline then.
JDAInfo.VERSION reports 4.2.0_204, latest on the CI.
I recently cleaned up the project and removed all the dependencies that are unneeded - however, I'm noticing that shards seem to crash and fail to reconnect. I have changed the reconnect timeout to 60s but it seems to ignore it - last time it happened the shard was offline for more than 7 hours.
Your quest hasn't changed. I want the logs and thread dump.
I will try to get them asap, according to shard info the shard is in RECONNECT_QUEUED state.
Thread Dump: https://discordcaptcha.com/threaddump.tdump
Shard id 6 is down
What about logs?
Nothing in the logs
Then I can't help you. This information is inconclusive and honestly useless as is.
It seems to be fine with older versions of JDA. I dont know what kind of info to give you then - you requested this.
I requested logs and you just say there is "nothing" even though I know thats not true. There are definitely logs unless you didn't enable debug logs like I asked you to. If you can't provide me the information that I ask for then I can't solve any issues.
The logs cover 24 hours of operations. It also includes information which can be used to reverse engineer our proprietary code.
If you're unwilling to cooperate then I'm gonna close this issue as I can't do anything about it. If you don't provide me the details I need to solve the issue that I can't reproduce, then it's your own issue you need to solve.
Most helpful comment
The logs cover 24 hours of operations. It also includes information which can be used to reverse engineer our proprietary code.