Intermittent NameError
/LoadError
when loading Rails environment
#266
Replies: 4 comments
-
This is a very weird error, if all caches are disabled (Bootsnap and Spring) so we can go to root of the matter, we find that the application raises a No idea how could this gem be related, the only observation is that with this gem the error can be reproduced (not consistently, but given a few attempts), and without this gem the error cannot be triggered. Disclaimer, I just participated in the research, don't have access to the application. |
Beta Was this translation helpful? Give feedback.
-
We removed |
Beta Was this translation helpful? Give feedback.
-
In Semantic Logger v4.13 it replaces most |
Beta Was this translation helpful? Give feedback.
-
Just weighing in that am having this issue too. I will try run the latest semantic logger and see if that fixes it, thanks @reidmorrison |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Environment
semantic_logger
4.12.0 viarails_semantic_logger
4.11.0Expected Behavior
Loading the Rails environment succeeds when
semantic_logger
gem is used in a Rails app.Actual Behavior
Loading the Rails environment fails intermittently with either
NameError: uninitialized constant <constant>
(when Bootsnap is enabled) orLoadError: cannot such such file -- <file>
(when Bootsnap is disabled). The constants that show up are not related tosemantic_logger
: they're often constants from other gems.I'm currently unable to reproduce the bug reliably. We've seen this bug happen intermittently in GitHub Actions the most (where our CI suite runs on x64-based Ubuntu 22.04 VMs), and only one time locally on an M1-powered MacBook. Removing the
rails_semantic_logger
gem entirely fully preventsNameError
/LoadError
from showing up.Full investigation thread available in this other GitHub issue—the most salient insight is in this comment.
Might also be the root cause of rails/rails#45600.
Beta Was this translation helpful? Give feedback.
All reactions