panel
panel copied to clipboard
YAML Configuration Files are broken when starting the server
Current Behavior
I have these values in the config file:
After starting the server the config values y and n are replaced with "true" and "false" like shown here:
Expected Behavior
The keys of the YAML config are not replaced with true and false
Steps to Reproduce
I used this egg when I noticed this issue.
Steps:
- Import the egg
- Install a server using the NanoLimbo egg
- Start the server and edit the config
- The config key "spawnPosition.y" has been replaced with "spawnPosition."true"" (The n option was added by me)
Panel Version
1.9.2
Wings Version
1.6.4
Games and/or Eggs Affected
https://github.com/parkervcp/eggs/blob/master/game_eggs/minecraft/java/nanolimbo/egg-nano-limbo.json
Docker Image
No response
Error Logs
No response
Is there an existing issue for this?
- [X] I have searched the existing issues before opening this issue.
- [X] I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
- [X] I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.
I have the same issue with NanoLimbo's config file in Panel version 1.10.1 and Wings version 1.7.0
After some quick digging around, I found out that if I change the Configuration Files section of NanoLimbo's egg from:
{
"settings.yml": {
"parser": "yaml",
"find": {
"bind.ip": "0.0.0.0",
"bind.port": "{{server.build.default.port}}"
}
}
}
to an empty object, the configured keys in settings.yml
stay the same, which solves the problem.
While this solution works, the binding port is not automatically updated after install, and need to be changed manually.
i think, this is not really a panel issue, when an plugin dont work correct
This is probably similar to the other issues we have with YML files where the parser sometimes turns numbers into scientific notation. @parkervcp can probably confirm, but that is what this looks like. y
/n
/true
/false
are all the same in YML and it gets messy.
@DaneEveritt This looks like it's updating the keys which it shouldn't be doing. The issues we are normally seeing are when it updates values.
This is a significantly worse bug.
Either way its an issue with the library, I can see if there are tweaks but I'm not holding out much hope.
YAML is a disaster.
I can look into the yaml encoding. I have played around in it enough.
My guess is that it's here - https://github.com/pterodactyl/wings/blob/develop/parser/helpers.go#L100
Even though it's a key it's a value under the top level key and that may be the cause.
Poking around a bit more I have narrowed it down to the unmarshal from the yaml package.
https://github.com/pterodactyl/wings/blob/develop/parser/parser.go#L421
The way we are parsing it is with the map[string]interface{}
where the string spawnPosition.y
is getting parsed as spawnPosition."true"
The interface is parsing the y
as a boolean even though it's a string.
Upgrading to gopkg.in/yaml.v3
appears to fix this.