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

Check Rails.backtrace_cleaner method exists #734

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

tombruijn
Copy link
Member

Check if the Rails.backtrace_cleaner method exists before calling it.
We've got a report from a user that the method call fails with a
NoMethodError in a Sinatra app using the activesupport and actionmailer
gems version 5.2.0.

NoMethodError - undefined method `backtrace_cleaner' for Rails:Module:
/gems/appsignal-3.0.6/lib/appsignal/transaction.rb:530:in `cleaned_backtrace'

I was unable to reproduce in the test setups, but I can see a scenario
where this could fail. To make sure we don't cause this kind of error in
such a scenario, check if the Rails module listens to the
backtrace_cleaner method before calling it.

appsignal/test-setups@d484b36

Check if the Rails.backtrace_cleaner method exists before calling it.
We've got a report from a user that the method call fails with a
NoMethodError in a Sinatra app using the activesupport and actionmailer
gems version 5.2.0.

```
NoMethodError - undefined method `backtrace_cleaner' for Rails:Module:
/gems/appsignal-3.0.6/lib/appsignal/transaction.rb:530:in `cleaned_backtrace'
```

I was unable to reproduce in the test setups, but I can see a scenario
where this could fail. To make sure we don't cause this kind of error in
such a scenario, check if the Rails module listens to the
`backtrace_cleaner` method before calling it.

appsignal/test-setups@d484b36
@tombruijn tombruijn added the bug label Jun 22, 2021
@tombruijn tombruijn self-assigned this Jun 22, 2021
@tombruijn tombruijn marked this pull request as ready for review June 22, 2021 14:56
@backlog-helper
Copy link

While performing the daily checks some issues were found with this Pull Request.


New issue guide | Backlog management | Rules | Feedback

@tombruijn tombruijn merged commit 44dd4bd into main Jun 23, 2021
@tombruijn tombruijn deleted the defensive-backtrace-cleaner branch July 31, 2023 09:30
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 this pull request may close these issues.

2 participants