You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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')
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.
If the IgnoreCommas were supported and enabled, would there still be an option to configure lists or would it be an either or configuration decision?
I am not aware of other ways to configure a list from env var other than this.
Either FOO="['foo',1]" or FOO="'foo',1" will cause
apm-server:
host: :8200
output.elasticsearch:
username: user
password: "${FOO}"
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.
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: