inventorysorter icon indicating copy to clipboard operation
inventorysorter copied to clipboard

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

Open Soforak opened this issue 1 year ago • 1 comments

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) [?:?]

Soforak avatar Sep 11 '24 00:09 Soforak

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

penturt avatar Sep 21 '24 18:09 penturt

Same here, anyone found a solution?

MiThors avatar Sep 27 '24 21:09 MiThors

Having the same issue on Direwolf20 1.21 latest.log

Phax3 avatar Oct 10 '24 16:10 Phax3

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

penturt avatar Oct 31 '24 18:10 penturt

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.

DoomSquirter avatar Nov 04 '24 03:11 DoomSquirter

this mod usually takes forever to releases an update and when it dose it rarely actually addresses any of it issues. I have moved on to Inventory Tweaks - ReFoxed, offers me everything i need, and doesn't seem to hang on shutdown.

penturt avatar Nov 10 '24 15:11 penturt

That doesn't really do it for us due to this issue:

https://github.com/JDKDigital/InvTweaksRefoxed/issues/16#issue-2638726111

NielsPilgaard avatar Nov 11 '24 19:11 NielsPilgaard

Resolved in the latest 1.21 build and 1.21.1

MichaelHillcox avatar Dec 10 '24 10:12 MichaelHillcox