Refined Storage

Refined Storage

77M Downloads

Exceeding max NBT tag size with storage blocks.

Opened this issue ยท 7 comments

commented

The issue is when you store full storage block into a (diamond) chest it will exceed the maximum NBT tag size of 2 megabytes. You will be kicked off the server with this message:
https://gyazo.com/c8593bc268eec62d7ec077d3b03ed1b4

I have looked into this issue and it seems all the storage block NBT data gets squashed in with the chest NBT data. So if you have a chest full of storage blocks, that are completely filled (this case 64k blocks) the NBT maximum will be reached.

In my test world I put a chest with 5 filled storage blocks. In the NBT data you can clearly see 397 entries for one of the storage block, thats a lot of NBT data.

http://puu.sh/vAjUv/9bef47b13b.png

The server I played on I had about 3 to 4 million items in my RS and thousands of different types of items. Also there we're about ~512 storage blocks used, which of 30%-ish was filled with items. Unfortunately I can't debug this since im not the administrator of the server.

No concrete repro steps tough, you can repro by just filling a storage blocks with many types of items. The more items types you put in, the bigger the NBT will be (and more likely to exceed 2MB)

The consequences of this bug are pretty nasty, anyone who will load this chunk will be kicked off the server until his position is changed so he doesn't load that chunk.

Versions
Minecraft: 1.10.2
Forge: 12.18.3.2281
Refined Storage: 1.2.25

Does this issue occur on a server?
yes...

commented

sounds similar to old ae2 issue with its storage modules and golden bag of holding. fill bag and it corrupts the player dat file because it exceeds the max size for storage.

commented

@ktole1999 Hmm yeah that would be the same issue. The reason RS is more likely to corrupt is due the too the fact that RS storage disks/blocks don't have a limit to the amount of types in a drive or block. I remember AE2 having 64 type limit.

commented

This is what I was able to fetch from the log files of the client. I do not have access to the server side of things.

Stacktrace: https://pastebin.com/CjPZKr2R

commented

No 1 rule when creating an issue: link the crash report.
Give me the crash report you got in https://gyazo.com/c8593bc268eec62d7ec077d3b03ed1b4

commented

This is interesting. This only happens if the storage blocks are in a chest, right? The chest doesn't send any inventory data with the chunk packet, normally... that should only happen when you open the container...

commented

Yes storage blocks in a diamond chest. I specificly remembered me flying away from the base and upon re-entering it would kick me out of the server. So most likey the chunk the chest was in was being loaded. In my test world I setup diamond chest with couple of full storage blocks. In the world NBT you can clearly see there being a couple of 100 entries from the storage block. This could escalate into exceeding the NBT max.

commented

Ah, this is a Iron Chests bug then.

When sending the chest data it should use Item#getShareTag instead of the actual ItemStack. RS overrides this method to provide a lightweight "block" for client receival.

Please report this on their issue tracker:

https://github.com/progwml6/ironchest

Thanks