-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WriteConfigFile incorrectly marshals the IndexEvents field. #10016
Comments
Thanks for the bug report @dwedul-figure. Since the default is Just to clarify, you're stating this issue exists when the default |
The problem comes up any time a |
Based off some comparisons with Tendermint's stuff in Change this line in the template:
to
I think you might need to update the
to this:
Keep an eye on |
@dwedul-figure would you be open to making a PR? |
Sure thing! Coming up! |
The PR has been submitted: #10067. I haven't checked off the https://github.com/cosmos/cosmos-sdk/actions/runs/1195217037
Other than that, though, I think it's good to go. |
Summary of Bug
The
github.com/cosmos/cosmos-sdk/server/config
WriteConfigFile(configFilePath, config)
function improperly marshalls theConfig.IndexEvents
field. The result resembles the output offmt.Printf("%v", []string{...})
.This then causes the config file to be unreadable using
viper.ReadInConfig
. Error:While parsing config: (61, 17): no value can start with k
. In this case, 'k' is the first character in the first key I had set.What it writes:
index-events = [key1 key2]
What it should write
index-events = ["key1", "key2"]
Manually updating the file to the corrected format allows the file to be readable again.
Version
v0.43.0
Steps to Reproduce
DefaultConfig()
).[]string{"key1", "key2"}
.WriteConfigFile(configFilePath, config)
to save the config to a file.viper.ReadInConfig()
.Expected result: The config file is read and parsed by viper.
Actual result: Viper returns an error:
While parsing config: (61, 17): no value can start with k
Here's a unit test:
Test result:
For Admin Use
The text was updated successfully, but these errors were encountered: