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

sentry-sidekiq throwing ActiveJob::SerializationError in v4.7.3 #1585

Closed
earnold opened this issue Sep 28, 2021 · 2 comments
Closed

sentry-sidekiq throwing ActiveJob::SerializationError in v4.7.3 #1585

earnold opened this issue Sep 28, 2021 · 2 comments
Assignees
Projects

Comments

@earnold
Copy link

earnold commented Sep 28, 2021

Issue Description

Hi there,

Since upgrading to the latest version of sentry-sidekiq gem, I'm getting numerous errors like this in my logs:

[ActiveJob] Failed enqueuing Sentry::SendEventJob to Sidekiq(default): ActiveJob::SerializationError (Can't serialize a Hash with reserved key "_aj_globalid")

Is this something I should be worried about? At a minimum, I'd like to clean it up from my logs.

Reproduction Steps

Use rails & active job & sidekiq & sentry.

Expected Behavior

There shouldn't be errors with normal usage.

Actual Behavior

Lots of errors in my logs.

Ruby Version

3.0.2

SDK Version

sentry-sidekiq (4.7.3)

Integration and Its Version

Rails/Sidekiq

Sentry Config

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.1

  config.async = lambda do |event, hint|
    Sentry::SendEventJob.perform_later(event, hint)
  end

  config.backtrace_cleanup_callback = lambda do |backtrace|
    Rails.backtrace_cleaner.clean(backtrace)
  end

  config.breadcrumbs_logger = [:active_support_logger, :http_logger]

  config.environment = Rails.env

  # this uses Rails' parameter filter to sanitize the event payload
  filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)
  config.before_send = lambda do |event, _hint|
    filter.filter(event.to_hash)
  end
end
@kamilogorek kamilogorek changed the title Bug: sentry-sidekiq throwing ActiveJob::SerializationError in v4.7.3 Sep 29, 2021
@st0012
Copy link
Collaborator

st0012 commented Oct 1, 2021

@earnold I'm not sure what could cause this because sentry-sidekiq should already filter the _aj_globalid key:

context_filter = Sentry::Sidekiq::ContextFilter.new(context)

can you provide an example app that can reproduce the problem? it'll help me debug this issue.

an unrelated note: we don't recommend using the async option anymore and I suggest you to remove it because it could more harm than good to your app. you can find the full explanation here: #1522

@st0012 st0012 added this to To do in 4.x via automation Oct 1, 2021
@github-actions
Copy link

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 label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


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

@github-actions github-actions bot closed this as completed Nov 4, 2021
4.x automation moved this from To do to Done Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4.x
  
Done
Development

No branches or pull requests

2 participants