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

FrozenError on Ruby 3.0.0 #922

Closed
TeroPihlaja opened this issue Dec 31, 2020 · 3 comments
Closed

FrozenError on Ruby 3.0.0 #922

TeroPihlaja opened this issue Dec 31, 2020 · 3 comments

Comments

@TeroPihlaja
Copy link

Describe the bug

FrozenError: can't modify frozen String: "" when starting Elastic APM with Ruby 3.0.0

Steps to reproduce

  1. Create a project with Ruby 3.0.0 and install Elastic APM.
  2. Start
  3. On agent startup the following error is generated:
[ElasticAPM] Couldn't establish connection to APM Server:
"#<FrozenError: can't modify frozen String: \"\">"

I patched a backtrace logging to see where it comes from:

[
"/usr/local/rvm/gems/ruby-3.0.0/gems/http-3.3.0/lib/http/response/body.rb:52:in `force_encoding'",
"/usr/local/rvm/gems/ruby-3.0.0/gems/http-3.3.0/lib/http/response/body.rb:52:in `to_s'",
"/usr/local/rvm/gems/ruby-3.0.0/gems/http-3.3.0/lib/http/response.rb:92:in `flush'",
"/usr/local/rvm/gems/ruby-3.0.0/gems/elastic-apm-3.13.0/lib/elastic_apm/transport/connection/http.rb:63:in `request'",
"/usr/local/rvm/gems/ruby-3.0.0/gems/elastic-apm-3.13.0/lib/elastic_apm/transport/connection/http.rb:49:in `post'",
"/usr/local/rvm/gems/ruby-3.0.0/gems/elastic-apm-3.13.0/lib/elastic_apm/transport/connection/http.rb:109:in `block in open_request_in_thread'",
"/usr/local/rvm/gems/ruby-3.0.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'"
]

Expected behavior

Elastic APM starts properly and reports to server

Environment

  • OS: Linux
  • Ruby version: 3.0.0-p0
  • Framework and version: Rails 6.1.0
  • Agent version: 3.13.0

Additional context

I also created the following issue to http gem: httprb/http#640

@TeroPihlaja
Copy link
Author

Looks like I had another dependency pulling in older http gem. Updating to http gem version 4.4.1 seemed to fix this issue.

@mikker
Copy link
Contributor

mikker commented Jan 3, 2021

Was going to suggest that, good that you figured it out on your own 😊 Di you come across anything else ElasticAPM related with the upgrade?

@TeroPihlaja
Copy link
Author

TeroPihlaja commented Jan 4, 2021

Was going to suggest that, good that you figured it out on your own 😊 Di you come across anything else ElasticAPM related with the upgrade?

At least not yet. I did discover some other issues that need more investigation first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants