Skip to content

sentry-sidekiq throwing ActiveJob::SerializationError #1790

Closed
@modosc

Description

@modosc

Issue Description

same as #1585

we are seeing these entries in our logs (~3k in the last week):

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

i realize there's a theoretical solution here but somehow it's not working correctly.

    sentry-rails (5.2.1)
      sentry-ruby-core (~> 5.2.1)
    sentry-resque (5.2.1)
      sentry-ruby-core (~> 5.2.1)
    sentry-ruby (5.2.1)
      sentry-ruby-core (= 5.2.1)
    sentry-ruby-core (5.2.1)
    sentry-sidekiq (5.2.1)
      sentry-ruby-core (~> 5.2.1)

Reproduction Steps

we don't have a reproducible case - this is a private company's repo.

Expected Behavior

sending errors should work

Actual Behavior

we are losing errors.

Ruby Version

3.1.1

SDK Version

5.2.1

Integration and Its Version

No response

Sentry Config

# frozen_string_literal: true

Sentry.init do |config|
  config.dsn = Rails.application.secrets[:sentry_dsn]

  config.breadcrumbs_logger = %i[active_support_logger http_logger]

  # Send messages async to prevent blocking in application and keep tolerance if Sentry
  # has an outage.
  config.async = ->(event, hint) { Sentry::SendEventJob.perform_later(event, hint) }

  # Filter out protected data
  filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)
  config.before_send = ->(event, hint) { filter.filter(event.to_hash) }

  config.excluded_exceptions += [
    "ActionController::RoutingError",
    "ActiveRecord::RecordNotFound",
    "RedisLock::AlreadyLocked", # These are very high volume and we just need to suppress for now
  ]

  config.release = ENV["SOURCE_COMMIT"]
  config.environment = ENV["SENTRY_ENV"] || Rails.env
end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions