ServerCore

ServerCore

7M Downloads

Config is reset on restart

Labotomy opened this issue · 8 comments

commented

When you restart the server after editing the config file, the config is reset to default values.

Reproduce
Add to mods folder, generate config file by starting the server, (stopping the server is optional) edit the config file, save the file, restart the server.

Expected behavior
Expect the changed config file to use and retain it's edited values.

Versions -Latest is not a version!
ServerCore: 1.2.8
Minecraft: 1.18.1

commented

It can only edit specific config entries on startup if they turn out to be invalid.
It prints an error in the log aswell though, but the alternative would be a server crash.

And if I did it the other way around people would complain that the ingame configs don't save ¯_(ツ)_/¯

Otherwise you could just edit the config whilst the server isn't running, that way it'll work as long as the filled in entries are valid.

commented

What a hassle, will try running the commands from the console.
The behavior has happened whether the config is edited while the server is stopped or not.

There is no one in game to run the commands.

commented

I did edit the config while the server was not running, it still overwrote them with defaults.

commented

Well, if you ever do run into this problem again, could you send the config file over before it is overwritten?
I haven't been able to reproduce that on my end, so its most likely something with the config file itself that isn't correctly formatted.

commented

servercore.txt

Had to change the extension since github wouldn't allow it to attach. I suspect it has to do more with fabric than the config.

commented

Just tried running that (with .toml extension ofc), but no values were changed back to default. I'm not sure if anything else might be causing it, but that would be pretty unlikely. (on the version you listed - although I haven't seen this issue in any other version either)

commented

ServerCore saves the config file when the server shuts down, based on entries that were running on the server itself.
When you change entries in the config file, it doesn't immediately change entries on the actual server.

There's 2 commands that handle this:

  • /servercore config reload -> takes all values from the actual config file, and puts them running on the server.
  • /servercore config save -> takes all values from the server, and saves them to the config file.

I assume you were most likely changing the config file without actually synchronizing these values on the server.
Which would indeed make it override those changes as server shutdown essentially does the same as /sc config save.

On that note, you can also use /sc config ...etc to change all your config entries ingame - which also won't need any synchronization.

commented

Manually running the command mitigates the issue.