AcademyCraft

AcademyCraft

1M Downloads

[Bug] Error deserializing network message [email protected]@7940abfb during world creation

levicc00123 opened this issue ยท 5 comments

commented

Describe the bug
During world creation, the game crashes back to the server list

To Reproduce

  1. Create new world with seed -9065479248748140566
  2. see crash

Expected behavior
The world is created and loaded successfully

Desktop (please complete the following information):
Windows 10 1803 Build 17134.619
Java 8u201
Minecraft 1.12.2
Forge 14.23.5.2815
Academycraft 1.1.0

Additional context
latest.log
debug.log

commented

Does this happen all the time?

commented
commented

Relevant (only) crash:

[02:49:13] [Netty Local Client IO #2/ERROR] [FML]: There was a critical exception handling a packet on channel lambdalib2
io.netty.handler.codec.DecoderException: java.lang.RuntimeException: Error deserializing network message [email protected]@7940abfb
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:98) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:274) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.func_148833_a(FMLProxyPacket.java:99) [FMLProxyPacket.class:?]
	at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:147) [gw.class:?]
	at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:49) [gw.class:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:382) [NetworkDispatcher.class:?]
	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:268) [NetworkDispatcher.class:?]
	at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:72) [NetworkDispatcher.class:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.local.LocalChannel.finishPeerRead0(LocalChannel.java:443) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.local.LocalChannel.access$500(LocalChannel.java:49) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:397) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.channel.DefaultEventLoop.run(DefaultEventLoop.java:54) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-all-4.1.9.Final.jar:4.1.9.Final]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]
Caused by: java.lang.RuntimeException: Error deserializing network message [email protected]@7940abfb
	at cn.lambdalib2.s11n.network.NetworkMessage$Message.fromBytes(NetworkMessage.java:364) ~[NetworkMessage$Message.class:?]
	at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:36) ~[SimpleIndexedCodec.class:?]
	at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:26) ~[SimpleIndexedCodec.class:?]
	at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:111) ~[FMLIndexedMessageToMessageCodec.class:?]
	at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:41) ~[FMLIndexedMessageToMessageCodec.class:?]
	at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	... 33 more
Caused by: java.lang.NullPointerException
	at net.minecraft.client.multiplayer.WorldClient.func_73045_a(WorldClient.java:270) ~[bsb.class:?]
	at cn.lambdalib2.s11n.network.NetworkS11n$15.read(NetworkS11n.java:306) ~[NetworkS11n$15.class:?]
	at cn.lambdalib2.s11n.network.NetworkS11n$15.read(NetworkS11n.java:293) ~[NetworkS11n$15.class:?]
	at cn.lambdalib2.s11n.network.NetworkS11n.deserializeWithHint(NetworkS11n.java:590) ~[NetworkS11n.class:?]
	at cn.lambdalib2.s11n.network.NetworkS11n.deserialize(NetworkS11n.java:571) ~[NetworkS11n.class:?]
	at cn.lambdalib2.s11n.network.NetworkMessage$Message.fromBytes(NetworkMessage.java:357) ~[NetworkMessage$Message.class:?]
	at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:36) ~[SimpleIndexedCodec.class:?]
	at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:26) ~[SimpleIndexedCodec.class:?]
	at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:111) ~[FMLIndexedMessageToMessageCodec.class:?]
	at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:41) ~[FMLIndexedMessageToMessageCodec.class:?]
	at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88) ~[netty-all-4.1.9.Final.jar:4.1.9.Final]
	... 33 more

methods.csv shows that func_73045_a is getEntityByID, and in WorldClient.java has:

    public Entity getEntityByID(int id)
    {
        return (Entity)(id == this.mc.player.getEntityId() ? this.mc.player : super.getEntityByID(id));
    }

I'd say, this.mc.player == null at this stage. If that's true, we need to do some workarounds.

  1. In LambdaLib2's NetworkS11n entity deserializer, if client && getMinecraft().player == null, throw an ContextException to indicate serialization failure. (Nothing can be done at this point)
  2. For AC's AnalyticDataListener, delay the sending process for a few secs, to ensure client has been properly initialized. (OR you can initiate the connection from client, that might work too somehow)
commented

As far as I can tell, it does not just happen when the world is being created. Also with existing worlds.
Singleplayer also causes a disconnection from the server (fatal error) with the exact same error message. (it happens in server multiplayer)
I can tell it is a client sided thing, since another person was already logged in and playing on the same world.

It takes several attempts, but at some point connecting to the world is possible. (and yeah it also takes several attempts to create a world in the same way)

I'll send my logs.

latest.log
debug.log

The logs are quite big, because at one time, I needed to try 15 times before I could succesfully connect.

This only happens in packs with academycraft (in minecraft1.12.2) unfortunately. Exact cause, unknown.

-> you can find my succesful connections if you look for [Client thread/INFO]: [CHAT]
I left some chat messages to make searching easier.

commented

fixed