Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Soforak opened this issue Sep 11, 2024 · 7 comments

Comments

@Soforak
Copy link

Soforak commented Sep 11, 2024

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) [?:?]
@penturt
Copy link

penturt commented Sep 21, 2024

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

@MiThors
Copy link

MiThors commented Sep 27, 2024

Same here, anyone found a solution?

@Phax3
Copy link

Phax3 commented Oct 10, 2024

Having the same issue on Direwolf20 1.21
latest.log

@penturt
Copy link

penturt commented Oct 31, 2024

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

@DoomSquirter
Copy link

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.

@penturt
Copy link

penturt commented Nov 10, 2024

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.

@NielsPilgaard
Copy link

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

JDKDigital/InvTweaksRefoxed#16 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants