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
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.initdo |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 productionconfig.traces_sample_rate=0.5filter=ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)config.before_send=lambdado |event,hint|
filter.filter(event.to_hash)endconfig.async=lambdado |event,hint|
Sentry::SendEventJob.perform_later(event,hint)endendend
The text was updated successfully, but these errors were encountered:
Providing config.dsn with the actual DSN resolved this error. Perhaps jobs shouldn't attempt to be performed if the DSN is not set, and/or a better error message is surfaced?
It looks like you have the SDK enabled in one part of your app (perhaps the Rails app?) but disabled for your worker.
Or you once enabled both of them but left unprocessed Sentry::SendEventJob before restarted the worker without DSN.
Either way, I think this exception should not happen so I'll fix it. Thanks for reporting this 👍
A slightly related suggestion: the async options is no longer recommended. If you're a new user of Sentry, I'd suggest not using it unless you find it necessary for a reason. I've detailed the reason in #1522
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
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.
The text was updated successfully, but these errors were encountered: