-
Notifications
You must be signed in to change notification settings - Fork 529
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
Special characters in env var used in config causes error "can not convert 'object' into 'string' accessing" #13893
Comments
If the @carsonip I changed the label from |
I am not aware of other ways to configure a list from env var other than this. Either
output.elasticsearch.password to be a list. The argument still stands - this complex object parsing behavior is going to catch unsuspecting users off guard, but setting IgnoreCommas by default would remove the ability to configure lists. |
@axw do you have an opinion on whether this is worth a change in |
I'm inclined to close it as WONTFIX:
|
++ on closing this as I don't think the fix would lead to global improvements. @carsonip any objections or concerns? |
++, closing it as WONTFIX. |
If an env var is used in apm-server.yml, and that the env var contains certain special characters, it may cause an error during parsing, e.g.
Error: error unpacking output.elasticsearch for fetching agent config: can not convert 'object' into 'string' accessing 'output.elasticsearch.password' (source:'apm-server.yml')
To reproduce, run test:
Test output:
This is actually as a feature such that env var could provide lists, see docs, but it is surprising to users who expect this setup to work, until the env var contains certain characters, e.g. a comma in a randomly generated password to set
output.elasticsearch.password
.go-ucfg added an
IgnoreCommas
config to opt-out of this behavior, and Elastic Agent already uses it. However, adopting this by default would be a breaking change for users who rely on this parsing behavior.Related issue in beats: elastic/beats#22460
The text was updated successfully, but these errors were encountered: