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

Trouble initializing Sentry (undefined method `debug' for nil:NilClass) #1386

Closed
brooksco opened this issue Apr 5, 2021 · 4 comments
Closed

Comments

@brooksco
Copy link

brooksco commented Apr 5, 2021

After updating to sentry-rails 4.3.3 from 4.3.1 in our Rails 6.1 app we're seeing an issue starting our Rails server. It looks like we're getting a undefined method debug' for nil:NilClasserror coming from the initializer forBackgroundWorkerwhen it callsconfiguration.logger.debug(LOGGER_PROGNAME)`.

I don't think we have an unusual logger setup to my knowledge, so I'm not sure why this is suddenly causing an issue, and I'm wondering what would have changed between these minor version releases (downgrading back to 4.3.1 fixes the issue) that we might need to account for.

Screen Shot 2021-04-05 at 12 44 52 PM

@st0012
Copy link
Collaborator

st0012 commented Apr 5, 2021

@brooksco I think this is the same problem as #1368, which could be solved if you move the configs into config/initializers/sentry.rb.

the root cause is that v4.3.3 fixes the sentry-rails' logger assignment, which requires the SDK to be initialized as one of the Rails initializers (this was expected but not required until now). I'll try to add a warning message to hint misplaced configurations.

@st0012 st0012 added this to To do in 4.x via automation Apr 5, 2021
@brooksco
Copy link
Author

brooksco commented Apr 5, 2021

@st0012 ah got it, I missed that since it was closed (should have checked there first). That fixed my issue. Thanks! Maybe a warning can help the next person who comes along and does what I did.

@brooksco brooksco closed this as completed Apr 5, 2021
4.x automation moved this from To do to Done Apr 5, 2021
@st0012
Copy link
Collaborator

st0012 commented Apr 6, 2021

@brooksco np. I hope you don’t mind I keep this open for a while for other facing the same problem 🙂

@st0012 st0012 reopened this Apr 6, 2021
4.x automation moved this from Done to In progress Apr 6, 2021
@st0012 st0012 added this to the sentry-rails-4.3.4 milestone Apr 6, 2021
@st0012
Copy link
Collaborator

st0012 commented Apr 6, 2021

I've added #1387 to prevent this from happening again.

@st0012 st0012 closed this as completed Apr 6, 2021
4.x automation moved this from In progress to Done Apr 6, 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