Iron Backpacks

Iron Backpacks

54M Downloads

Payload size exception when right-clicking backpacks to open

Xuerian opened this issue ยท 15 comments

commented

Issue Description:

When right-clicking backpacks in inventory to open, I get disconnected

What happens:

See above. Error:

[23:35:27] [Netty Client IO #2/ERROR] [FML]: NetworkDispatcher exception
java.lang.IllegalArgumentException: Payload may not be larger than 32767 bytes
	at net.minecraft.network.play.client.CPacketCustomPayload.<init>(CPacketCustomPayload.java:28) ~[it.class:?]
	at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.toC17Packet(FMLProxyPacket.java:143) ~[FMLProxyPacket.class:?]
	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.write(NetworkDispatcher.java:527) ~[NetworkDispatcher.class:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:706) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:741) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
	at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:895) ~[DefaultChannelPipeline.class:4.0.23.Final]
	at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:240) ~[AbstractChannel.class:4.0.23.Final]
	at net.minecraft.network.NetworkManager$4.run(NetworkManager.java:247) [eo$4.class:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [SingleThreadEventExecutor.class:4.0.23.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) [NioEventLoop.class:4.0.23.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [SingleThreadEventExecutor$2.class:4.0.23.Final]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]

What you expected to happen:

Not being disconnected

Steps to reproduce (important):

  1. Right click backpack in inventory
  2. ???
  3. Disconnect

Affected Versions (Do not use "latest"):

  • IronBackpacks: 1.10.2-2.2.17
  • Minecraft: 1.10.2
  • Forge: 12.18.3.2185
commented

Well, I sat down to test it, crashed the first time I right clicked a bag, and crashed. I've crashed right clicking my other bag and the one I wear before, BUT.. After I logged back in, I didn't crash when right clicking any of them, and I didn't change the contents at all.

So.. Yeah. I'll try to narrow it down some more I guess.

commented

Alright, that'd be great, thank you. It seems that there is basically too much data being sent when you attempt to open via right click. I know bees have a lot of data about them, a bag full of them may very well have caused it, but more investigation should help narrow down if that is actually the case or not.

commented

I've been trying it for the past few minutes, and here's what I've found:

  • I know I was disconnected with any of them at one point (not really a "just now" finding, to be fair)
  • I haven't been able to reproduce that on any of the other bags
  • The bee bag doesn't disconnect me every time, and if it works, it works until I change JEI's item cheating mode (It doesn't matter if it's toggling on or off)

You know, this doesn't really narrow anything down. Would the character file be of any help to you?

commented

Next time you crash, can you get me the whole log please?

  • What do you mean exactly by your first point? I don't understand.
  • Do you mean that only the bee bag seems to be causing an issue?
  • Very strange, I have no idea how that would affect it.

Are any of the backpacks nested, or are they all just in your inventory?

commented
  • I was just saying that I recalled being disconnected opening other bags (With no bees) before. But that should be ignored until I can reproduce it anyway.
  • Yes, only the bag pictured with bees has the issue. It isn't any bag I put bees into, it's that bag.
  • Yeah, I debated about mentioning it in the first place.

This is the complete log section from a mark in chat until the error message shows up:

[19:46:00] [Client thread/INFO]: [CHAT] <Xuerian> LOG MARK
[19:46:24] [Client thread/INFO] [JEI]: Building item filter...
[19:46:24] [Client thread/INFO] [JEI]: Built    item filter in 160 ms
[19:46:37] [Netty Client IO #8/ERROR] [FML]: NetworkDispatcher exception
java.lang.IllegalArgumentException: Payload may not be larger than 32767 bytes
	at net.minecraft.network.play.client.CPacketCustomPayload.<init>(CPacketCustomPayload.java:28) ~[it.class:?]
	at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.toC17Packet(FMLProxyPacket.java:143) ~[FMLProxyPacket.class:?]
	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.write(NetworkDispatcher.java:527) ~[NetworkDispatcher.class:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:706) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:741) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
	at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:895) ~[DefaultChannelPipeline.class:4.0.23.Final]
	at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:240) ~[AbstractChannel.class:4.0.23.Final]
	at net.minecraft.network.NetworkManager$4.run(NetworkManager.java:247) [eo$4.class:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [SingleThreadEventExecutor.class:4.0.23.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) [NioEventLoop.class:4.0.23.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [SingleThreadEventExecutor$2.class:4.0.23.Final]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
[19:46:37] [Netty Client IO #8/INFO] [EnderCore]: Reset configs to client values for com.enderio.core.common.config.ConfigHandler
[19:46:38] [Client thread/INFO] [FML]: Applying holder lookups
[19:46:38] [Client thread/INFO] [FML]: Holder lookups applied
[19:46:45] [Client thread/INFO] [MapWriter]: Mw.close: closing...
[19:46:45] [Client thread/INFO] [MapWriter]: waiting for 205 tasks to finish...
[19:46:45] [Client thread/INFO] [MapWriter]: waiting for 204 class mapwriter.tasks.SaveChunkTask to finish...
[19:46:45] [Client thread/INFO] [MapWriter]: waiting for 1 class mapwriter.tasks.CloseRegionManagerTask to finish...
[19:46:46] [Client thread/INFO] [MapWriter]: done
[19:46:46] [Client thread/INFO] [Mekanism]: Finished loading Cardboard Box blacklist (loaded 3 entries)
[19:46:46] [Client thread/INFO] [Mekanism]: Reloaded config.

There is nothing printed to the server's console.

I'm setting up test bags with varieties of item setups now, but since you're "here" I'll post this now and continue doing that.

commented

Something that might be worth noting: I have never been disconnected when opening it by activating it while held normally. I have been disconnected when it is sitting on my hotbar, but is right clicked on with inventory is open.

And to answer your other question directly, no they're not nested. Just sitting on my hotbar or in my inventory directly.

commented

Not that it will help you any better, but here's a clip of it: https://dl.dropboxusercontent.com/s/u5pu2o8gzwlr5q2/2016-12-10_20-00-42.webm

I should've expanded the capture window to get the hotbar, but you can see the names pop up when I select them before activating them in hand.

commented

That video does help actually ๐Ÿ‘

It is strange to me that it almost seems to be the bag itself as the issue, and not the contents (as I could see you had 2 bags full of bees and 1 worked fine).

Internally, if you right click a backpack via an inventory I am simply emulating a normal right click when in-hand. That being said, I may be doing some data syncing incorrectly to add this custom behavior; I will look into that more.

I'll do some investigation myself. The main help that could come from you would be a way of reliably producing this crash starting from a new/blank world, but if that is a lot of trouble don't worry about it.

I have finals to take next week, so I probably won't get to this issue until after then. For now I would possibly recommend cheating in a new bag and manually transferring over the contents of the crashing one. If that new bag starts crashing as well then you can post the contents here and I will at least have a way to reliably reproduce the crash xD

commented

Well, I moved all the stuff into another bag (Diamond bag, this time) and that one behaved the same: Fine when opened normally, disconnected when opening by right clicking on it, so it's definitely the contents not the bag.

Later on, I also was disconnected while right-clicking the test bag with only bees that you saw, so that should be a safe test case.

I confirmed a friend with the same bag had the same results: "Used" to open, no disconnect. Right click, disconnect.

I tried it with the Pam's stuff, and haven't had a disconnect

If you'd like it narrower than that I can try doing just forestry and IB to confirm, let me know.

commented

I think that should be enough, I'll just add forestry to my development environment and just stuff a bag full of bees to cause a crash and I can go from there.

Thanks for narrowing that down!

commented

Sounds good. Just to be clear, like that video I did right click the test bag with bees and didn't disconnect, but later also did. So it's not an all the time thing either.

commented

Thanks for the bug report!

As far as I know, this doesn't happen with every backpack, so it must have something to do with the contents of the backpack you specifically wish to open. Can you describe that here so that I can fix this bug?

commented

Hi, I'm getting this error again. This started happening when I put a Diamond Backpack in a Reinforced Strongbox from Thermal Foundation. I don't know if I should report it here or not. I haven't had this happen before with other backpacks going into it until I put my diamond backpack in it.

  • Minecraft Version: 1.12.2
  • Forge Version: 14.23.1.2555
  • Iron Backpacks: 1.12.2-3.0.2-3
commented

Yeah don't do that.

commented

@gr8pefish If this helps any, The wooden storage crate from immersive engineering full of bees does this as well. So it's not just your mod :)