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

Uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger after concurrent-ruby 1.3.5 update #3493

Open
seanaery opened this issue Jan 21, 2025 · 5 comments

Comments

@seanaery
Copy link
Contributor

The concurrent-ruby gem v1.3.5 (Jan 15, 2025 -- release notes) removed its dependency on logger in a way that apparently breaks for Rails versions pre-7.1.
See rails/rails#54264 for details.

We are seeing NameError: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger in the pre-7.1 cells in our CI matrix.

@jrochkind
Copy link
Member

jrochkind commented Jan 21, 2025

Solution might just be adding a development dependency to logger?

The rails issue suggests that Rails may not ever release fixes for Rails 7.0 and previous -- where it technically is a bug, as Rails should be declaring a dependency on logger.

So I think maybe just a workaround to Rails bug in our CI by declaring our dependency for dev/CI only -- for people's own app's, it's Rails bug not ours, and they can do the same locally, or wait for version of Rails with bugfix, or lock to an old concurrent-ruby (that just masks the bug, I wouldn't advise this path), but their choice.

Could even do it in gemfile as "require: false", and then only require in rails < 7.1 as an explicit workaround for bug in those Rails versions that is not going to be patched by Rails.

@jrochkind
Copy link
Member

OK, a simple require 'logger' in spec_helper.rb is enough to fix. No need to change any dependencies.

see my fix in attr_json at jrochkind/attr_json#240

While in ruby 3.6 logger becomes a "bundled dependency" we are never going to test Rails pre 7.1 with ruby 3.6.

The problem with ruby/rails versions for ruby 7.0 we are encountering, is that logger was a default gem, it does not need to be in your gemfile, it just needs an explicit require, which Rails is failing to do, but the failure was hidden by non-current versions of concurrent-ruby.

@jrochkind
Copy link
Member

On the other hand, I had another project where I could not get that to work -- and couldn't even get things to work by adding logger to Gemfile or gemspec!

sciencehistory/kithe#188

Not sure what's going on, very frustrating indeed.

@seanaery
Copy link
Contributor Author

Thanks @jrochkind for sharing your research and remediation so far in related contexts -- much appreciated. It may be a bit (next week?) before I can look closer here to try to help pinpoint what solution works best for the blacklight engine.

@seanaery
Copy link
Contributor Author

This issue was resolved in main by dropping Rails < 7.1 from the test matrix (see #3498). PR to fix it in the release-8.x branch via #3500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants