ViaVersion / ViaBackwards

Allows the connection of older clients to newer server versions for Minecraft servers.
https://hangar.papermc.io/ViaVersion/ViaBackwards
GNU General Public License v3.0
461 stars 87 forks source link

New users being disconnected #408

Closed DrPepplies closed 1 month ago

DrPepplies commented 2 years ago

'/viaversion dump' Output

https://dump.viaversion.com/ae566eec01da647c1646d9f6b37e24ab35313d0f7f1a063b65d7182b983e79bd

Console Error

16:29:21 [INFO] [{username},/{ip}:{port}] <-> InitialHandler has connected
16:29:22 [INFO] [{username}] <-> ServerConnector [main] has connected
16:29:22 [WARNING] [ViaBackwards] Ignoring plugin channel in incoming REGISTER: FML
16:29:22 [WARNING] [ViaBackwards] Ignoring plugin channel in incoming REGISTER: FML
16:29:22 [WARNING] [ViaBackwards] Ignoring plugin channel in incoming REGISTER: FORGE
16:29:22 [SEVERE] [ViaVersion] An error occurred in metadata handler EntityPackets1_14 for PLAYER entity type: Metadata{id=12, metaType=VarInt, value=0}
16:29:22 [SEVERE] [ViaVersion] Full metadata: Metadata{id=0, metaType=Byte, value=0}
Metadata{id=1, metaType=VarInt, value=300}
Metadata{id=2, metaType=OptChat, value=null}
Metadata{id=3, metaType=Boolean, value=false}
Metadata{id=4, metaType=Boolean, value=false}
Metadata{id=5, metaType=Boolean, value=false}
Metadata{id=7, metaType=VarInt, value=0}
Metadata{id=8, metaType=Byte, value=0}
Metadata{id=9, metaType=Float, value=20.0}
Metadata{id=10, metaType=VarInt, value=0}
Metadata{id=11, metaType=OptPosition, value=null}
Metadata{id=11, metaType=Boolean, value=false}
Metadata{id=12, metaType=Float, value=0.0}
Metadata{id=12, metaType=VarInt, value=0}
Metadata{id=15, metaType=VarInt, value=0}
Metadata{id=16, metaType=Byte, value=0}
Metadata{id=17, metaType=Byte, value=1}
Metadata{id=18, metaType=NBTTag, value=CompoundTag { {} }}
Metadata{id=19, metaType=NBTTag, value=CompoundTag { {} }}
16:29:22 [SEVERE] java.lang.ClassCastException: class java.lang.Integer cannot be cast to class com.viaversion.viaversion.api.minecraft.Position (java.lang.Integer is in module java.base of loader 'bootstrap'; com.viaversion.viaversion.api.minecraft.Position is in unnamed module of loader net.md_5.bungee.api.plugin.PluginClassloader @19835e64)
16:29:22 [SEVERE]       at com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.packets.EntityPackets1_14.lambda$registerRewrites$7(EntityPackets1_14.java:460)
16:29:22 [SEVERE]       at com.viaversion.viaversion.rewriter.EntityRewriter.handleMetadata(EntityRewriter.java:118)
16:29:22 [SEVERE]       at com.viaversion.viabackwards.api.rewriters.EntityRewriterBase.handleMetadata(EntityRewriterBase.java:72)
16:29:22 [SEVERE]       at com.viaversion.viabackwards.api.rewriters.LegacyEntityRewriter$3.lambda$registerMap$0(LegacyEntityRewriter.java:106)
16:29:22 [SEVERE]       at com.viaversion.viaversion.api.protocol.remapper.PacketRemapper.remap(PacketRemapper.java:158)
16:29:22 [SEVERE]       at com.viaversion.viaversion.api.protocol.AbstractProtocol.transform(AbstractProtocol.java:324)
16:29:22 [SEVERE]       at com.viaversion.viaversion.protocol.packet.PacketWrapperImpl.apply(PacketWrapperImpl.java:371)
16:29:22 [SEVERE]       at com.viaversion.viaversion.protocol.packet.PacketWrapperImpl.apply(PacketWrapperImpl.java:359)
16:29:22 [SEVERE]       at com.viaversion.viaversion.protocol.packet.PacketWrapperImpl.apply(PacketWrapperImpl.java:46)
16:29:22 [SEVERE]       at com.viaversion.viaversion.protocol.ProtocolPipelineImpl.transform(ProtocolPipelineImpl.java:117)
16:29:22 [SEVERE]       at com.viaversion.viaversion.connection.UserConnectionImpl.transform(UserConnectionImpl.java:298)
16:29:22 [SEVERE]       at com.viaversion.viaversion.connection.UserConnectionImpl.transformClientbound(UserConnectionImpl.java:277)
16:29:22 [SEVERE]       at com.viaversion.viaversion.bungee.handlers.BungeeEncodeHandler.encode(BungeeEncodeHandler.java:55)
16:29:26 [INFO] [{username}] -> UpstreamBridge has disconnected
16:29:26 [INFO] [{username}] <-> DownstreamBridge <-> [main] has disconnected

Bug Description

Whenever a brand new player connects for the first time, I get this error in the Bungeecord log and the player is disconnected after maybe 5-10 seconds. If they log back in after that, they're totally fine. All other players are fine, it's only ever the first login.

Looking back through the logs it reliably happens every single time a new player joins. Not sure how long it's been happening unfortunately, didn't notice it was happening until we spotted the pattern. Don't think it's been going on that long (maybe a handful of months?) or we would've probably noticed it earlier.

Looks like the exact same stack trace as #403 - we do also have Citizens2 NPCs and there are some in the spawn world the player logs in to. Not in sight of the spawn area but nearby, so it's not caused by clicking them. And again, the player logs in fine on the second login.

The specific player in the paste was playing on 1.17.1.

Steps to Reproduce

We've had trouble reproducing because of the nature of it, it doesn't happen for any of our accounts. I guess the reproduction steps are this, but it's not very helpful as we can't verify them:

  1. Set up Bungeecord with ViaVersion/ViaBackwards
  2. Join with a brand new Minecraft account
  3. Get disconnected

Expected Behavior

Players don't disconnect.

Additional Server Info

Running ViaVerison and ViaBackwards via Bungeecord, connecting to a Paper 1.17.1 server.

The server is running a bunch of plugins but unsure if that is useful, the Bungeecord is very light and doesn't have much other than Geyser/Floodgate, and ViaVersion/ViaBackwards (can see in the viaversion dump).

Checklist

Barvalg commented 2 years ago

Platform: git%3ABungeeCord--Bootstrap%3A1.17--R0.1--SNAPSHOT%3A6613aae%3A1607
ViaVersion (4.0.2-SNAPSHOT): Even with master
ViaBackwards(4.0.2-SNAPSHOT): Even with master

kennytv commented 2 years ago

Can you try without Citizens (or without other plugins in general) to isolate the issue better? Also try moving Via from the Bungee to your Paper server(s) and see if the same happens please.

DrPepplies commented 2 years ago

Can you try without Citizens (or without other plugins in general) to isolate the issue better?

I'm not sure how unfortunately, would have to wait for another new player and don't have any servers my account hasn't logged in to. I'll try set up a new server behind our Bungee but might not be quick, and definitely won't be able to reproduce the exact conditions of the main server.

Also try moving Via from the Bungee to your Paper server(s) and see if the same happens please.

Would I need to move ViaVersion and ViaBackwards or just one?

kennytv commented 2 years ago

Remove both VV and VB from the Bungee and add them to Paper instead. As for needing first-time logins, you could do one of the following depending on what's easier for you, using a 1.13 client or lower: 1) Delete player data of your test accounts/deleting all player data on a test copy of your server 2) Going to the place or doing whatever first-time logins have to do 3) Setup a test copy of your server allowing cracked accounts If you can't do any of them, I'll see if I can find out myself, but that might take longer

amadeusmz commented 2 years ago

I'm having the same issue with recent versions, but not with 4.0.1 I don't know how to reproduce

kennytv commented 1 month ago

Since then a few entity data issues have been fixed, anything else is likely to be a plugin sending bad data