"Tried to read NBT tag that was too big" with large numbers of crafting recipes
Mike-Baker opened this issue ยท 8 comments
Issue type:
- ๐ Bug
Short description:
NBT size error with large numbers of crafting recipes (~220 in my world but it will likely vary based on recipe size?)
Symptoms:
- Adding an additional crafting recipe over some number will cause no crafting recipes to show up in the terminal.
- Crafting writers still function and automate crafts
- Error shows up in the logs (although it is fairly opaque)
Mitigation:
- Moving some crafting recipes into a crafter on a different channel to go back bellow the number will fix the issue
Additional Errors:
If you have one "overloaded" channel and one working channel, filtering the terminal to just the overloaded channel will show nothing, filtering it to the working channel will show the working recipes however filtering it to "all" will result in the results of the working channel endlessly cloned again and again and again
Diagnosis:
With help from kirjorjos and Natalie in your discord we came to the tentative conclusion that the issue is that all the NBT data for a channel's crafting recipes is serialised into one CompoundTag NBT object which then fails serialisation? deserialisation? at some point.
Regrettably I wasn't able to isolate where this happens in the code myself but I can provide more details, screenshots and/or a save file if that would help?
Steps to reproduce the problem:
- Create a large number of crafting interfaces, and fill them with a large number of recipes (~220)
- Try to open the storage terminal
- Observe no recipes present
- Remove some recpies/interfaces
- Remaining recipes re-appear in the terminal
Expected behaviour:
All recipes visible in storage terminal
Versions:
- This mod: 1.8.18
- Minecraft: 1.19/2
- Forge: Unsure
Log file:
@Mike-Baker Your issue appears to be not following one of the allowed issue templates, which breaks our automation tools. Please update your issue to the proper template.
In any case, the relevant part of the code is here:
Could you try lowering terminalStoragePacketMaxInstances
in your config file, to see if that resolves your problem? We may have to lowering that value by default. (or we may have to add a dedicated option for crafting instances specifically, since crafting and storage instances currently both make use of this option, while the former is significantly larger NBT-wise)
Dropping terminalStoragePacketMaxInstances from 1024 to 512 didn't help neither did 256, but dropping it to 128 seemed to fix the issue. (which makes sense given my network was blowing up at 220 recipes)
This does imply that the average recipe in my world takes around 10 kilobytes, I don't know if that's an abnormal case or if you could use it as a heuristic for finding the correct value.
Thanks for checking!
Will look into adding a separate config option then for crafting instances, with the default set to 128 or so.