-
Notifications
You must be signed in to change notification settings - Fork 183
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
bootsnap hiding LoadErrors #218
Comments
(sorry for the huge delay in response) I can't figure out how this would be an issue: def depend_on(*)
super
rescue LoadError
# If we already had cache disabled, there's no use retrying
raise if Thread.current[:without_bootsnap_cache]
CoreExt::ActiveSupport.without_bootsnap_cache { super }
end ...inlining that call: def depend_on(*)
super
rescue LoadError
# If we already had cache disabled, there's no use retrying
raise if Thread.current[:without_bootsnap_cache]
begin
prev = Thread.current[:without_bootsnap_cache] || false
Thread.current[:without_bootsnap_cache] = true
super
ensure
Thread.current[:without_bootsnap_cache] = prev
end
end In the case that the first call to |
Hey @burke , Thanks for looking into this. It's been a while since I've looked at it myself. Were you able to reproduce it with the steps I listed? |
I just ran into it while attempting to run some Rails benchmark applications. I had not configured Rails to use a JRuby adapter, but when it tried to load the native CRuby adapter (which was not available of course) it failed in a completely different way, exactly like railsadminteam/rails_admin#3025. Removing bootsnap allowed me to see the original error. |
I suspect #247 will solve this issue but I haven't found the time to build a reproduction to prove it to myself yet. |
1.4.2.rc1 is out, I think it fixes this issue. |
Thanks for working on this.
Were you able to reproduce with:
|
Ah, still showing the wrong error but at least I have an easy reproduction now. I'll try to get it fixed today. Thanks! |
If this is not fixed by 1.4.2.rc2, please reopen. |
Hey guys,
I'm not really sure what the right solution is here, but I recently came across this issue when forgetting to include the
pg
gem in my Gemfile:When there is a
LoadError
raised during the app initialization,bootsnap
utlimately rescues and re-raises here:https://github.com/Shopify/bootsnap/blob/master/lib/bootsnap/load_path_cache/core_ext/active_support.rb#L83
The problem is that if
Thread.current[:without_bootsnap_cache]
is false, the error is ignored and the app continues to load and ultimately fails in another place which hides the actual error.So, in my case I was getting this:
instead of this:
Environment
Steps to reproduce:
The text was updated successfully, but these errors were encountered: