Skip to content

sentry + eager_load breaks ActiveJob rescue_from #1249

@CroneKorkN

Description

@CroneKorkN

Describe the bug

Sentry eats errors in Jobs. They return nil instead.

To Reproduce

Expected behavior

This line should never be executed because the line before it throws an error: https://github.com/CroneKorkN/sentry_broken_with_eager_load/blob/master/app/jobs/error_job.rb#L4

You should not see >>> I SHOULD NEVER BE EXECUTED! (NilClass)

Actual behavior

The line is executed because block.call returns nil.

You see >>> I SHOULD NEVER BE EXECUTED! (NilClass)

Environment

  • Ruby Version: 2.7.1
  • Sentry-Rails: 4.1.6
  • Rails: 6.1.0

Raven Config

https://github.com/CroneKorkN/sentry_broken_with_eager_load/blob/master/config/initializers/sentry.rb

Test Repo

On this commit, the error occurs: https://github.com/CroneKorkN/sentry_broken_with_eager_load/tree/0734f3648f9687c27f3f8ea505b1b26f5975cd97
This commit fixes it by disabling eager_load: https://github.com/CroneKorkN/sentry_broken_with_eager_load/tree/ddf2e41ebee1b31afb5c533601048ae740bb00f6

Removing the sentry-rails gem obviously also fixes it.

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions