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

Ruby 3.4 Support: Errors and their output may be different #2902

Closed
kaylareopelle opened this issue Oct 8, 2024 · 3 comments · Fixed by #2993
Closed

Ruby 3.4 Support: Errors and their output may be different #2902

kaylareopelle opened this issue Oct 8, 2024 · 3 comments · Fixed by #2993
Assignees
Labels

Comments

@kaylareopelle
Copy link
Contributor

kaylareopelle commented Oct 8, 2024

In the config_file_loading multiverse suite, the test test_warning_logged_when_config_file_erb_error fails because the file name and line number are no longer included in the error output. In addition, the error class has also changed.

Ruby 3.3.1:

** [NewRelic] FATAL : Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.
** [NewRelic] FATAL : (erb):4: syntax error, unexpected local variable or method, expecting '('
; _erbout.<<(( this is not ruby ).to_s); _erbout

Ruby 3.4.0-preview2:

[2024-10-08 16:38:39 -0700 C02F23LMMD6P (16577)] ERROR : Failed ERB processing configuration file. This is typically caused by a Ruby error in <% %> templating blocks in your newrelic.yml file.
[2024-10-08 16:38:39 -0700 C02F23LMMD6P (16577)] ERROR : NameError: undefined local variable or method 'ruby' for an instance of NewRelic::Agent::Configuration::YamlSource

In addition to fixing the test, we may want to take a closer look at our New Relic agent log error output and errors inbox behavior to see if there are unintended changes that might compromise the customer's experience.

The config_file_loading suite is currently disabled for Ruby 3.4.0-preview2. It will need to be manually re-enabled for testing.

@workato-integration
Copy link

@kaylareopelle kaylareopelle added oct-dec qtr Possible FY Q3 candidate core technology labels Oct 8, 2024
@kaylareopelle kaylareopelle moved this from Triage to In Quarter in Ruby Engineering Board Oct 8, 2024
@kaylareopelle kaylareopelle moved this from In Quarter to Triage in Ruby Engineering Board Oct 8, 2024
@kford-newrelic kford-newrelic moved this from Triage to In Quarter in Ruby Engineering Board Oct 9, 2024
@kaylareopelle kaylareopelle self-assigned this Nov 25, 2024
@kaylareopelle
Copy link
Contributor Author

After spending some time looking into this, it seems like the thread profiler is likely the most impacted class as a result of this change. The thread profiler uses the BacktraceNode class that has a regex that expects the `word' format for parsing the backtrace.

However, more work needs to be done to look at the diff between old and new errors galore playground responses
I would also like to go through more of the places where we have single backticks in the code and tests to see if there are other places that may be impacted


Areas in tests where `\w+' hard coded:

  • thread profile test
    • only class that uses backtrace node
    • trace example should be conditionally set based on Ruby 3.4+
  • backtrace node test
    • test hard coded with `word'
    • the parse_backtrace_frame method within the backtrace node class looks specifically for the `word'
  • agent thread test
    • conditionally set the trace based on Ruby 3.4+
  • stats hash test
    • stubbed error message condition for Ruby 3.4+
  • http client test cases
    • conditionally stubbed error raised for Ruby 3.4+
  • aws sdk lambda instrumentation test
    • add alternate backtrace for Ruby 3.4+
  • strip_exception_messages list
    • may no longer be accurate with the new message format
  • closer look at NoticedError class
    • Can it still break down the 3.4 errors?

Surprising errors galore error:

can't modify frozen Hash: {"error.message" => "Failed to open TCP connection to localhost:666 (Connection refused - connect(2) for \"localhost\" port 666)", "error.class" => "Errno::ECONNREFUSED"}

http://localhost:3000/scenarios/external_request_nonexistent_result
(does this still happen on earlier versions of Ruby?)

@kaylareopelle
Copy link
Contributor Author

kaylareopelle commented Dec 11, 2024

For the spike/discovery side of this ticket, I've created two new issues with the work to provide support for the Ruby 3.4 backtrace syntax:

#2992 should be finished before December 25, but it is currently blocked by bugs in the Thread Profiling UI.
#2990 should be completed within the 90-day SLA of Ruby 3.4's release.

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

Successfully merging a pull request may close this issue.

3 participants