Jda: Bot is offline for some certain servers only

Created on 22 Sep 2020  路  16Comments  路  Source: DV8FromTheWorld/JDA

General Troubleshooting

  • [x] I have checked for similar issues.
  • [x] I have updated to the [latest JDA version][download].
  • [x] I have checked the branches or the maintainers' PRs for upcoming bug fixes.

Bug Report

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.

Expected Behavior

Bot should respond to commands in the server and show an Online Status.

Code Example or Reproduction Steps

N/A

Code for JDABuilder or DefaultShardManagerBuilder Used

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());
        }

Exception or Error

N/A

need more info

Most helpful comment

The logs cover 24 hours of operations. It also includes information which can be used to reverse engineer our proprietary code.

All 16 comments

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.

  1. What JDA Version does JDAInfo.VERSION print?
  2. Please provide debug logs for the issue How?
  3. Please provide a thread dump of the issue How?

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hitsu420 picture hitsu420  路  6Comments

YukioKeno picture YukioKeno  路  6Comments

sachinhasaphatass picture sachinhasaphatass  路  3Comments

StijnSimons picture StijnSimons  路  3Comments

Drischdaan picture Drischdaan  路  4Comments