Describe the bug
In a sidekiq job, I'm getting an error at gems/sentry-rails-4.6.5/app/jobs/sentry/send_event_job.rb:26:in:
In perform, Sentry.get_current_scope must be returning nil, resulting in:
NoMethodError: undefined method 'span' for nil:NilClass
Environment
- Ruby Version: 2.7.4p191
- SDK Version: 4.6.5
- Integration Versions (if any):
- e.g. Rails 6.1.4, Sidekiq 6.2.1
Sentry Config
This is not necessary but could be helpful.
dsn is actually not set, as I don't have SENTRY_DSN setup in my env.
Sentry.init do |config|
config.dsn = ENV["SENTRY_DSN"]
config.breadcrumbs_logger = [:active_support_logger, :http_logger]
# Set tracesSampleRate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production
config.traces_sample_rate = 0.5
filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)
config.before_send = lambda do |event, hint|
filter.filter(event.to_hash)
end
config.async = lambda do |event, hint|
Sentry::SendEventJob.perform_later(event, hint)
end
end
end
Describe the bug
In a sidekiq job, I'm getting an error at
gems/sentry-rails-4.6.5/app/jobs/sentry/send_event_job.rb:26:in:In perform,
Sentry.get_current_scopemust be returning nil, resulting in:NoMethodError: undefined method 'span' for nil:NilClassEnvironment
Sentry Config
This is not necessary but could be helpful.
dsn is actually not set, as I don't have SENTRY_DSN setup in my env.