tofodroid / mimi-mod

Musical Instrument Minecraft Interface
MIT License
13 stars 4 forks source link

Multiplayer server crash when server stop is issued. #142

Open fltaylor opened 2 months ago

fltaylor commented 2 months ago

When halting a Minecraft server with MIMI-mod installed, a crash occurs with the following exception:

[Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: Cannot invoke "java.util.concurrent.ExecutorService.shutdown()" because "io.github.tofodroid.mods.mimi.server.events.broadcast.producer.transmitter.ServerTransmitterManager.pool" is null
    Index: 1
    Listeners:
        0: NORMAL
        1: ASM: class io.github.tofodroid.mods.mimi.forge.common.CommonForgeEventHandler onServerStopping(Lnet/minecraftforge/event/server/ServerStoppingEvent;)V
        2: net.minecraftforge.eventbus.EventBus$$Lambda$4193/0x0000000801adf168@66391420
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ExecutorService.shutdown()" because "io.github.tofodroid.mods.mimi.server.events.broadcast.producer.transmitter.ServerTransmitterManager.pool" is null
    at TRANSFORMER/mimi@1.20.1-4.1.0/io.github.tofodroid.mods.mimi.server.events.broadcast.producer.transmitter.ServerTransmitterManager.onServerStopping(ServerTransmitterManager.java:88)
    at TRANSFORMER/mimi@1.20.1-4.1.0/io.github.tofodroid.mods.mimi.forge.common.CommonForgeEventHandler.onServerStopping(CommonForgeEventHandler.java:118)
    at TRANSFORMER/mimi@1.20.1-4.1.0/io.github.tofodroid.mods.mimi.forge.common.__CommonForgeEventHandler_onServerStopping_ServerStoppingEvent.invoke(.dynamic)
    at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73)
    at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:315)
    at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:296)
    at TRANSFORMER/forge@47.2.18/net.minecraftforge.server.ServerLifecycleHooks.handleServerStopping(ServerLifecycleHooks.java:122)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:671)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251)
    at java.base/java.lang.Thread.run(Unknown Source)
[12:35:06] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ExecutorService.shutdown()" because "io.github.tofodroid.mods.mimi.server.events.broadcast.producer.transmitter.ServerTransmitterManager.pool" is null
    at io.github.tofodroid.mods.mimi.server.events.broadcast.producer.transmitter.ServerTransmitterManager.onServerStopping(ServerTransmitterManager.java:88) ~[mimimod-1.20.1-4.1.0.jar%23102!/:1.20.1-4.1.0] {re:classloading}
    at io.github.tofodroid.mods.mimi.forge.common.CommonForgeEventHandler.onServerStopping(CommonForgeEventHandler.java:118) ~[mimimod-1.20.1-4.1.0.jar%23102!/:1.20.1-4.1.0] {re:classloading}
    at io.github.tofodroid.mods.mimi.forge.common.__CommonForgeEventHandler_onServerStopping_ServerStoppingEvent.invoke(.dynamic) ~[mimimod-1.20.1-4.1.0.jar%23102!/:1.20.1-4.1.0] {re:classloading,pl:eventbus:B}
    at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2352!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2352!/:?] {}
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2352!/:?] {}
    at net.minecraftforge.server.ServerLifecycleHooks.handleServerStopping(ServerLifecycleHooks.java:122) ~[forge-1.20.1-47.2.18-universal.jar%23110!/:?] {re:classloading}
    at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:671) ~[server-1.20.1-20230612.114412-srg.jar%23105!/:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23105!/:?] {re:classloading,pl:accesstransformer:B}
    at java.lang.Thread.run(Unknown Source) ~[?:?] {}

I first encounted it with the Craft2Exile 2 modpack, so I stood up another server with only MIMI and Patchouli, and was able to replicate the crash. I've attached server logs just in case it's needed. crash-2024-08-30_12.51.04-server.txt debug.log latest.log

tofodroid commented 1 month ago

Hello! Apologies for the slow reply, I was away from development for a couple months because I got married but hopping back into it now!

Thank you so much for the detailed bug report! I have identified the issue and will have a new version out with the fix soon!