Silent Gear

Silent Gear

19M Downloads

SG crashes server right after logging in

twothe opened this issue ยท 11 comments

commented

Versions

  • Silent Gear: 3.0.7
  • Silent's Gems: N/A
  • Silent Lib: 7.0.3
  • Forge: 43.1.65
  • Modpack: N/A
  • Optifine Installed: No

Expected Behavior

Game should not crash after logging in

Actual Behavior

When logging into a world or creating a new one the operation fails with the error message below. This happens only if Silent Gear is installed. This happens 100% of the time,, however after trying 2-3 times you can eventually enter the world.

Links/Images

Steps to Reproduce the Problem

  1. Create a new world
commented

If it is a timing issue like I suspect, then the easiest way to avoid it would be to wait a second after the login event before SG sends out packages.

However what feels a bit strange here is: why is the client actually actively requesting the stats? The server should have all the information necessary to send the correct stats to the client once so that actively asking should be unnecessary.

commented

Side question: how do you activate debug logs? I can't seem to get this switched on on my client.

commented

I'm publishing version 3.0.8 with a possible fix for the issue. Since I haven't had any luck reproducing the issue, I'm kind of guessing at what I need to do here. But let me know if anything changes in 3.0.8.

commented

I am no longer experiencing the issues. Went to the pack that had a 100% crash rate and logged in several times, worked flawlessly every time.

Great work! :)

commented

Yep no crashes here either so far, was able to log into a world that had started crashing every time I loaded it up.

commented

Any other clues why this might be happening for you? A pack with just the specified versions of Forge, Gear, and Lib doesn't produce a crash. So I have no idea where to start with this...

commented

I did investigate a little and it is definitely a timing issue. With a few mods the issue occurs sometimes (like 1/3 logins) if I make the window bigger it appears more often than if I make the window smaller. It is not linked to any mod added, any selection of mods will do, it just appears more and more frequently the bigger the list.

commented

I have literally no idea. I often create various pack setups to test modpack ideas. No matter what I assemble the very moment I add Silent Gear (one of my favorite mods btw) the issue appears, the moment I remove it the issue is gone.

I already experimented and threw out several other mods that I suspected might have something to do with that, but the core problem seems to be Silent Gear.

As far as I can tell from the issues I am seeing, your mod seems to send something on player login that gets the server confused and causes it to send packages that it shouldn't at that point. Could be related to the state where the player reports being logged in but is not yet fully in the world.

commented

I've run into this one as well, and have the relevant excerpt from the debug log, maybe this can help?

https://pastebin.com/5LKVra4W

05Dec2022 10:34:13.141] [Server thread/DEBUG] [Silent Gear/]: Sending parts crafting item correction packet
[05Dec2022 10:34:13.142] [Netty Local Client IO #1/DEBUG] [Silent Gear/]: Gear parts crafting items packet: 1787 bytes
[05Dec2022 10:34:13.147] [Netty Local Client IO #1/DEBUG] [Silent Gear/]: Sending recalculate stats packet for item with missing silentgear:durability stat: Crimson Steel Pickaxe
[05Dec2022 10:34:13.147] [Netty Local Client IO #1/WARN] [com.connectivity.Connectivity/]: java.lang.NullPointerException: Cannot invoke "net.minecraft.client.multiplayer.ClientPacketListener.m_6198_()" because the return value of "net.minecraft.client.Minecraft.m_91403_()" is null
[05Dec2022 10:34:13.147] [Netty Server IO #3/ERROR] [net.minecraft.network.Connection/]: Received class net.minecraft.network.protocol.game.ClientboundDisconnectPacket that couldn't be processed
java.lang.ClassCastException: class net.minecraft.server.network.ServerGamePacketListenerImpl cannot be cast to class net.minecraft.network.protocol.game.ClientGamePacketListener (net.minecraft.server.network.ServerGamePacketListenerImpl and net.minecraft.network.protocol.game.ClientGamePacketListener are in module [email protected] of loader 'TRANSFORMER' @15d88c10)
at net.minecraft.network.protocol.game.ClientboundDisconnectPacket.m_5797_(ClientboundDisconnectPacket.java:7) ~[client-1.19.2-20220805.130853-srg.jar%23416!/:?]
at net.minecraft.network.Connection.m_129517_(Connection.java:163) ~[client-1.19.2-20220805.130853-srg.jar%23416!/:?]
at net.minecraft.network.Connection.channelRead0(Connection.java:148) [client-1.19.2-20220805.130853-srg.jar%23416!/:?]
at net.minecraft.network.Connection.channelRead0(Connection.java:48) [client-1.19.2-20220805.130853-srg.jar%23416!/:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.local.LocalChannel.readInbound(LocalChannel.java:299) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.local.LocalChannel.finishPeerRead0(LocalChannel.java:445) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:50) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:403) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) [netty-common-4.1.77.Final.jar%23106!/:4.1.77.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) [netty-common-4.1.77.Final.jar%23106!/:4.1.77.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) [netty-common-4.1.77.Final.jar%23106!/:4.1.77.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503) [netty-transport-4.1.77.Final.jar%23111!/:4.1.77.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) [netty-common-4.1.77.Final.jar%23106!/:4.1.77.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.77.Final.jar%23106!/:4.1.77.Final]
at java.lang.Thread.run(Unknown Source) [?:?]
[05Dec2022 10:34:13.185] [Server thread/INFO] [net.minecraft.server.network.ServerGamePacketListenerImpl/]: direwolf20 lost connection: Server sent an invalid packet
[05Dec2022 10:34:13.185] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: direwolf20 left the game

commented

I can confirm this is happening for Dw20 in his indev 1.19.2 pack as well
image

Removing the mods (silentgear, silentlib and silentgearcompat) resolved the issue.

Looks to be most relevant info:

[05Dec2022 10:31:12.081] [Netty Local Client IO #0/DEBUG] [Silent Gear/]: Gear parts crafting items packet: 1787 bytes
[05Dec2022 10:31:12.093] [Netty Local Client IO #0/DEBUG] [Silent Gear/]: Sending recalculate stats packet for item with missing silentgear:durability stat: Crimson Steel Pickaxe
[05Dec2022 10:31:12.093] [Netty Local Client IO #0/WARN] [com.connectivity.Connectivity/]: java.lang.NullPointerException: Cannot invoke "net.minecraft.client.multiplayer.ClientPacketListener.m_6198_()" because the return value of "net.minecraft.client.Minecraft.m_91403_()" is null
[05Dec2022 10:31:12.095] [Netty Server IO #1/ERROR] [net.minecraft.network.Connection/]: Received class net.minecraft.network.protocol.game.ClientboundDisconnectPacket that couldn't be processed
commented

Might be caused by this line then? If so, then the question is what I need to check to prevent the crash...