Create

Create

86M Downloads

Cannot connect to Multiplayer LAN Game, refcnt = 0 error

RiverC opened this issue ยท 7 comments

commented

Describe the Bug

When attempting to log into a Forge 1.18 server running the create mod, config sync will fail with the error refcnt = 0 (error related to Netty version) and the player will get disconnected.

Reproduction Steps

  1. Create modpack with forge 1.18 and create
  2. Launch game and create world, Open to LAN
  3. Launch same modpack on different system, attempt to connect to LAN game

Expected Result

User connects successfully to LAN game.

Screenshots and Videos

No response

Crash Report or Log

No response

Operating System

Windows 10

Mod Version

0.4.0a

Minecraft Version

1.18

Forge Version

38.0.15

Other Mods

No response

Additional Context

[12:21:35] [Server thread/INFO]: Syncing config to Sapmoss (1fa1b2e4-3fd9-4f8b-bb1e-f2626349196b)
[12:21:36] [Netty Server IO #4/ERROR]: Error encoding packet
io.netty.util.IllegalReferenceCountException: refCnt: 0
	at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1454) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1383) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.buffer.UnpooledHeapByteBuf.copy(UnpooledHeapByteBuf.java:534) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.buffer.AbstractByteBuf.copy(AbstractByteBuf.java:1194) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at net.minecraft.network.FriendlyByteBuf.copy(FriendlyByteBuf.java:1169) ~[client-1.18-20211130.085255-srg.jar%23130!:?]
	at net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket.m_5779_(ClientboundCustomPayloadPacket.java:50) ~[client-1.18-20211130.085255-srg.jar%23130!:?]
	at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:42) ~[client-1.18-20211130.085255-srg.jar%23130!:?]
	at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:15) ~[client-1.18-20211130.085255-srg.jar%23130!:?]
	at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:110) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:790) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:758) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:808) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:306) ~[netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at net.minecraft.network.Connection.m_178303_(Connection.java:202) ~[client-1.18-20211130.085255-srg.jar%23130!:?]
	at net.minecraft.network.Connection.lambda$sendPacket$5(Connection.java:191) ~[client-1.18-20211130.085255-srg.jar%23130!:?]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) [netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) [netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) [netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.68.Final.jar%2332!:4.1.68.Final]
	at java.lang.Thread.run(Thread.java:833) [?:?]
[12:21:36] [Server thread/INFO]: Sapmoss lost connection: Internal Exception: io.netty.handler.codec.EncoderException: io.netty.util.IllegalReferenceCountException: refCnt: 0
[12:21:36] [Server thread/INFO]: Sapmoss left the game
[12:21:36] [Render thread/INFO]: [CHAT] Sapmoss left the game

Note that this is a known issue but seems to only affect LAN (not dedicated servers--) and is related to an update that Mojang performed to Netty in, iirc, 1.17. The Netty version is shown in the above stack trace.

commented

Can confirm. Playing on version 0.4.0a on a LAN-Server. My friend crashed after half an hour and we had to remove Create for now.

commented

Known bug, will be fixed in the next release.

commented

It is already version 0.4b, but it is still cannot be added on a LAN-Server. Extremely sad

commented

This is still a problem for me in 0.4c. Hoping for this to get fixed soon

commented

I'm running a dedicated server on PC as a workaround

commented

Sadly don't think thats an option for me, my PC couldn't handle it. Just gonna disable Create until its fixed

commented

Updating to Forge 39.0.60 or higher will fix this issue.