You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
semantic_logger 4.12.0 via rails_semantic_logger 4.11.0
Expected 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) or LoadError: cannot such such file -- <file> (when Bootsnap is disabled). The constants that show up are not related to semantic_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 prevents NameError/LoadError from showing up.
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 LoadError for active_admin.rb, and its directory is in $LOAD_PATH. Very odd.
No idea how could this gem be related, the only observation is that without 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.
We removed Spring from all of our projects because it causes more problems than it solves. As of Ruby 2.7 it does not appear to make any visible difference either.
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.
The text was updated successfully, but these errors were encountered: