Cannot get config value before config is loaded
Deele opened this issue ยท 0 comments
Bug description
During shutting down of a server, every time, I get errors:
[14:33:22] [Server thread/INFO] [Puzzles Lib/]: Dispatching unloading event for config at visualworkbench-server.toml
[14:33:22] [Server thread/ERROR] [ne.ne.fm.ja.FMLModContainer/]: Exception caught during firing event: Cannot get config value before config is loaded.
Index: 0
Listeners:
0: de.maxhenkel.gravestone.corelib.CommonRegistry$$Lambda/0x000002b3a8071cf0@7c05511
1: de.maxhenkel.gravestone.corelib.CommonRegistry$$Lambda/0x000002b3a8071cf0@387026d2
java.lang.IllegalStateException: Cannot get config value before config is loaded.
at MC-BOOTSTRAP/[email protected]/com.google.common.base.Preconditions.checkState(Preconditions.java:502)
at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.getRaw(ModConfigSpec.java:1228)
at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.get(ModConfigSpec.java:1215)
at TRANSFORMER/[email protected]/de.maxhenkel.gravestone.ServerConfig.onReload(ServerConfig.java:59)
at TRANSFORMER/[email protected]/de.maxhenkel.gravestone.corelib.CommonRegistry.lambda$registerConfig$5(CommonRegistry.java:143)
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:69)
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:133)
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)
[14:33:22] [Server thread/ERROR] [ne.ne.fm.ModContainer/LOADING]: Caught exception during event net.neoforged.fml.event.config.ModConfigEvent$Unloading@2c815c24 dispatch for modid gravestone
java.lang.IllegalStateException: Cannot get config value before config is loaded.
at MC-BOOTSTRAP/[email protected]/com.google.common.base.Preconditions.checkState(Preconditions.java:502) ~[guava-31.1-jre.jar%2383!/:?] {re:mixin}
at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.getRaw(ModConfigSpec.java:1228) ~[neoforge-21.0.146-universal.jar%23188!/:?] {re:classloading}
at TRANSFORMER/[email protected]/net.neoforged.neoforge.common.ModConfigSpec$ConfigValue.get(ModConfigSpec.java:1215) ~[neoforge-21.0.146-universal.jar%23188!/:?] {re:classloading}
at TRANSFORMER/[email protected]/de.maxhenkel.gravestone.ServerConfig.onReload(ServerConfig.java:59) ~[gravestone-neoforge-1.21-1.0.17.jar%23222!/:1.21-1.0.17] {re:classloading}
at TRANSFORMER/[email protected]/de.maxhenkel.gravestone.corelib.CommonRegistry.lambda$registerConfig$5(CommonRegistry.java:143) ~[gravestone-neoforge-1.21-1.0.17.jar%23222!/:1.21-1.0.17] {re:classloading}
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.21.jar%2360!/:4.0] {re:mixin}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ModConfig.setConfig(ModConfig.java:69) ~[loader-4.0.21.jar%2360!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ConfigTracker.closeConfig(ConfigTracker.java:233) ~[loader-4.0.21.jar%2360!/:4.0] {}
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {re:mixin}
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.21.jar%2360!/:4.0] {}
at TRANSFORMER/[email protected]/net.neoforged.neoforge.server.ServerLifecycleHooks.handleServerStopped(ServerLifecycleHooks.java:133) ~[neoforge-21.0.146-universal.jar%23188!/:?] {re:mixin,re:classloading}
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:750) ~[server-1.21-20240613.152323-srg.jar%23187!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267) ~[server-1.21-20240613.152323-srg.jar%23187!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?] {re:mixin}
[14:33:22] [Server thread/ERROR] [minecraft/MinecraftServer]: Uncaught exception in server thread
net.neoforged.fml.ModLoadingException: Loading errors encountered:
- Gravestone Mod (gravestone) 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.21.jar%2360!/:4.0] {re:mixin}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ModConfig.setConfig(ModConfig.java:69) ~[loader-4.0.21.jar%2360!/:4.0] {}
at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.config.ConfigTracker.closeConfig(ConfigTracker.java:233) ~[loader-4.0.21.jar%2360!/:4.0] {}
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {re:mixin}
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.21.jar%2360!/:4.0] {}
at TRANSFORMER/[email protected]/net.neoforged.neoforge.server.ServerLifecycleHooks.handleServerStopped(ServerLifecycleHooks.java:133) ~[neoforge-21.0.146-universal.jar%23188!/:?] {re:mixin,re:classloading}
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:750) ~[server-1.21-20240613.152323-srg.jar%23187!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267) ~[server-1.21-20240613.152323-srg.jar%23187!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?] {re:mixin}
Press any key to continue . . .
Minecraft version
1.21
Mod version
1.21-1.0.17
Mod loader and version
NeoForge 21.0.146
Steps to reproduce
- Have mod installed in the server
- Shut down the server
- Look inside console log and look for:
Gravestone Mod (gravestone) 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.
Expected behavior
Clear and consise shutting down of a server, without errors.
Log files
https://gist.github.com/Deele/b147cbec46f07e17d5ba9c340b213772
Screenshots
No response