rfresh2 / ZenithProxy

2b2t minecraft proxy
Other
142 stars 33 forks source link

Discord Bot Error #130

Closed DrChic0 closed 3 months ago

DrChic0 commented 3 months ago

This error only happens after the bot has been in the 2b2t queue for a few hours, this bot is running within Ubuntu using a VPN and in a Hyper-v cluster with 3 other VMs that do the exact same as this one and are setup the same way (they don't have this error).

Happens after a few hours of been online

[d.gateway.DefaultGatewayClient] [ERROR] [G:66837e7b, S:0] Gateway client error reactor.core.Exceptions$OverflowException: Backpressure overflow during Sinks.Many#emitNext at reactor.core.Exceptions.failWithOverflow(Exceptions.java:251) at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:46) at discord4j.gateway.GatewayClient.lambda$send$0(GatewayClient.java:115) at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:196) at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2571) at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.request(FluxPeekFuseable.java:144) at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onSubscribe(MonoIgnoreElements.java:72) at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onSubscribe(FluxPeekFuseable.java:178) at reactor.core.publisher.FluxJust.subscribe(FluxJust.java:68) at reactor.core.publisher.Mono.subscribe(Mono.java:4563) at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:430) at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:335) at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:294) at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:373) at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:201) at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:83) at reactor.core.publisher.Mono.subscribe(Mono.java:4563) at reactor.core.publisher.Mono.block(Mono.java:1804) at com.zenith.discord.DiscordBot.updatePresence(DiscordBot.java:304) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583)

Happens when I try to restart it using bot commands

[Discord] [ERROR] Failed to restart discord bot java.lang.IllegalStateException: Timeout on blocking read for 20000000000 NANOSECONDS at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:127) at reactor.core.publisher.Mono.block(Mono.java:1805) at com.zenith.discord.DiscordBot.stop(DiscordBot.java:225) at com.zenith.command.impl.DiscordManageCommand.restartDiscordBot(DiscordManageCommand.java:231) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583)

The only few ways of fixing this is to:

  1. Completely restart the program (Only temporarily)
  2. Changing the discord token (Only temporarily)

This problem causes the discord bot to not be online on discord, the only to see what its doing is to remote into the machine or view the server through minecraft.

rfresh2 commented 3 months ago

has happened in the past when the discord bot software i use fails to read some payload from discord

kinda hard to find which one(s) tho

as a workaround you can remove all unnecessary perms from your bot or put it in a discord server that has much less activity

DrChic0 commented 3 months ago

Alright, I'll give it a try.

rfresh2 commented 3 months ago

im pretty sure its also related to u not using an up-to-date version of zenith. most likely you're still on zenith for 1.20.1 which has been long deprecated. the line numbers in your exception match that version.

you can update to zenith for 1.20.4 or 1.21 using the channel command. you can still connect with a 1.20.1 client and connect to 1.20.1 servers with the built-in viaversion.

modern versions have updated discord bot code and force bot restarts even if the logout fails there.