PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
10.02k stars 2.32k forks source link

NullPointException of fastutil, make it always kick player #7130

Closed lammaHK closed 2 years ago

lammaHK commented 2 years ago

Stack trace

[17:33:55 ERROR]: Packet encoding of packet ID 20 threw (skippable? false)
java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectArrayList.get(int)" because "this.wrapped" is null
        at it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap$MapIterator.nextEntry(Object2ObjectOpenHashMap.java:506) ~[patched_1.17.1.jar:git-Paper-400]
        at it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap$FastEntryIterator.next(Object2ObjectOpenHashMap.java:593) ~[patched_1.17.1.jar:git-Paper-400]
        at it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap$FastEntryIterator.next(Object2ObjectOpenHashMap.java:589) ~[patched_1.17.1.jar:git-Paper-400]
        at net.minecraft.nbt.CompoundTag.copy(CompoundTag.java:396) ~[app:?]
        at net.minecraft.world.item.ItemStack.cloneItemStack(ItemStack.java:662) ~[patched_1.17.1.jar:git-Paper-400]
        at net.minecraft.world.item.ItemStack.copy(ItemStack.java:653) ~[patched_1.17.1.jar:git-Paper-400]
        at net.minecraft.network.FriendlyByteBuf.writeItem(FriendlyByteBuf.java:499) ~[app:?]
        at net.minecraft.network.FriendlyByteBuf.writeCollection(FriendlyByteBuf.java:145) ~[app:?]
        at net.minecraft.network.protocol.game.ClientboundContainerSetContentPacket.write(ClientboundContainerSetContentPacket.java:48) ~[app:?]
        at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:44) ~[patched_1.17.1.jar:git-Paper-400]
        at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:15) ~[patched_1.17.1.jar:git-Paper-400]
        at jdk.internal.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at com.viaversion.viaversion.util.PipelineUtil.callEncode(PipelineUtil.java:93) ~[ViaVersion-4.1.1.jar:?]
        at com.viaversion.viaversion.bukkit.handlers.BukkitEncodeHandler.encode(BukkitEncodeHandler.java:71) ~[ViaVersion-4.1.1.jar:?]
        at jdk.internal.reflect.GeneratedMethodAccessor94.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector.encode(ChannelInjector.java:528) ~[ProtocolLib (4).jar:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector.access$100(ChannelInjector.java:70) ~[ProtocolLib (4).jar:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector$1.encode(ChannelInjector.java:268) ~[ProtocolLib (4).jar:?]
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[patched_1.17.1.jar:git-Paper-400]
        at com.comphenix.protocol.injector.netty.ChannelInjector$1.write(ChannelInjector.java:274) ~[ProtocolLib (4).jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) ~[patched_1.17.1.jar:git-Paper-400]
        at su.nexmedia.engine.nms.packets.PacketManager$1.write(PacketManager.java:112) ~[NexEngine.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) ~[patched_1.17.1.jar:git-Paper-400]
        at me.neznamy.tab.platforms.bukkit.BukkitPipelineInjector$BukkitChannelDuplexHandler.write(BukkitPipelineInjector.java:79) ~[TAB_v3.0.1.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) ~[patched_1.17.1.jar:git-Paper-400]
        at de.codingair.tradesystem.lib.codingapi.player.data.PacketReader$1.write(PacketReader.java:87) ~[TradeSystem_v2.0.7.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) ~[patched_1.17.1.jar:git-Paper-400]
        at de.codingair.tradesystem.lib.codingapi.player.data.PacketReader$1.write(PacketReader.java:87) ~[TradeSystem_v2.0.7.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:790) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:758) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:808) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:306) ~[patched_1.17.1.jar:git-Paper-400]
        at com.comphenix.protocol.injector.netty.ChannelProxy.writeAndFlush(ChannelProxy.java:327) ~[ProtocolLib (4).jar:?]
        at net.minecraft.network.Connection.doSendPacket(Connection.java:450) ~[app:?]
        at net.minecraft.network.Connection.lambda$writePacket$8(Connection.java:424) ~[app:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector$3.lambda$onMessageScheduled$1(ChannelInjector.java:351) ~[ProtocolLib (4).jar:?]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[patched_1.17.1.jar:git-Paper-400]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[patched_1.17.1.jar:git-Paper-400]        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Plugin and Datapack List

Plugins (83): ActionWords, AdvancedAchievements, AdvancedNMotd, BankCore, BetterRTP, BlockLocker, BoardGames, Cameras, Citizens, CMI, CMILib, Companions, CoreProtect, Crawling, Dantiao, DeluxeMenus, DiceFurniture, DiscordCheck, Dungeons, eco, EcoEnchants, EcoEnchantsGUI, EntityDetection, Evolutions, FairHunger, FartherViewDistance, FurnitureLib, GoldenChallenges, GraveEntitySpawn, GSit, Guilds, HeadDatabase, HiveChecker, HotSpring, IllegalStack, Iris, JoinLeave, LightAPI, LimitPillagers, LoneLibs, Lottery, LuckPerms, LuckyTreasure, MarriageMaster, MoneyCore, MoneyFromMobs, Multiverse-Core, NexEngine, NoChunkLag, NoOneFishing, NoteBlockStudioPlayer, PickaxeInfo, PickMeUp, PickUpCancel, PixelBlood, PlaceholderAPI, PlayerShopGUIPlus, PocketGames, PocketMobs, ProCosmetics, ProtectionLib, ProtocolLib, QuickShop, RealisticSeasons, Residence, Seasons, ServerBooster, Shopkeepers, SVThunderbolt, TAB, TradeSystem, TreeFeller, Vault, Vehicles, VentureChat, ViaBackwards, ViaVersion, VIPSystem, WhatIsThis, WorldBorder, WorldEdit, WorldEditCrashFix, XConomy

Actions to reproduce (if known)

No response

Paper version

Paper(400) 1.17.1-R0.1-SNAPSHOT

Other

No response

kennytv commented 2 years ago

You have a bad plugin asynchronously modifying itemstack data while another is trying to use it.

luizsusin commented 2 years ago

@kennytv Is there, by any means, a way to find out which one is doing it? It's quite hard to debug it having 60+ plugins. I'm facing this issue too and I know it's not any of my 14 plugins, but I don't know about the other 49.

electronicboy commented 2 years ago

Theres many ways, easiest way is often just a binary search, i.e. pull out half of the plugins if it continues, pull out another, if it stops, use the half you just pulled, etc

kennytv commented 2 years ago

All three reports I've seen had that tradesystem plugin, otherwise it might be worth looking for overlaps in plugins with this report. but as cat said, binary search is usually best and easiest

luizsusin commented 2 years ago

I'll try binary searching it. Thank you both!

Ignoring10 commented 2 years ago

How about you binary search some bitc*es

luizsusin commented 2 years ago

For anyone who's searching this in the near future, the issue is with Auxilor's Eco. Disabling it made it work flawlessly and players aren't being kicked anymore. You may also go on Eco's config and change: async-display.emergency.enabled to false async-display.emergency.ratelimit to false

This will fix the issue.

NyhmsQuest commented 2 years ago

For anyone who's searching this in the near future, the issue is with Auxilor's Eco. Disabling it made it work flawlessly and players aren't being kicked anymore. You may also go on Eco's config and change: async-display.emergency.enabled to false async-display.emergency.ratelimit to false

This will fix the issue.

Just to confirm, this also fixed it for me.

0pGam3rMC commented 2 years ago

Hey! Wdym by Auxililor eco? What's that?

luizsusin commented 2 years ago

It's a development library that Auxilor (a plugin developer) created and uses in his plugins. I saw on the plugin list that the OP had Eco and EcoEnchants. I was facing the same issue and had Eco and EcoEnchants too. Turns out it was Eco.

0pGam3rMC commented 2 years ago

Ah I see. Okay so I have none of those plugins, and I even removed 90% of my plugins. Currently sitting on

•Token Enchant •VKautopickup •Autosell •EssentialsX •Vault •UltraPermissions

Any idea how I could fix my problem?

WillFP commented 2 years ago

eco developer here, just coming in to say that's the right way to fix it: disable everything under async-display and it should fix the issues

WillFP commented 2 years ago

Also worth mentioning that this shouldn't be happening in the first place - if anyone has these issues with eco and stumbles across this issue, if these problems are still happening with default eco config on latest versions, then please let me know - it's a top priority bug