Skip to content
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

Problem in configuration elastic search #935

Closed
MarcVanHelvoort opened this issue Mar 10, 2022 · 1 comment · Fixed by #946
Closed

Problem in configuration elastic search #935

MarcVanHelvoort opened this issue Mar 10, 2022 · 1 comment · Fixed by #946
Labels

Comments

@MarcVanHelvoort
Copy link

MarcVanHelvoort commented Mar 10, 2022

We were facing a problem in the configuration of elastic apm agent.

2022-03-09T09:04:14.962+0000 [STG/0] ERR [Buildpack]                      DEBUG Exception #<TypeError: no implicit conversion of false into String> backtrace:
2022-03-09T09:04:14.962+0000 [STG/0] ERR /tmp/buildpacks/cb8d06fb5e35c981bb5f5b7fbe21eff3/lib/java_buildpack/framework/elastic_apm_agent.rb:93:in `block in write_java_opts'
2022-03-09T09:04:14.962+0000 [STG/0] ERR /tmp/buildpacks/cb8d06fb5e35c981bb5f5b7fbe21eff3/lib/java_buildpack/framework/elastic_apm_agent.rb:92:in `each'
2022-03-09T09:04:14.962+0000 [STG/0] ERR /tmp/buildpacks/cb8d06fb5e35c981bb5f5b7fbe21eff3/lib/java_buildpack/framework/elastic_apm_agent.rb:92:in `write_java_opts'
2022-03-09T09:04:14.962+0000 [STG/0] ERR /tmp/buildpacks/cb8d06fb5e35c981bb5f5b7fbe21eff3/lib/java_buildpack/framework/elastic_apm_agent.rb:51:in `release'
2022-03-09T09:04:14.962+0000 [STG/0] ERR /tmp/buildpacks/cb8d06fb5e35c981bb5f5b7fbe21eff3/lib/java_buildpack/buildpack.rb:97:in `map'
2022-03-09T09:04:14.962+0000 [STG/0] ERR /tmp/buildpacks/cb8d06fb5e35c981bb5f5b7fbe21eff3/lib/java_buildpack/buildpack.rb:97:in `release'
2022-03-09T09:04:14.962+0000 [STG/0] ERR /tmp/buildpacks/cb8d06fb5e35c981bb5f5b7fbe21eff3/lib/java_buildpack/buildpack.rb:278:in `with_buildpack'

We saw this issue was caused by some booleans in our configuration
{ .... "central_config": false, .... }

This result in a error in this line (/elastic_apm_agent.rb:93 ):
if /$[({][^\)\}]+[)}]/ =~ value

So it tries to match a regex to a boolean and this results in an error.

We have updated our configuration by putting the values to
"central_config": "false",

And this is accepted, so our problem is solved.

But is would be nice if this issue will be fixed. I assume the line would be something like

if /$[({][^\)\}]+[)}]/ =~ false.to_s

But I'm not very familiar in ruby so I don't know if this can cause kind of nullpointers or something. That's the reason I raised this issue instead of creating a PR.

@dmikusa dmikusa added the bug label Mar 10, 2022
@dmikusa
Copy link
Contributor

dmikusa commented Mar 10, 2022

Thanks for letting us know. It sounds like we should have enough to reproduce with some unit tests. We'll get this patched up so it accepts both false or "false".

dmikusa pushed a commit that referenced this issue May 11, 2022
Resolves #935

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
dmikusa pushed a commit that referenced this issue May 11, 2022
Resolves #935

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants