jonesdevelopment / sonar

Sonar is a lightweight, effective and easy-to-use anti-bot plugin for Velocity, BungeeCord, and Bukkit.
https://docs.jonesdev.xyz
GNU General Public License v3.0
142 stars 12 forks source link

Bug Report: Error on console with commands #359

Closed MatinHQ closed 3 months ago

MatinHQ commented 3 months ago

General information

On high player count error below spam on console sometimes

[14:37:47 ERROR]: Node cannot provide suggestions java.lang.NullPointerException: suggestion at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:924) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.command.registrar.InvocableCommandRegistrar.lambda$createLiteral$4(InvocableCommandRegistrar.java:108) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684) ~[?:?] at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[?:?] at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168) ~[?:?] at com.velocitypowered.proxy.command.registrar.InvocableCommandRegistrar.lambda$createLiteral$5(InvocableCommandRegistrar.java:106) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.command.brigadier.VelocityArgumentCommandNode.listSuggestions(VelocityArgumentCommandNode.java:88) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.command.SuggestionsProvider.getArgumentsNodeSuggestions(SuggestionsProvider.java:261) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.command.SuggestionsProvider.provideArgumentsSuggestions(SuggestionsProvider.java:230) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.command.SuggestionsProvider.provideSuggestions(SuggestionsProvider.java:111) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.command.SuggestionsProvider.provideSuggestions(SuggestionsProvider.java:84) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.command.VelocityCommandManager.offerBrigadierSuggestions(VelocityCommandManager.java:310) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler.handleCommandTabComplete(ClientPlaySessionHandler.java:678) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler.handle(ClientPlaySessionHandler.java:291) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.protocol.packet.TabCompleteRequestPacket.handle(TabCompleteRequestPacket.java:140) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.connection.MinecraftConnection.channelRead(MinecraftConnection.java:159) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at de.rayzs.pat.api.netty.proxy.VelocityPacketAnalyzer$PacketDecoder.channelRead(VelocityPacketAnalyzer.java:115) ~[?:?] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at xyz.jonesdev.sonar.velocity.fallback.FallbackVelocityChannelHandler.channelRead(FallbackVelocityChannelHandler.java:57) ~[?:?] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:91) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.channelRead(MinecraftDecoder.java:60) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:289) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at xyz.jonesdev.sonar.common.fallback.FallbackBandwidthHandler.channelRead(FallbackBandwidthHandler.java:46) ~[?:?] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1407) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:799) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-proxy-3.3.0-SNAPSHOT-all.jar:3.3.0-SNAPSHOT (git-0eb4e9e6)] at java.base/java.lang.Thread.run(Thread.java:840) [?:?]

Steps to reproduce

Have no step to reproduce

Sonar dump

[sonar]: Generated dump: {"memory":{"total":"6.8 GiB","max":"6.8 GiB","free":"4.4 GiB","used":"2.4 GiB"},"runtime":{"virtualCores":40,"jvmArguments":["-Xms6963M","-Xmx6963M","-XX:+UseG1GC","-XX:G1HeapRegionSize\u003d4M","-XX:+UnlockExperimentalVMOptions","-XX:+ParallelRefProcEnabled","-XX:+AlwaysPreTouch","-XX:MaxInlineLevel\u003d15","-Dterminal.jline\u003dfalse","-Dterminal.ansi\u003dtrue","-Dvelocity.packet-decode-logging\u003dtrue"],"vmName":"OpenJDK 64-Bit Server VM","vmVendor":"Amazon.com Inc.","vmVersion":"17.0.12+7-LTS"},"os":{"name":"Linux","arch":"amd64","version":"5.4.0-190-generic"},"sonar":{"version":"2.0.38 (77716c0f)","platform":"VELOCITY","gitBranch":"main","gitCommit":"77716c0f"}}

Additional information

No response

jonesdevelopment commented 3 months ago

Hey, I do not believe this is an error in Sonar.

jonesdevelopment commented 3 months ago

It only shows Sonar in the log because - in the end - it's a packet decoding error. Some plugin has a command listener that is not set up correctly @MatinHQ. I will close this issue. If you find a strong indicator that this is directly caused by Sonar, we can reopen this issue anytime.