DiscordSRV

DiscordSRV

86.8k Downloads

Reconnect after discord connection is interrupted

carlpoole opened this issue · 1 comments

commented

My internet connection was flaky recently. On two occasions it went down and players all lost connection, so the plugin could not connect to discord to maintain the link to the discord bot either. Once the internet came back up, DiscordSRV was not functioning. Even after I did the command discord reload (I'm not sure if that's supposed to try reconnecting, though).

This might be intended behavior, but it would be nice if the discord session re-established once it could reach the internet again, or at least have a command to manually re-establish the connection? At the moment the only way I found to fix this was to restart my entire server.

EDIT: It seems like after a while it did try to reconnect, but for some reason only Discord -> Minecraft was working. It didnt work the opposite way, nor could I run a command to check the logged in players.

[15:59:36 WARN]: [DiscordSRV] [JDA] Got disconnected from WebSocket. Attempting to resume session
>.... [15:59:39 INFO]: [DiscordSRV] [JDA] Successfully resumed Session!

Console log:

>.... [15:20:52 ERROR]: [DiscordSRV] DNS server 8.8.8.8 failed to resolve discordapp.com: Receive timed out, Network is unreachable (connect failed)
>.... [15:20:52 WARN]: Exception in thread "OkHttp Dispatcher" java.util.ConcurrentModificationException
>.... [15:20:52 WARN]: at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:966)
>.... [15:20:52 WARN]: at java.util.LinkedList$ListItr.next(LinkedList.java:888)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.DiscordSRV$2.lookupPublic(DiscordSRV.java:409)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.DiscordSRV$2.lookup(DiscordSRV.java:406)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:185)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:149)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:84)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:214)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
>.... [15:20:52 ERROR]: [DiscordSRV] DNS server 8.8.8.8 failed to resolve discordapp.com: Receive timed out, Network is unreachable (connect failed)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:264)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.RealCall$AsyncCall.execute(RealCall.java:210)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
>.... [15:20:52 WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>.... [15:20:52 WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>.... [15:20:52 WARN]: at java.lang.Thread.run(Thread.java:748)
>.... [15:20:52 WARN]: Exception in thread "OkHttp Dispatcher" java.util.ConcurrentModificationException
>.... [15:20:52 WARN]: at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:966)
>.... [15:20:52 WARN]: at java.util.LinkedList$ListItr.next(LinkedList.java:888)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.DiscordSRV$2.lookupPublic(DiscordSRV.java:409)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.DiscordSRV$2.lookup(DiscordSRV.java:406)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:185)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:149)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:84)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:214)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:264)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.RealCall$AsyncCall.execute(RealCall.java:210)
>.... [15:20:52 WARN]: at github.scarsz.discordsrv.dependencies.okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
>.... [15:20:52 WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>.... [15:20:52 WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>.... [15:20:52 WARN]: at java.lang.Thread.run(Thread.java:748)
>.... [15:23:34 WARN]: [DiscordSRV] [JDA] Got disconnected from WebSocket. Attempting to resume session
>.... [15:23:36 WARN]: [DiscordSRV] [JDA] Got disconnected from WebSocket. Appending to reconnect queue
commented

Fixed in the above commit, you can download the latest dev build from https://snapshot.discordsrv.com/