Vein Mining (Fabric/Forge/Quilt)

Vein Mining (Fabric/Forge/Quilt)

22M Downloads

[Bug]: Server config loading occasionally fails due to TOML format not being recognized by Night Config

Fuzss opened this issue ยท 0 comments

commented

Minecraft Version

1.19.2

What happened?

Hey there, there've been many crash logs with the following stack trace lately:


com.electronwill.nightconfig.core.file.NoFormatFoundException: No suitable format for veinmining-server.toml
	at com.electronwill.nightconfig.core.file.CommentedFileConfig.builder(CommentedFileConfig.java:218)
	at com.illusivesoulworks.spectrelib.config.SpectreConfigTracker.lambda$read$6(SpectreConfigTracker.java:181)
	at com.illusivesoulworks.spectrelib.config.SpectreConfigTracker.lambda$loadDefaultConfigs$2(SpectreConfigTracker.java:86)
	at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4780)
	at com.illusivesoulworks.spectrelib.config.SpectreConfigTracker.loadDefaultConfigs(SpectreConfigTracker.java:80)
	at com.illusivesoulworks.spectrelib.config.SpectreConfigEvents.onLoadDefault(SpectreConfigEvents.java:30)
	at com.illusivesoulworks.spectrelib.config.SpectreConfigEvents.onLoadDefaultAndLocal(SpectreConfigEvents.java:25)
	at com.illusivesoulworks.spectrelib.SpectreClientFabricMod.prepareConfigs(SpectreClientFabricMod.java:58)
	at net.minecraft.class_310.handler$ide000$spectrelib$init(class_310.java:35965)
	at net.minecraft.class_310.<init>(class_310.java:456)
	at net.minecraft.client.main.Main.method_44604(Main.java:205)
	at net.minecraft.client.main.Main.main(Main.java:51)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

I remember this issue in my Forge Config Api Port mod, too (not sure if it looked exactly like that, but it was also related to the toml format being invalid). I solved the issue by specifically setting to toml format instance when building a new CommentedFileConfig. There is a lengthy comment in my code explaining some things, maybe that helps.

https://github.com/Fuzss/forgeconfigapiport/blob/a821c58c0ea70b1a31228589e3d165fb5c549a71/Common/src/main/java/net/minecraftforge/fml/config/ConfigFileTypeHandler.java#L43

In your case that would be here:

https://github.com/illusivesoulworks/spectrelib/blob/a6f30e4ced7910985489c98dedc774079c7e0935/common/src/main/java/com/illusivesoulworks/spectrelib/config/SpectreConfigTracker.java#L181

Forge does something here related to the TomlFormat class, this missing on Fabric might be related to the issue:

https://github.com/MinecraftForge/MinecraftForge/blob/59ab01a55906cd2b5ff94b8a475add25cff27260/fmlloader/src/main/java/net/minecraftforge/fml/loading/FMLLoader.java#L123

How do you trigger this bug?

  1. Just load a world with vein mining installed, crash will happen rarely.

Loader

Fabric

Loader Version

fabric-loader-0.14.12-1.19.2

API Version

0.72.0+1.19.2

Mod Version

1.0.2+1.19.2

Relevant Log Outputs

https://cdn.discordapp.com/attachments/790272038047711242/1063913826254323742/crash-2023-01-15_04.02.34-client.txt

https://cdn.discordapp.com/attachments/841975353655951391/1063693510907285626/crash-2023-01-13_23.02.16-client.txt

https://cdn.discordapp.com/attachments/841975353655951391/1062611943619309598/crash-2023-01-10_23.59.32-client.txt