websitenmaker12 / Advanced-Genetics

6 stars 0 forks source link

[Compatibility/severe] Client DC due to syringe with too much ForgeData NBT tag data #165

Open dgbonomo opened 9 years ago

dgbonomo commented 9 years ago

Problem

Ahoy. After I pulled some blood into a syringe, I was disconnected and could not log back in. The specific error I received on the client was:

[Netty Client IO #1/ERROR] [FML/]: NetworkDispatcher exception io.netty.handler.codec.DecoderException: java.io.EOFException

I also noticed the following error in my log:

io.netty.handler.codec.DecoderException: java.io.IOException: Packet was larger than I expected, found 39754 bytes extra whilst reading packet 0

Research

I decided to poke about with NBT Explorer and discovered that the syringe had a full copy of the ForgeData tag. My player file was close to 80kB. Since a lot of that was inside the ForgeData tag, which was essentially doubled into the Syringe item, both tags probably contained close to 2/80 = 40kB of data.

On a hunch, I decided to just delete delete some of that from my Syringe, and sure enough, I could log in again. Unsurprisingly, drawing blood back into a syringe caused an identical disconnect. Given that it was copying the ForgeData, I decided to look at that tag and find out what might be wrong. My attention was drawn to two particular tags:

Specifically, the Hats_unlocked tag contained about 3000 characters and the MorphSave tag contained a whopping near-300 compound tags, each with more tags nested inside, storing what seemed to be the bulk of the data from my player file.

I deleted the MorphSave tag from both the ForgeData tag and the syringe data, and compared the resulting filesize against a backup copy of the player file:

I decided to go a step further and purge all the Hat_ tags from both locations as well. That means, specifically:

That results in another reduction of of 1752 bytes:

The resulting file is only 3kB large, compared to the 76kB it started on. In the multiple tests I've run afterwards I have not found any issues disconnects due to using the Syringe, which suggests that the amount of data is indeed the problem.

Suggested solution

I'm not entirely sure why an entire copy of the ForgeData tag is made or how much of it is necessarily used, but presumably, the two obvious solutions are:

Alternatively, if possible, increase allowed data transfer size, or something. I don't know enough to know if there's a set value that can simply be tweaked, but it seems like the kind of thing that'd not necessarily be a part of Advanced Genetics and changes to it would probably be less feasible.

Thanks & credits

Hah, I couldn't resist. Thanks for Advanced Genetics. It's one of my favourite mods, and it's usually one of the first thing I play around with. :+1: I'm looking forward to this issue being resolved so I can put my morphs and hats back. :)

tim-oster commented 9 years ago

Hi. Firstival thank you very much. This is one of the best Bug Reports I've ever read! Which version of Advanced Genetics are you using?

dgbonomo commented 9 years ago

Sorry, I forgot to mention that - I'm using Advanced Genetics v1.5.9 for Minecraft 1.7.10.

tim-oster commented 9 years ago

Ok. I thought I already fixed that... Currently, I am not at home so I cannot fix this. Will look over it again in about 2 weeks. Thanks again!

Anarcraft commented 9 years ago

We've been having this problem as well. If it helps my last user got kicked with a slightly different error: "Internal Exception: io.netty.handler.codec.DedocerException.: net.minecraft.util.ReportedException: Loading NBT data"

The client console when it attempted to join and then kicked: http://pastebin.com/ZTZnyC4Z

I'm saving an example broken file if you want it just let me know.

To see the versions of everything in my modpack: https://github.com/Anarcraft/FTBOP

MythCracker commented 4 years ago

Hi there, I'm having this same issue on 1.7.10, I know it's an older version so likely not supported anymore, but I was wondering if there was ever any fix found for this and if there was anything I could do? From the original post I gather that I could just delete the extra data in the tag to be able to log back into a server, but if there aren't any fixes for this is there any way by which I could edit the mod files I have installed so that the syringe only copies the data relevant to Adv Genetics?