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
After upgrading to ruby 3.4.1, APM shows a validation error when attempting to report errors.
Steps to reproduce
Install ruby 3.4.1
Configure APM
Run the following code:
ElasticAPM.start(logger: ActiveSupport::Logger.new($stdout),log_level: Logger::DEBUG)beginputs"Commence dividing by zero"1 / 0rescueException=>eputs"Reporting error"ElasticAPM.report(e)end
After a few seconds, we see the following output:
[ElasticAPM] [THREAD:14736]: Closing request with reason scheduled_flush
[ElasticAPM] APM Server responded with an error:
"{\"accepted\":2,\"errors\":[{\"message\":\"validation error: error: exception: stacktrace: requires at least one of the fields 'classname;filename'\",\"document\":\"{\\\"error\\\":{\\\"id\\\":\\\"[key here]\\\",\\\"transaction_id\\\":null,\\\"transaction\\\":null,\\\"trace_id\\\":null,\\\"parent_id\\\":null,\\\"culprit\\\":null,\\\"timestamp\\\":1735577232664940,\\\"exception\\\":{\\\"message\\\":\\\"divided by 0\\\",\\\"type\\\":\\\"ZeroDivisionError\\\",\\\"module\\\":\\\"\\\",\\\"code\\\":null,\\\"attributes\\\":null,\\\"stacktrace\\\":[{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false},{\\\"abs_path\\\":null,\\\"filename\\\":null,\\\"function\\\":null,\\\"lineno\\\":0,\\\"library_frame\\\":false}],\\\"handled\\\":true,\\\"cause\\\":null}}}\"}]}\n"
Expected behavior
The error should be reported to APM.
Environment
OS: Debian 12
Ruby version: 3.4.1
Framework and version: Rails 8.0.1
APM Server version: Not sure
Agent version: 4.7.3
Additional context
This issue can be resolved by rolling back to ruby 3.3.6 and keeping everything else the same.
Ruby 3.4 changed the format of error stack traces in a few ways. I have not dug into the code here yet, but I wonder if that could be related. See "Compatibility issues" here.
The text was updated successfully, but these errors were encountered:
Describe the bug
After upgrading to ruby 3.4.1, APM shows a validation error when attempting to report errors.
Steps to reproduce
After a few seconds, we see the following output:
Expected behavior
The error should be reported to APM.
Environment
Additional context
This issue can be resolved by rolling back to ruby 3.3.6 and keeping everything else the same.
Ruby 3.4 changed the format of error stack traces in a few ways. I have not dug into the code here yet, but I wonder if that could be related. See "Compatibility issues" here.
The text was updated successfully, but these errors were encountered: