getsentry / sentry-ruby

Sentry SDK for Ruby
https://sentry.io/for/ruby
MIT License
927 stars 493 forks source link

Sentry ruby 5.17.0 having issue with railties-7.1.3.2 #2285

Closed nishant-vagh closed 3 months ago

nishant-vagh commented 5 months ago

Issue Description

Request that are processed correctly with 200 status code are converted to 500 because of incompatibility of 5.17.0

Reproduction Steps

Gemfile.lock rails (7.1.3.2) actioncable (= 7.1.3.2) actionmailbox (= 7.1.3.2) actionmailer (= 7.1.3.2) actionpack (= 7.1.3.2) actiontext (= 7.1.3.2) actionview (= 7.1.3.2) activejob (= 7.1.3.2) activemodel (= 7.1.3.2) activerecord (= 7.1.3.2) activestorage (= 7.1.3.2) activesupport (= 7.1.3.2) bundler (>= 1.15.0) railties (= 7.1.3.2) sentry-rails (5.17.0) railties (>= 5.0) sentry-ruby (~> 5.17.0) sentry-ruby (5.17.0)

Start rails server and hit any request. The request will always return 500. Rails console will show the result as 200 but still browser will show as 500 (Internal Server Error)

Expected Behavior

All API results should be 200 and sentry should not make it 500.

Actual Behavior

The API requests are return 500 even though rails console show 200 as processed request. Issue is only with 5.17.0. Everything is working perfect with 5.16.1

Ruby Version

3.2.2

SDK Version

5.17.0

Integration and Its Version

Rails - 7.1.3.2

Sentry Config

Sentry.init do |config| config.dsn = Rails.application.credentials[:sentry_dsn] config.breadcrumbs_logger = [:active_support_logger, :http_logger] config.enabled_environments = ['production', 'dev']

filter_parameters = Rails.application.config.filter_parameters + [:password, :authorization] config.before_send = lambda do |event, hint|

Iterate over the event hash and filter parameters

event_hash = event.to_hash
event_hash.transform_values! do |value|
  if value.is_a?(Hash)
    value.transform_keys! { |key| filter_parameters.include?(key.to_sym) ? "FILTERED" : key }
  end
  value
end

event_hash  # Return the filtered event hash

end

config.traces_sample_rate = 0.1 end

st0012 commented 5 months ago

We fixed an issue in 5.17.1, can you let us know if that resolves the issue?

getsantry[bot] commented 3 months ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

nishant-vagh commented 3 months ago

I don't have access to code base on which I was working. I used earlier version i.e. 5.16.1.