Simple Config

Simple Config

67k Downloads

[1.20.1] An error occurs when parsing some TOML on MPS server.

BalancedCracker opened this issue ยท 4 comments

commented

Describe the bug
I upgraded Simple Config from 1.0.5 to 1.0.7 on modded Minecraft 1.20.1 server and now the error is logged.
However, the 1.0.5 version is also not completely normal, and previously the warning Could not Wrap config value:general.special_recipe_costs of type net.minecraftforge.common.ForgeConfigSpec.ConfigValue was printed in the logs. I'll add it.

This error (and warning) is not logged on the client side.
There is a possibility that this is a (Neo)Forge-specific issue, but I will report it here for now.

  • Minecraft server 1.20.1 and NeoForge 1.20.1-47.1.101 (I also tried Forge 1.20.1-47.2.20, same result)
  • simpleconfig-1.20.1-1.0.7
  • sawmill-1.20-1.3.8
  • moonlight-1.20-2.11.0-forge

To Reproduce
Steps to reproduce the behavior:

  1. Configure Minecraft server with above 3 mods.
  2. Start the server
  3. See error

Expected behavior
No error logs are output to the server, and settings on the server can be changed.

Error Logs

in server log
[20:08:02] [main/INFO] [en.si.co.SimpleConfigWrapper/]: Wrapped client config for mod Universal Sawmill (sawmill)
[20:08:02] [main/INFO] [en.si.co.SimpleConfigWrapper/]: Wrapping common config for mod sawmill
[20:08:02] [main/ERROR] [ne.mi.fm.lo.RuntimeDistCleaner/DISTXFORM]: Attempted to load class endorh/simpleconfig/ui/impl/builders/FieldBuilder for invalid dist DEDICATED_SERVER
[20:08:03] [main/ERROR] [en.si.co.SimpleConfigWrapper/]: Error wrapping common config for mod Universal Sawmill (sawmill)
You may report this error at the Simple Config issue tracker
net.minecraft.ReportedException: Building config for mod sawmill
        at endorh.simpleconfig.core.SimpleConfigBuilderImpl.buildAndRegister(SimpleConfigBuilderImpl.java:723) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B,pl:runtimedistcleaner:A}
        at endorh.simpleconfig.core.SimpleConfigWrapper.lambda$wrapConfigs$2(SimpleConfigWrapper.java:137) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B}
        at java.util.HashMap.forEach(HashMap.java:1429) ~[?:?] {re:mixin}
        at net.minecraftforge.fml.ModList.forEachModContainer(ModList.java:223) ~[core-47.2.2.jar%23272!/:47.2] {}
        at endorh.simpleconfig.core.SimpleConfigWrapper.wrapConfigs(SimpleConfigWrapper.java:104) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B}
        at endorh.simpleconfig.core.SimpleConfigWrapper.lambda$onLoadComplete$1(SimpleConfigWrapper.java:98) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B}
        at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
        at net.minecraftforge.fml.DeferredWorkQueue.lambda$makeRunnable$2(DeferredWorkQueue.java:81) ~[core-47.2.2.jar%23272!/:47.2] {}
        at net.minecraftforge.fml.DeferredWorkQueue.makeRunnable(DeferredWorkQueue.java:76) ~[core-47.2.2.jar%23272!/:47.2] {}
        at net.minecraftforge.fml.DeferredWorkQueue.lambda$runTasks$0(DeferredWorkQueue.java:60) ~[core-47.2.2.jar%23272!/:47.2] {}
        at java.util.concurrent.ConcurrentLinkedDeque.forEach(ConcurrentLinkedDeque.java:1650) ~[?:?] {re:mixin}
        at net.minecraftforge.fml.DeferredWorkQueue.runTasks(DeferredWorkQueue.java:60) ~[core-47.2.2.jar%23272!/:47.2] {}
        at net.minecraftforge.fml.core.ParallelTransition.lambda$finalActivityGenerator$2(ParallelTransition.java:35) ~[events-47.2.2.jar%23277!/:47.2] {re:classloading,pl:rei_plugin_compatibilities:B}
        at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?] {}
        at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] {}
        at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:46) ~[core-47.2.2.jar%23272!/:47.2] {}
        at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:29) ~[core-47.2.2.jar%23272!/:47.2] {}
        at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:224) ~[core-47.2.2.jar%23272!/:47.2] {}
        at net.minecraftforge.fml.ModLoader.lambda$dispatchAndHandleError$20(ModLoader.java:210) ~[core-47.2.2.jar%23272!/:47.2] {}
        at java.util.Optional.ifPresent(Optional.java:178) ~[?:?] {re:mixin}
        at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:210) ~[core-47.2.2.jar%23272!/:47.2] {}
        at net.minecraftforge.fml.ModLoader.lambda$finishMods$17(ModLoader.java:197) ~[core-47.2.2.jar%23272!/:47.2] {}
        at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {re:mixin}
        at net.minecraftforge.fml.ModLoader.finishMods(ModLoader.java:197) ~[core-47.2.2.jar%23272!/:47.2] {}
        at net.minecraftforge.server.loading.ServerModLoader.load(ServerModLoader.java:32) ~[forge-1.20.1-47.1.101-universal.jar%23276!/:?] {re:classloading,pl:rei_plugin_compatibilities:B}
        at net.minecraft.server.Main.main(Main.java:125) ~[server-1.20.1-20230612.114412-srg.jar%23271!/:?] {re:classloading,pl:rei_plugin_compatibilities:B}
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] {}
        at java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] {}
        at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:126) ~[loader-47.2.2.jar%2351!/:47.2] {}
        at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.serverService(CommonLaunchHandler.java:118) ~[loader-47.2.2.jar%2351!/:47.2] {}
        at net.minecraftforge.fml.loading.targets.CommonServerLaunchHandler.runService(CommonServerLaunchHandler.java:26) ~[loader-47.2.2.jar%2351!/:47.2] {}
        at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.lambda$launchService$4(CommonLaunchHandler.java:108) ~[loader-47.2.2.jar%2351!/:47.2] {}
        at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.modlauncher.Launcher.run(Launcher.java:108) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] {}
Caused by: java.lang.RuntimeException: Attempted to load class endorh/simpleconfig/ui/impl/builders/FieldBuilder for invalid dist DEDICATED_SERVER
        at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:57) ~[loader-47.2.2.jar%2351!/:47.2] {}
        at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.9.jar%2358!/:?] {}
        at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.10.jar:?] {}
        at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] {}
        at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.10.jar:?] {}
        at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] {}
        at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.10.jar:?] {}
        at java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?] {}
        at endorh.simpleconfig.core.entry.CommentedConfigEntry$Builder.buildEntry(CommentedConfigEntry.java:98) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B}
        at endorh.simpleconfig.core.entry.CommentedConfigEntry$Builder.buildEntry(CommentedConfigEntry.java:55) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B}
        at endorh.simpleconfig.core.AbstractConfigEntryBuilder.build(AbstractConfigEntryBuilder.java:344) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B}
        at endorh.simpleconfig.core.SimpleConfigBuilderImpl$CategoryBuilder.lambda$build$0(SimpleConfigBuilderImpl.java:393) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B,pl:runtimedistcleaner:A}
        at java.util.LinkedHashMap.forEach(LinkedHashMap.java:986) ~[?:?] {re:mixin}
        at endorh.simpleconfig.core.SimpleConfigBuilderImpl$CategoryBuilder.build(SimpleConfigBuilderImpl.java:391) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B,pl:runtimedistcleaner:A}
        at endorh.simpleconfig.core.SimpleConfigBuilderImpl.lambda$buildAndRegister$2(SimpleConfigBuilderImpl.java:701) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B,pl:runtimedistcleaner:A}
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?] {}
        at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357) ~[?:?] {}
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) ~[?:?] {}
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?] {}
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?] {}
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}
        at java.util.stream.ReferencePipeline.forEachOrdered(ReferencePipeline.java:601) ~[?:?] {}
        at endorh.simpleconfig.core.SimpleConfigBuilderImpl.buildAndRegister(SimpleConfigBuilderImpl.java:699) ~[simpleconfig-1.20.1-1.0.7.jar%23244!/:1.20.1-1.0.7] {re:classloading,pl:rei_plugin_compatibilities:B,pl:runtimedistcleaner:A}
        ... 39 more
[20:08:03] [main/INFO] [en.si.co.SimpleConfigWrapper/]: Wrapped server config for mod Universal Sawmill (sawmill)

Additional context

in client log
21:53:53.076
game
[21:53:53] [Render thread/INFO] [en.si.co.SimpleConfigWrapper/]: Wrapped client config for mod Universal Sawmill (sawmill)
21:53:53.076
game
[21:53:53] [Render thread/INFO] [en.si.co.SimpleConfigWrapper/]: Wrapping common config for mod sawmill
21:53:53.082
game
[21:53:53] [Render thread/INFO] [en.si.co.SimpleConfigWrapper/]: Wrapped common config for mod Universal Sawmill (sawmill)
21:53:53.082
game
[21:53:53] [Render thread/INFO] [en.si.co.SimpleConfigWrapper/]: Wrapped server config for mod Universal Sawmill (sawmill)

And, there is a "special_recipe_costs" item on the Sawmill settings screen, and I can change the settings on the client side.
However, the server common settings button becomes dim and I cannot change the settings on the server side.

sawmill-common.toml

[general]
	#Sort recipes following cretive tab order. Could cause issue in the case when, for whatever reason, creative other would differ from server to client.Additionally Neoforge has a bug where this stuff won't work on servers. Use Forge instead!
	sort_recipes = true
	#Allow crafting non-block items
	allow_non_blocks = true
	#Allows crafting non wood variant items (crafting table for example)
	allow_non_variant = true
	#List of Mod ids you want to completely exclude from sawmill recipes. All recipes from these mods will be ignored. Use to remove mods with many recipes as sawmill can display at most 255 at onceFor more fine control use the sawmill:blacklist item tag
	mods_blacklist = ["framedblocks"]
	#Makes so planks recipes can only craft items with 1 input plank. Disable to allow more recipes
	limit_planks_input_to_one = true
	#Makes Sawmill GUI slightly wider
	wider_gui = true
	#Determines if GUI will have search bar or not. Automatic only enables the bar statically when you have enough mods that add wood recipes. Dynamic changes the gui dynamically depending on how many recipe its displaying
	#Allowed Values: OFF, ON, AUTOMATIC, DYNAMIC
	search_bar_mode = "AUTOMATIC"
	#At how many recipes the search bar should appear
	#Range: 0 ~ 200
	search_bar_threshold = 32
	#Maximum discount that sawmill will given when converting recipes. Unit is percentage of input item
	#Range: 0.0 ~ 1.0
	max_discount = 0.35

	#This is a map of wood object type to its cost in planks. Its used to add some discount to some special blocks.Change this if say you want all fences to cost 1 plank. Not all keys will work here bt you can try modded ones if you hae Every Compat
	[general.special_recipe_costs]
		stairs = 1.0

commented

When I tried version 1.0.8, no errors were output to the log, and I was able to edit server-side settings without any problems.
The warnings that were output in version 1.0.5 are also gone.

Thank you for taking the time to resolve this issue.
Please close this issue.

commented

I've just released a new fix on Curse Forge (1.0.8) that should resolve the error.
I've also archived the 1.0.6 and 1.0.7 releases to prevent people from downloading them unknowingly, in case wonder where they went.

I haven't investigated the warning you mentioned yet, though.

If you have the time to test it, I'd appreciate if you could confirm it works for you. ^^

commented

Oh wow, that was careless of me, it's a dist error.
This isn't caused by the sawmill mod nor (Neo)Forge, it's just a silly server-side crash caused by Simple Config alone, that I didn't notice before releasing 1.0.7.

The warning you describe on 1.0.5 might be a compatibility issue, however, but it should be constrained to that single entry. I'll also look into it.

Thanks for the report, it's very complete ^^
I'll try to fix the crash at least asap.
In the meantime, staying in 1.0.5 should avoid the crash (1.0.6 also had some issues) ๐Ÿ˜…

commented

After that, I used it for about half a month and there were no problems.
I will close this issue.