Describe the bug
Our application is currently running Rails 6.0.3.4 and sentry-ruby 4.0.1. When we try to update to Rails 6.1.0, almost all of our processes fail to start with what looks like a Sentry error:
rake aborted!
NoMethodError: undefined method `current_client' for nil:NilClass.
If we remove sentry-ruby the application and test processes (mostly started by rake) are able to start. The backtrace is longer with sentry-ruby 4.0.1 than 4.0.0, but it's the same exception. We're unable to run rake, or rspec.
To Reproduce
- Generate a Rails 6.1 app with
rails new proof_of_concept
- Add
gem "sentry-ruby", "4.0.1" to the Gemfile and run bundle install
- Run any Rake command such as
bundle exec rake routes or bundle exec rake notes`
Expected behavior
Rake tasks should be able to execute.
Actual behavior
An exception is raised.
Environment
- Ruby Version: 2.6.6
- SDK Version: 4.0.1
- Integration Versions (if any): sentry-rails 4.0.0, sentry-sidekiq 4.0.0. We are able to produce these exceptions without the integrations so we do not believe they are the cause
Raven Config
These exceptions occur with no further configuration, but here's our application's Sentry initializer:
Sentry.init do |config|
config.dsn = ENV["RAVEN_DSN"]
config.excluded_exceptions += [
"ActionController::RoutingError",
"ActionController::UnknownHttpMethod",
"Mime::Type::InvalidMimeType",
"Puma::HttpParserError",
"Sidekiq::Limiter::OverLimit",
"Rack::QueryParser::InvalidParameterError",
]
if ENV["SENTRY_ENVIRONMENT"] == "staging"
config.excluded_exceptions += ["PG::ConnectionBad", "PG::Error"]
end
config.environment = ENV["SENTRY_ENVIRONMENT"] ||
ENV["HEROKU_APP_NAME"] ||
ENV["RAILS_ENV"]
end
Describe the bug
Our application is currently running Rails 6.0.3.4 and sentry-ruby 4.0.1. When we try to update to Rails 6.1.0, almost all of our processes fail to start with what looks like a Sentry error:
If we remove
sentry-rubythe application and test processes (mostly started byrake) are able to start. The backtrace is longer with sentry-ruby 4.0.1 than 4.0.0, but it's the same exception. We're unable to runrake, orrspec.To Reproduce
rails new proof_of_conceptgem "sentry-ruby", "4.0.1"to the Gemfile and runbundle installbundle exec rake routesor bundle exec rake notes`Expected behavior
Rake tasks should be able to execute.
Actual behavior
An exception is raised.
Environment
Raven Config
These exceptions occur with no further configuration, but here's our application's Sentry initializer: