Config overwritten on each server reboot
ClaudiusMinimus opened this issue ยท 15 comments
Ugh, I thought this would have been fixed by the new configuration library.
By the way, I'd recommend leaving it on 15 unless you have a good reason to otherwise.
Can you send me a log for when the server starts up?
EDIT: I wonder if TheElectronWill/night-config#67 has something to do with this.
I think I've figured it out: NightConfig doesn't like UTF-8 with BOM with LF line endings. This will be fixed in the next update; let me know if it works. ๐
Hey! Just tested latest release and the issue still persists on my fabric server:/ here's my latest.log, just in case its usefull for you! https://pastebin.com/fFMpjw98
Damn, can you try modifying the config, uploading it to the server, downloading it again and then sending the config file to me without launching the server? I just want to check the encoding and line endings.
Hi, this happens in fabric latest randompatches version too, though difference is it deletes everything but two lines of text: "RandomPatches configuration.
All configuration options not under [client] are server-sided unless otherwise stated."
So it is required to replace server config file every restart to sync with client config correctly
Okay...I tried something : I deleted the config file to see if the server would generate it correctly after restart and it did . Config file was all correct and complete after I let it regerenate itself after one restart. But then I restarted again and it messed up and only showed those two lines I mentioned on my previous comment (all of this has nothing to do with the file above)
Yes, sure. Here it is:
randompatches.zip
Can you try this debug version I've just built? Send me the resulting log and the numerous files it creates in the server directory.
randompatches-2.1.4-fabric.jar.zip
Sure. Here they are:
latestlog+configfile.zip
I'm genuinely stumped. Can you confirm that this doesn't occur on the client and that this occurs even when no other mod is installed on the server?
Okay I deleted every mod but Fabric API and suddenly it was working well. No overrides nor anything happening. But the issue doesnt happen at all on the client, thats another thing...so its a server side mod, Im guessing? any idea which one?:/
Edit: Nevermind. I tried randompatches 2.1.3 without mods and the issue persisted. I didnt realize because it happens when I make changes to the config file. With version 2.1.3 it deletes the whole file, but with version 2.1.4 it only deletes what I edited, leaving the default value. Here are some files I forgot to add:
debugfiles.zip
I believe I've figured out the issue. Because NightConfig doesn't support top-level configuration comments, I've been manually adding them after the configuration flie is saved (this seems to be the easiest way to do this). However, it turns out that the save operation is asynchronous by default (I'm not sure why this problem was only occurring server-side and only for certain people), so my configuration library wrapper wrapper (๐) thinks the save operation has completed before it actually has, and tries to add the top-level configuration comments to an empty string. Thank you @shouxd for helping with this one! ๐
Anyway, let me know if the next update fixes this.
I've been testing a while reseting the server and it works wonders now for me. Thank you a lot for your patience and quick acting!:)