Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packet/NBT Tag Size issue caused by Velocity #1037

Open
LandonDeam opened this issue Jul 2, 2023 · 7 comments
Open

Packet/NBT Tag Size issue caused by Velocity #1037

LandonDeam opened this issue Jul 2, 2023 · 7 comments
Labels
type: bug Something isn't working

Comments

@LandonDeam
Copy link

LandonDeam commented Jul 2, 2023

Steps to reproduce packet size issue:
Run a 1.19.2 Fabric server with the Dogcraft modpack under a Velocity server. Attempt to connect. Be met with the following (server side): https://mclo.gs/IHaC5YP

Steps to reproduce NBT tag size issue:
Run a 1.19.2 Fabric server with the mods Chipped, Consistency+, Continuity, Create, and Create Deco (all of which are in the aforementioned modpack) under a Velocity server. Attempt to connect. Be met with the following (client-side): https://mclo.gs/IUUz5pu

My best guess as to the cause: Velocity probably shares/uses the same built-in, hard-coded values for packet sizes and NBT tags as vanilla, and as soon as it sees something go over these limits, it throws up an error and disconnects the player, even if the player would have not been kicked by the Minecraft server itself.
Note: This is also pure speculation, so feel free to look for other explanations if this is not the case.

Additional Info: These errors do not occur when running the server bare, without Velocity. The root cause would seem to be Velocity somehow mishandling data that is too large, which tends to happen with the listed mods for some reason (which is strange, considering they basically all just add blocks). I also would use the Connectivity mod and call it a day, but it seems to have some sort of conflict with at least one of the other mods in the above pack (the reason I am reporting this in the first place), so that solution is out the window for the time being.

@LandonDeam
Copy link
Author

I'm currently suspecting it's something that occurs between lines 68 and 81 in the MinecraftDecoder class, as this would be the time for Velocity to so sanity checks on the buffer (and throw errors similar to the one described), and this function is only called by another function that, seemingly, would not have any effect on the packet/buffer. That is, of course, unless ByteBuf has a maximum buffer size set somewhere, and I'm just unfamiliar with the class.

@Nacioszeczek Nacioszeczek added the type: bug Something isn't working label Aug 12, 2023
@newtykip
Copy link

I am also having issues with NBT tag sizes. I am running Prominence II. However, my issues are on the server side. This is what my error looks like: https://mclo.gs/E8OtNbU

@Schmazda
Copy link

It actually looks like Velocity does not support the Fabric-API properly. Fundamental additions made to the Login Process are not supported by Velocity and are causing these errors. Essentially Velocity has to extend their Login to support said additions made by fabric. Otherwise some crucial packets are either corrupted or not forwarded at all

@newtykip
Copy link

newtykip commented Nov 12, 2023

My issue revolved around a mod implementing a custom handshake protocol which Velocity did not understand. After I added the compat plugin, this error amongst others disappeared. I do not know if Dogcraft has any mods which also implement custom protocols, but it might be worth investigating.

@Schmazda
Copy link

Yeah, it could be possible to generalize this approach so that every channel gets forwarded like that, but I'm not sure. Either way this would be a temporary workaround and by no means a fix that should be used in production.

@Schmazda
Copy link

Schmazda commented Nov 12, 2023

LandonDeam's Problem is probably that (Login-)PluginMessages with the Channel-ID fabric-networking-api-v1:early_registration are not forwarded properly which causes kind of a chain reaction that results in non-joinable Fabric servers when the Fabric Registry's size reaches a certain threshold. This should at least apply to the Packet-Size problem.

@electronicboy
Copy link
Member

owo handshaking occured during the LOGIN phase, a connection phase in which we cannot force the client back into; their compat plugin basically just makes the proxy cache the handshake that occurs during that phase in order to allow it to "support" the thing. blindly resending stuff during that phase is not a solution in which is anything but a hack likely to induce more problems than it solves, thankfully, 1.20.2 has a better solution for that issue.

The entire login phase is generally borked, because we assume that we don't need to have a client and a server talking to one another, given that it's literally impossible to even allow that to happen past the first server, it's never been a big consideration until attempting to design a means to reset modded clients into reconnecting came into play

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants