Dream Minecraft Manhunt (with optional Discord music integration)

Discord integration: "Unable to find acceptable protocols"

JustGamma opened this issue · 6 comments

commented

Describe the bug

A clear and concise description of what the bug is.

While having enableDiscord: false the plugin's core features work perfectly fine.
setting it to true prevents the plugin from working completly and just outputs Internal Errors upon command executions.

Potential Causes

Enabling discord module

Environment Info

Plugin version: 1.2.3

Bukkit/Spigot server version: 1.16.3

Configuration file

Sending us your plugin config.yml file may help in diagnosing the issue. Paste the contents of the plugin's config file here: (feel free to omit your Discord token for security reasons)

headStartDuration: 1
compassEnabledInNether: true

enableDiscord: true  [or enableDiscord: false]
discordToken: "[REDACTED]"
ip: "skyjak.xyz"

discordServerId: "593165457582850057"
musicChannelId: "766707251120439346"
hunterRoleId: "764535846115737630"
runnerRoleId: "764535846115737630"
spectatorRoleId: "764535846115737630"

Server Logs

Please check your Server Console for any warnings or errors created by the plugin. If any are any, please copy and paste them here:

org.bukkit.command.CommandException: Cannot execute command 'music' in plugin MinecraftManhunt v1.2.3 - plugin is disabled.
^ if discord module is enabled

If not doing /music outputs this.

[14:09:27 ERROR]: Could not pass event TabCompleteEvent to MinecraftManhunt v1.2.3
java.lang.NullPointerException: null
        at com.yoonicode.minecraftmanhunt.PluginCommands.getCompletions(PluginCommands.java:101) ~[?:?]
        at com.yoonicode.minecraftmanhunt.PluginListener.onAutocomplete(PluginListener.java:62) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor5.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.3.jar:git-Paper-247]
        at org.bukkit.plugin.EventExecutor$$Lambda$3681/000000003C65EEC0.execute(Unknown Source) ~[?:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.3.jar:git-Paper-247]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.3.jar:git-Paper-247]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.3.jar:git-Paper-247]
        at org.bukkit.craftbukkit.v1_16_R2.CraftServer.tabComplete(CraftServer.java:1861) ~[patched_1.16.3.jar:git-Paper-247]
        at org.bukkit.craftbukkit.v1_16_R2.command.BukkitCommandWrapper.getSuggestions(BukkitCommandWrapper.java:58) ~[patched_1.16.3.jar:git-Paper-247]
        at com.mojang.brigadier.tree.ArgumentCommandNode.listSuggestions(ArgumentCommandNode.java:71) ~[patched_1.16.3.jar:git-Paper-247]
        at com.mojang.brigadier.CommandDispatcher.getCompletionSuggestions(CommandDispatcher.java:596) ~[patched_1.16.3.jar:git-Paper-247]
        at com.mojang.brigadier.CommandDispatcher.getCompletionSuggestions(CommandDispatcher.java:579) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.PlayerConnection.lambda$a$4(PlayerConnection.java:589) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.PlayerConnection$$Lambda$4437/00000000F818EF70.run(Unknown Source) ~[?:?]
        at net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:1135) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:1128) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.sleepForTick(MinecraftServer.java:1089) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:1003) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer$$Lambda$3064/00000000CA327FD0.run(Unknown Source) ~[?:?]

--------


[14:09:27 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'music' in plugin MinecraftManhunt v1.2.3
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.16.3.jar:git-Paper-247]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.3.jar:git-Paper-247]
        at org.bukkit.craftbukkit.v1_16_R2.CraftServer.dispatchCommand(CraftServer.java:802) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.PlayerConnection.handleCommand(PlayerConnection.java:1918) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:1729) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.PlayerConnectionUtils$$Lambda$4072/00000000F813CDC0.run(Unknown Source) ~[?:?]
        at net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:1135) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:1128) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.sleepForTick(MinecraftServer.java:1089) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:1003) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-247]
        at net.minecraft.server.v1_16_R2.MinecraftServer$$Lambda$3064/00000000CA327FD0.run(Unknown Source) ~[?:?]
        at java.lang.Thread.run(Thread.java:820) [?:2.9 (01-08-2020)]
Caused by: java.lang.NullPointerException
        at com.yoonicode.minecraftmanhunt.PluginCommands.onCommand(PluginCommands.java:317) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.3.jar:git-Paper-247]

Anything else?

commented

@ItzzGamma Thank you for reporting a bug. I'll look into it and get back to you.

Looking at your config, each of your role IDs are the same:

hunterRoleId:    "764535846115737630"
runnerRoleId:    "764535846115737630"
spectatorRoleId: "764535846115737630"

I'm not sure if this is the problem, but the role system may not work if there aren't three distinct roles created.


Technical notes to self:

  • NullPointer in autocomplete or /music command execution. Either DiscordManager or TrackManager is null— real error in constructor of either of those?
commented

Thanks for replying.

I have tried changing out role id's to be seperate roles but that still doesnt fix the issue. Here is the full error log with the same settings except hunter, runner and spectator roleId's being different roles. Do note that the bot doesnt even go online and the console gives output as follows:

[16:52:10] [Server thread/INFO]: [MinecraftManhunt] Enabling MinecraftManhunt v1.2.3
[16:52:10] [Server thread/INFO]: [MinecraftManhunt] Minecraft Manhunt plugin enabled!
[16:52:11] [JDA RateLimit-Worker 1/ERROR]: [net.dv8tion.jda.internal.requests.Requester] There was an I/O error while executing a REST request: Unable to find acceptable protocols. isFallback=false, modes=[ConnectionSpec(cipherSuites=[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_256_CCM_8_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA], tlsVersions=[TLS_1_3, TLS_1_2], supportsTlsExtensions=true), ConnectionSpec()], supported protocols=[TLSv1]
[16:52:11] [Server thread/ERROR]: Error occurred while enabling MinecraftManhunt v1.2.3 (Is it up to date?)
net.dv8tion.jda.api.exceptions.ErrorResponseException: -1: java.net.UnknownServiceException
	at net.dv8tion.jda.api.exceptions.ErrorResponseException.create(ErrorResponseException.java:158) ~[?:?]
	at net.dv8tion.jda.api.requests.Request.onFailure(Request.java:117) ~[?:?]
	at net.dv8tion.jda.internal.requests.RestActionImpl.handleResponse(RestActionImpl.java:268) ~[?:?]
	at net.dv8tion.jda.api.requests.Request.handleResponse(Request.java:259) ~[?:?]
	at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:253) ~[?:?]
	at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:140) ~[?:?]
	at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:123) ~[?:?]
	at net.dv8tion.jda.internal.requests.ratelimit.BotRateLimiter$Bucket.run(BotRateLimiter.java:468) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522) ~[?:1.8.0]
	at java.util.concurrent.FutureTask.run(FutureTask.java:277) ~[?:1.8.0]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:191) ~[?:1.8.0]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:1.8.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160) [?:1.8.0]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:1.8.0]
	at java.lang.Thread.run(Thread.java:820) [?:2.9 (01-08-2020)]
Caused by: java.net.UnknownServiceException: Unable to find acceptable protocols. isFallback=false, modes=[ConnectionSpec(cipherSuites=[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_AES_128_CCM_SHA256, TLS_AES_256_CCM_8_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA], tlsVersions=[TLS_1_3, TLS_1_2], supportsTlsExtensions=true), ConnectionSpec()], supported protocols=[TLSv1]
	at okhttp3.internal.connection.ConnectionSpecSelector.configureSecureSocket(ConnectionSpecSelector.java:73) ~[?:?]
	at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:313) ~[?:?]
	at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:284) ~[?:?]
	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:169) ~[?:?]
	at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257) ~[?:?]
	at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135) ~[?:?]
	at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114) ~[?:?]
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) ~[?:?]
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[?:?]
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) ~[?:?]
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94) ~[?:?]
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[?:?]
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) ~[?:?]
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[?:?]
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[?:?]
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125) ~[?:?]
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) ~[?:?]
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) ~[?:?]
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:264) ~[?:?]
	at okhttp3.RealCall.execute(RealCall.java:93) ~[?:?]
	at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:200) ~[?:?]
	... 10 more
Caused by: net.dv8tion.jda.api.exceptions.ContextException
	at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54) ~[?:?]
	at net.dv8tion.jda.api.requests.Request.<init>(Request.java:71) ~[?:?]
	at net.dv8tion.jda.api.requests.RestFuture.<init>(RestFuture.java:36) ~[?:?]
	at net.dv8tion.jda.internal.requests.RestActionImpl.submit(RestActionImpl.java:209) ~[?:?]
	at net.dv8tion.jda.internal.requests.RestActionImpl.complete(RestActionImpl.java:219) ~[?:?]
	at net.dv8tion.jda.api.requests.RestAction.complete(RestAction.java:623) ~[?:?]
	at net.dv8tion.jda.api.utils.SessionControllerAdapter.getGateway(SessionControllerAdapter.java:86) ~[?:?]
	at net.dv8tion.jda.internal.JDAImpl.getGateway(JDAImpl.java:299) ~[?:?]
	at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:257) ~[?:?]
	at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:249) ~[?:?]
	at net.dv8tion.jda.api.JDABuilder.build(JDABuilder.java:1869) ~[?:?]
	at com.yoonicode.minecraftmanhunt.DiscordManager.<init>(DiscordManager.java:44) ~[?:?]
	at com.yoonicode.minecraftmanhunt.PluginMain.onEnable(PluginMain.java:65) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.3.jar:git-Paper-247]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.3.jar:git-Paper-247]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.3.jar:git-Paper-247]
	at org.bukkit.craftbukkit.v1_16_R2.CraftServer.enablePlugin(CraftServer.java:501) ~[patched_1.16.3.jar:git-Paper-247]
	at org.bukkit.craftbukkit.v1_16_R2.CraftServer.enablePlugins(CraftServer.java:415) ~[patched_1.16.3.jar:git-Paper-247]
	at net.minecraft.server.v1_16_R2.MinecraftServer.loadWorld(MinecraftServer.java:468) ~[patched_1.16.3.jar:git-Paper-247]
	at net.minecraft.server.v1_16_R2.DedicatedServer.init(DedicatedServer.java:237) ~[patched_1.16.3.jar:git-Paper-247]
	at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:939) ~[patched_1.16.3.jar:git-Paper-247]
	at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-247]
	at net.minecraft.server.v1_16_R2.MinecraftServer$$Lambda$3063/00000000863042F0.run(Unknown Source) ~[?:?]
	... 1 more
[16:52:11] [Server thread/INFO]: [MinecraftManhunt] Disabling MinecraftManhunt v1.2.3
[16:52:11] [Server thread/INFO]: [MinecraftManhunt] Minecraft Manhunt plugin disabled!
[16:52:11] [Server thread/INFO]: Running delayed init tasks
[16:52:11] [Server thread/INFO]: Done (5.954s)! For help, type "help"
commented

Looking at these logs, it seems like the Discord bot isn't even going online due to some network error. I have a hunch that this might be caused by some firewall— are you hosting this on your own servers, or are you using a Minecraft hosting service (like ApexMC or the likes?)

commented

Its an Ubuntu 18 VPS, attempted disabling firewall/iptables and its still the same. Im already hosting several bots using this already and i dont see why discord shouldnt work. Did you take in account the domain migration discord recently had?

Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0 x86_64)

IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20200108_436782 (JIT enabled, AOT enabled)

Startup parameters:

java -Xms10300M -Xmx10300M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:-OmitStackTraceInFastThrow -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=8 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:MaxTenuringThreshold=1 -Xloggc:gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=1M -Dusing.aikars.flags=true -Daikars.new.flags=true -jar server.jar

commented

Though I cannot reproduce the error, I think I have an idea of what's going on now.

The plugin uses the JDA library, which uses the okHTTP library. I think okHTTP is breaking since your JVM does not support TLS 1.2.

Please try following this guide to enable TLS 1.2 and see if that works!

commented

Instead of changing it system-wise i just added the -Dcom.ibm.jsse2.overrideDefaultTLS=true flag to my startup script and it seemed to have fixed it. Thanks a lot for your help it works now ;)!