Inventory Sorter

Inventory Sorter

53M Downloads

Console Error when stopping server - Cannot get config value before config is loaded

Soforak opened this issue ยท 7 comments

commented

When stopping a server, it always end up with this error in logs which prevents the console to properly end the server.

  • Minecraft 1.21.1
  • Neoforge 21.1.50
  • Inventory Sorter 24.0.5
[11sept.2024 02:06:30.946] [Server thread/DEBUG] [net.neoforged.fml.config.ConfigTracker/CONFIG]: Unloading configs type SERVER
[11sept.2024 02:06:30.947] [Server thread/ERROR] [net.neoforged.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: Cannot get config value before config is loaded.
	Index: 0
	Listeners:
		0: cpw.mods.inventorysorter.InventorySorter$$Lambda/0x00007dc474c36768@76463a3
java.lang.IllegalStateException: Cannot get config value before config is loaded.
	at MC-BOOTSTRAP/[email protected]/com.google.common.base.Preconditions.checkState(Preconditions.java:512)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.getRaw(ModConfigSpec.java:1234)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.get(ModConfigSpec.java:1221)
	at TRANSFORMER/[email protected]/cpw.mods.inventorysorter.InventorySorter.onConfigLoad(InventorySorter.java:118)
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.ConsumerEventHandler.invoke(ConsumerEventHandler.java:26)
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:350)
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:315)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModContainer.acceptEvent(ModContainer.java:158)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ModConfig.setConfig(ModConfig.java:79)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ConfigTracker.closeConfig(ConfigTracker.java:233)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at java.base/java.util.Collections$SynchronizedCollection.forEach(Collections.java:2351)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ConfigTracker.unloadConfigs(ConfigTracker.java:129)
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.server.ServerLifecycleHooks.handleServerStopped(ServerLifecycleHooks.java:136)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:750)
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267)
	at java.base/java.lang.Thread.run(Thread.java:1583)

[11sept.2024 02:06:30.948] [Server thread/ERROR] [net.neoforged.fml.ModContainer/LOADING]: Caught exception during event net.neoforged.fml.event.config.ModConfigEvent$Unloading@44ad9a54 dispatch for modid inventorysorter
java.lang.IllegalStateException: Cannot get config value before config is loaded.
	at MC-BOOTSTRAP/[email protected]/com.google.common.base.Preconditions.checkState(Preconditions.java:512) ~[guava-32.1.2-jre.jar%2383!/:?]
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.getRaw(ModConfigSpec.java:1234) ~[neoforge-21.1.50-universal.jar%23123!/:?]
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.get(ModConfigSpec.java:1221) ~[neoforge-21.1.50-universal.jar%23123!/:?]
	at TRANSFORMER/[email protected]/cpw.mods.inventorysorter.InventorySorter.onConfigLoad(InventorySorter.java:118) ~[inventorysorter-1.21-24.0.5.jar%23124!/:24.0.5]
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.ConsumerEventHandler.invoke(ConsumerEventHandler.java:26) ~[bus-8.0.1.jar%2367!/:?]
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:350) ~[bus-8.0.1.jar%2367!/:?]
	at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:315) ~[bus-8.0.1.jar%2367!/:?]
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModContainer.acceptEvent(ModContainer.java:158) ~[loader-4.0.24.jar%2360!/:4.0]
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ModConfig.setConfig(ModConfig.java:79) ~[loader-4.0.24.jar%2360!/:4.0]
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ConfigTracker.closeConfig(ConfigTracker.java:233) ~[loader-4.0.24.jar%2360!/:4.0]
	at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
	at java.base/java.util.Collections$SynchronizedCollection.forEach(Collections.java:2351) ~[?:?]
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ConfigTracker.unloadConfigs(ConfigTracker.java:129) ~[loader-4.0.24.jar%2360!/:4.0]
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.server.ServerLifecycleHooks.handleServerStopped(ServerLifecycleHooks.java:136) ~[neoforge-21.1.50-universal.jar%23123!/:?]
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:750) ~[server-1.21.1-20240808.144430-srg.jar%23122!/:?]
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267) ~[server-1.21.1-20240808.144430-srg.jar%23122!/:?]
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
[11sept.2024 02:06:30.949] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Uncaught exception in server thread
net.neoforged.fml.ModLoadingException: Loading errors encountered:
	- Simple Inventory Sorter (inventorysorter) encountered an error while dispatching the net.neoforged.fml.event.config.ModConfigEvent$Unloading event
	  java.lang.IllegalStateException: Cannot get config value before config is loaded.

	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.ModContainer.acceptEvent(ModContainer.java:162) ~[loader-4.0.24.jar%2360!/:4.0]
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ModConfig.setConfig(ModConfig.java:79) ~[loader-4.0.24.jar%2360!/:4.0]
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ConfigTracker.closeConfig(ConfigTracker.java:233) ~[loader-4.0.24.jar%2360!/:4.0]
	at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
	at java.base/java.util.Collections$SynchronizedCollection.forEach(Collections.java:2351) ~[?:?]
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ConfigTracker.unloadConfigs(ConfigTracker.java:129) ~[loader-4.0.24.jar%2360!/:4.0]
	at TRANSFORMER/[email protected]/net.neoforged.neoforge.server.ServerLifecycleHooks.handleServerStopped(ServerLifecycleHooks.java:136) ~[neoforge-21.1.50-universal.jar%23123!/:?]
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:750) ~[server-1.21.1-20240808.144430-srg.jar%23122!/:?]
	at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267) ~[server-1.21.1-20240808.144430-srg.jar%23122!/:?]
	at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
commented

Having the same issue. Was just about to open an issue with the same error message.

commented

Same here, anyone found a solution?

commented

Having the same issue on Direwolf20 1.21
latest.log

commented

Can't properly schedule server restarts due to this error just causing server shutdown to hang.

commented

same. Dealing with other bugs not related to this and it's causing lots of issues when that bug crashes server and it just halts instead. would be super great if there was a fix to this.