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

Implicit dependency of sentry-rails in sentry-resque #1541

Closed
adi-pen opened this issue Aug 18, 2021 · 3 comments · Fixed by #1544
Closed

Implicit dependency of sentry-rails in sentry-resque #1541

adi-pen opened this issue Aug 18, 2021 · 3 comments · Fixed by #1544
Assignees
Projects
Milestone

Comments

@adi-pen
Copy link

adi-pen commented Aug 18, 2021

Describe the bug

Sentry.configuration.rails.skippable_job_adapters << "ActiveJob::QueueAdapters::ResqueAdapter"

This line in sentry-resque results in undefined method `rails' for #<Sentry::Configuration:* in rails applications that do not use sentry-rails.

To Reproduce

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org' do
    gem 'rails'
    gem 'sentry-resque'
    # gem 'sentry-rails'
  end
end

require "resque"
require "sentry-resque"

require "rails"
require "action_dispatch"

class TestApp < Rails::Application
  Sentry.init do |config|
    config.breadcrumbs_logger = [:sentry_logger]
    config.dsn = 'https://aaaa@xxxx.ingest.sentry.io/123456'
  end
end

TestApp.initialize!

Expected behavior

It should not result in NoMethodError.

Actual behavior

undefined method `rails' for #<Sentry::Configuration:0x00007f9397b2ae08> (NoMethodError)
@st0012
Copy link
Collaborator

st0012 commented Aug 19, 2021

@adi-pen just curious, why do you use sentry-resque to integrate Sentry with your Resque but not sentry-rails for your Rails app?

@adi-pen
Copy link
Author

adi-pen commented Aug 19, 2021

@st0012 We switched from resque-sentry to sentry-resque and ran into this NoMethodError. The existing logic within the rails app is acting as a substitute for sentry-rails at the moment and it'll change in the near future.

@st0012
Copy link
Collaborator

st0012 commented Aug 19, 2021

ah I see. thanks for explaining 👍
I’ll fix it 🙂

@st0012 st0012 added this to To do in 4.x via automation Aug 20, 2021
@st0012 st0012 added this to the 4.7.0 milestone Aug 20, 2021
@st0012 st0012 self-assigned this Aug 20, 2021
4.x automation moved this from To do to Done Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4.x
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants