dmulloy2 / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
997 stars 261 forks source link

Error sending packet clientbound/minecraft:update_attributes (skippable? false) #2990

Open Naimadx123 opened 1 month ago

Naimadx123 commented 1 month ago

Describe the bug

[21:43:20 ERROR]: Error sending packet clientbound/minecraft:update_attributes (skippable? false)
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:update_attributes'
        at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:53) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:20) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:26) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:12) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:120) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.ChannelOutboundHandlerAdapter.write(ChannelOutboundHandlerAdapter.java:113) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at net.minecraft.network.Connection$2.write(Connection.java:759) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1015) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannel.write(AbstractChannel.java:301) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at ProtocolLib.jar/com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.write(NettyChannelProxy.java:210) ~[ProtocolLib.jar:?]
        at ProtocolLib.jar/com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.write(NettyChannelProxy.java:199) ~[ProtocolLib.jar:?]
        at net.minecraft.network.Connection.doSendPacket(Connection.java:505) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.Connection.lambda$sendPacket$13(Connection.java:490) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at ProtocolLib.jar/com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.lambda$proxyRunnable$2(NettyEventLoopProxy.java:48) ~[ProtocolLib.jar:?]
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.util.ConcurrentModificationException
        at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1095) ~[?:?]
        at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1049) ~[?:?]
        at net.minecraft.network.codec.ByteBufCodecs$19.encode(ByteBufCodecs.java:412) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.ByteBufCodecs$19.encode(ByteBufCodecs.java:395) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.StreamCodec$8.encode(StreamCodec.java:141) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.StreamCodec$5.encode(StreamCodec.java:88) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.StreamCodec$5.encode(StreamCodec.java:78) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        ... 39 more

To Reproduce Steps to reproduce the behavior:

  1. AFK for a while
  2. See error

Expected behavior Nothing happens

Screenshots If applicable, add screenshots to help explain your problem.

Version Info removed

dmulloy2 commented 1 month ago

i have a theory on this one. will give it a try and get back to you

dmulloy2 commented 1 month ago

try the latest dev build and let me know if this is still happening

AshleyFOXXX commented 1 month ago

Hi. I have the same issue. I thought it was Items adder causing it but it was protocollib. I'm running paper 1.20.6 and protocollib seems to only support 1.20.5? might that be the reason? latest.log

Naimadx123 commented 1 month ago

it looks like the error no longer occurs on dev build

thecats1105 commented 1 month ago

I don‘t think this bug has been resolved yet.

I tried to use it myself today, and for 3 hours, several users were disconnected about 20 times due to this error.

Paper 1.20.6 #137, ProtocolLib #712

dmulloy2 commented 1 month ago

I don‘t think this bug has been resolved yet.

I tried to use it myself today, and for 3 hours, several users were disconnected about 20 times due to this error.

Paper 1.20.6 #137, ProtocolLib #712

same error with the concurrent modification exception?

AshleyFOXXX commented 1 month ago

it looks like the error no longer occurs on dev build

What version of protocollib did you install? I have the 5.30.0 which I believe only supports 1.20.5 and im assuming you are using 1.20.6. Mind sharing the version of protocollibs that made it work for you?

Naimadx123 commented 1 month ago

it looks like the error no longer occurs on dev build

What version of protocollib did you install? I have the 5.30.0 which I believe only supports 1.20.5 and im assuming you are using 1.20.6. Mind sharing the version of protocollibs that made it work for you?

#713

AshleyFOXXX commented 1 month ago

Same issue with the latest build #713 but issue is not as often as the older dev builds which logs people out numerous times. This newer dev build still has some issues where it logs user out but not as often.

but still, issue is still an issue so I hope it'll get fixed soon.

Naimadx123 commented 1 month ago

Same issue with the latest build #713 but issue is not as often as the older dev builds which logs people out numerous times. This newer dev build still has some issues where it logs user out but not as often.

but still, issue is still an issue so I hope it'll get fixed soon.

Are you sure that the problem is the same? Can you paste the error?

AshleyFOXXX commented 1 month ago

Same issue with the latest build #713 but issue is not as often as the older dev builds which logs people out numerous times. This newer dev build still has some issues where it logs user out but not as often. but still, issue is still an issue so I hope it'll get fixed soon.

Are you sure that the problem is the same? Can you paste the error?

Yes it is the same error as before still giving and the other player the same error. Unfortunately I dont know which logs where the error was due to lots of logs already generated but I can confirm it is the same error. Isn't it not causing issues for you now?

AshleyFOXXX commented 1 month ago

I can reinstall it again and let you join my server if you want. If you have time

thecats1105 commented 1 month ago

image image I don't know why, but in build #713, no error log is left and the connection is disconnected. PaperMC 1.20.6 #138, ProtocolLib #713

thecats1105 commented 1 month ago

Dump Log Error Log PaperMC 1.20.6 #138, ProtocolLib #713 We will also test it in build #715 and let you know soon.

Naimadx123 commented 1 month ago

@dmulloy2

thecats1105 commented 1 month ago

Dump Log Error Log PaperMC 1.20.6 #138, ProtocolLib #715

WhiteProject1 commented 1 month ago

same problem

Naimadx123 commented 1 month ago
[20:09:33 ERROR]: Error sending packet clientbound/minecraft:update_attributes (skippable? false)
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:update_attributes'
        at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:53) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:20) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:26) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:12) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:120) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.ChannelOutboundHandlerAdapter.write(ChannelOutboundHandlerAdapter.java:113) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at net.minecraft.network.Connection$2.write(Connection.java:759) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1015) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannel.write(AbstractChannel.java:301) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at ProtocolLib (1).jar/com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.write(NettyChannelProxy.java:210) ~[ProtocolLib (1).jar:?]
        at ProtocolLib (1).jar/com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.write(NettyChannelProxy.java:199) ~[ProtocolLib (1).jar:?]
        at net.minecraft.network.Connection.doSendPacket(Connection.java:505) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.Connection.lambda$sendPacket$13(Connection.java:490) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at ProtocolLib (1).jar/com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.lambda$proxyRunnable$2(NettyEventLoopProxy.java:48) ~[ProtocolLib (1).jar:?]
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.util.ConcurrentModificationException
        at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1095) ~[?:?]
        at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1049) ~[?:?]
        at net.minecraft.network.codec.ByteBufCodecs$19.encode(ByteBufCodecs.java:412) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.ByteBufCodecs$19.encode(ByteBufCodecs.java:395) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.StreamCodec$8.encode(StreamCodec.java:141) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.StreamCodec$5.encode(StreamCodec.java:88) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        at net.minecraft.network.codec.StreamCodec$5.encode(StreamCodec.java:78) ~[purpur-1.20.6.jar:1.20.6-2227-79d199c]
        ... 39 more
RustyDagger commented 1 month ago

ProtoLib Build 716 server java: 21 client java: 22 Paper Build: Paper version 1.20.6-137-master plugins: image

disconnected error ( concurrent modification still ) https://pastebin.com/2T6nFtiN

cause: Unknown I was tabbed out standing still and there was no other players on the server at the time. Seems to still disconnect when players sprint and jump around near each other.

prior to build 716 clients was being disconnected when ever another player was near them and sprinting the player that was sprinting would stay connected and any other clients near them would be kicked with this packet error.

thecats1105 commented 1 month ago

same in build #719 Dump Log Error Log PaperMC 1.20.6 #139, ProtocolLib #719

dmulloy2 commented 1 month ago

@thecats1105 does this happen without ItemsAdder? the only thing i can think of is that they're concurrently modifying the attribute lists. maybe not cloning the packet before working with it? it's hard to say without looking at the code but it appears to be obfuscated

AshleyFOXXX commented 1 month ago

Without items adder, everything works well. But with the itemsadder, the error exists. It may or may not be itemsadder we can't be sure. I have a server warning that this Protocollib is not yet tested with 1.20.6

thecats1105 commented 1 month ago

It seems like it might be related to the ItemsAdder plugin. Besides this error, I’ve seen a lot of error logs from ItemsAdder and ProtocolLib, even though the player’s connection isn’t getting interrupted. PaperMC 1.20.6 #140, ProtocolLib #720, ItemsAdder v4.0.1-alpha-test-4

RustyDagger commented 1 month ago

@thecats1105 does this happen without ItemsAdder? the only thing i can think of is that they're concurrently modifying the attribute lists. maybe not cloning the packet before working with it? it's hard to say without looking at the code but it appears to be obfuscated

honestly seems like you need to have a convo with lonedev. it might be itemsadder just miss using or not using protocol lib correctly. any one using itemsadder is suffering hard RN it is a test/ dev build of items adder so its no real surprise its broke as f.

Leahcimkrob commented 4 weeks ago

We installed Itemsader today and since then we have been getting the above message in the log and the players are being kicked from the server. PaperMC 1.20.6 #145, ProtocolLib #720, ItemsAdder v4.0.1-alpha-test-4

Log: https://mclo.gs/OUsCi1a

DeEthria commented 4 weeks ago

721 Build same Problem

LoneDev6 commented 4 weeks ago

Will be fixed in the next update. Probably it's because I'm adding attributes to the list without cloning it, as dmulloy said.

DeEthria commented 3 weeks ago

Will be fixed in the next update. Probably it's because I'm adding attributes to the list without cloning it, as dmulloy said.

Can you also tell us when you'll fix this? My players keep getting kicked from the server.

DeEthria commented 3 weeks ago

@LoneDev6

AshleyFOXXX commented 3 weeks ago

Is ItemsAdder refundable? Im planning to switch to Oraxen. I paid for it for my 1.20.6 server on paper but I never had a chance to get it to work properly and my admins on my server really cant wait to add cosmetics on my server. I hope this can be answered. I got my Itemsadder just this month but never got to use it.

kuroka3 commented 2 weeks ago

same issue in 1.21 #723 build

AshleyFOXXX commented 2 weeks ago

Is it working on 1.20.6 now?