ViaVersion / ViaRewind

ViaBackwards addon to allow 1.8.x and 1.7.x clients on newer server versions.
https://hangar.papermc.io/ViaVersion/ViaRewind
GNU General Public License v3.0
245 stars 79 forks source link

Entity type is lost in the tracker #526

Closed Pablete1234 closed 1 month ago

Pablete1234 commented 2 months ago

/viaversion dump Output

https://dump.viaversion.com/cf4487d47d27d9e029cb71ee8daa2431315a2fce876ea3ad855cda7a26f8f251

Console Error

[03:44:41 ERROR]: [ViaVersion] (1.9->1.8) An error occurred in entity data handler EntityPacketRewriter1_9 for untracked entity type: Metadata{id=17, metaType=COMPOUND_TAG, value={}}
[03:44:41 ERROR]: [ViaVersion] (1.9->1.8) Full entity data: Metadata{id=17, metaType=COMPOUND_TAG, value={}}
[03:44:41 ERROR]: [ViaVersion] (1.9->1.8) Error: 
java.lang.NullPointerException: Cannot invoke "com.viaversion.viaversion.api.minecraft.entities.EntityType.getParent()" because "currentType" is null
    at ViaRewind-4.0.1-SNAPSHOT.jar/com.viaversion.viarewind.protocol.v1_9to1_8.data.EntityDataIndex1_8.searchIndex(EntityDataIndex1_8.java:50) ~[ViaRewind-4.0.1-SNAPSHOT.jar:?]
    at ViaRewind-4.0.1-SNAPSHOT.jar/com.viaversion.viarewind.protocol.v1_9to1_8.rewriter.EntityPacketRewriter1_9.handleEntityData(EntityPacketRewriter1_9.java:534) ~[ViaRewind-4.0.1-SNAPSHOT.jar:?]
    at ViaVersion-5.0.1.jar/com.viaversion.viaversion.rewriter.EntityRewriter.handleEntityData(EntityRewriter.java:126) ~[ViaVersion-5.0.1.jar:?]
    at ViaBackwards-5.0.1.jar/com.viaversion.viabackwards.api.rewriters.EntityRewriterBase.handleEntityData(EntityRewriterBase.java:72) ~[ViaBackwards-5.0.1.jar:?]
    at ViaBackwards-5.0.1.jar/com.viaversion.viabackwards.api.rewriters.LegacyEntityRewriter$3.lambda$register$0(LegacyEntityRewriter.java:105) ~[ViaBackwards-5.0.1.jar:?]
    at ViaVersion-5.0.1.jar/com.viaversion.viaversion.api.protocol.remapper.PacketHandlers.handle(PacketHandlers.java:179) ~[ViaVersion-5.0.1.jar:?]
    at ViaVersion-5.0.1.jar/com.viaversion.viaversion.api.protocol.AbstractProtocol.transform(AbstractProtocol.java:405) ~[ViaVersion-5.0.1.jar:?]
    at ViaVersion-5.0.1.jar/com.viaversion.viaversion.protocol.packet.PacketWrapperImpl.apply(PacketWrapperImpl.java:369) ~[ViaVersion-5.0.1.jar:?]
    at ViaVersion-5.0.1.jar/com.viaversion.viaversion.protocol.ProtocolPipelineImpl.transform(ProtocolPipelineImpl.java:122) ~[ViaVersion-5.0.1.jar:?]
    at ViaVersion-5.0.1.jar/com.viaversion.viaversion.connection.UserConnectionImpl.transform(UserConnectionImpl.java:337) ~[ViaVersion-5.0.1.jar:?]
    at ViaVersion-5.0.1.jar/com.viaversion.viaversion.connection.UserConnectionImpl.transformClientbound(UserConnectionImpl.java:313) ~[ViaVersion-5.0.1.jar:?]
    at ViaVersion-5.0.1.jar/com.viaversion.viaversion.bukkit.handlers.BukkitEncodeHandler.encode(BukkitEncodeHandler.java:58) ~[ViaVersion-5.0.1.jar:?]
    at ViaVersion-5.0.1.jar/com.viaversion.viaversion.bukkit.handlers.BukkitEncodeHandler.encode(BukkitEncodeHandler.java:35) ~[ViaVersion-5.0.1.jar:?]
[...]
    at net.minecraft.network.Connection.doSendPacket(Connection.java:513) ~[paper-1.21.jar:1.21-15-2df432f]
    at net.minecraft.network.Connection.lambda$sendPacket$13(Connection.java:498) ~[paper-1.21.jar:1.21-15-2df432f]
    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$$$capture(AbstractEventExecutor.java:174) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:167) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java) ~[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) ~[?:?]

Bug Description

I am unsure as to what either causes the entity not to make it into the tracker, or removes it too early from the tracker. But once that happens any future metadata updates for this entity are spamming these errors in console.

All i can say is it happens reliably, and it could have to do with custom tablist implementation that sends specific metadata packets to toggle skin layers on/off, but it was working fine in earlier viarewind versions.

I believe this only started happening after https://github.com/ViaVersion/ViaRewind/commit/481315f1e6f438c030eed22031a6b36d3340c3ba

Steps to Reproduce

Server in 1.21 A client joins with 1.21 Another client joins in 1.8 ??? Console log spam?

I'm sorry but i have not figured out what the root cause is so i can't really tell you how to reproduce, if nothing obvious has changed about entity tracking i'll dive deeper and attach further info.

Expected Behavior

No console error spam?

Additional Server Info

No response

Checklist

Barvalg commented 2 months ago

Platform: 1.21--15--2df432f%20%28MC%3A%201.21%29
ViaVersion (5.0.1): Even with master
ViaBackwards(5.0.1): Even with master
ViaRewind(4.0.0): 5 commits behind master

Please update all Via* plugins from https://ci.viaversion.com/.In case the issue still persists send the new dump and the issue will be reopened

Pablete1234 commented 2 months ago

https://dump.viaversion.com/305aab2b013083c0d304eef8f6cbe1852dc9c3a62032dd5fb21bfcb49a05b166

Barvalg commented 2 months ago

Platform: 1.21--15--2df432f%20%28MC%3A%201.21%29
ViaVersion (5.0.1): Even with master
ViaBackwards(5.0.1): Even with master
ViaRewind(4.0.1-SNAPSHOT): Even with master

FlorianMichael commented 1 month ago

The commit you mentioned wasn't in the 4.0.0 release (the version you seem to used in the first dump) and generally shouldn't change anything as it's the same, it's more likely that this is another plugin sending bad data. You should follow https://github.com/ViaVersion/ViaRewind/issues/524#issuecomment-2183518325 to find if another plugin is causing this.

Pablete1234 commented 1 month ago

@FlorianMichael the version used is the second posted, i copied the dump from my previous issue, but this only started happening after the update to 4.0.1 snapshot

FlorianMichael commented 1 month ago

@Pablete1234 Can you take a look at the VV discord?

Pablete1234 commented 1 month ago

Found the root cause and it was not viarewind related