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

Rails 7.0.8 fails to create an app with most recent concurrent-ruby version #54260

Closed
hurricup opened this issue Jan 16, 2025 · 2 comments
Closed

Comments

@hurricup
Copy link

Just cross-posting here, not sure who should handle this

ruby-concurrency/concurrent-ruby#1077

/home/user/.asdf/installs/ruby/3.3.6/lib/ruby/gems/3.3.0/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:12:in `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

Release: https://github.com/ruby-concurrency/concurrent-ruby/releases/tag/v1.3.5

@Earlopain
Copy link
Contributor

Try the 7-0-stable branch, it has a few improvements to keep up with the bundled gems situation with recent rubies, other gems will make trouble on 3.4. Rails 7.0 relies on the require being done by concurrent-ruby.

But, since 0f5e7a6 is not part of it, you may still need to add a manual require "logger" somewhere unless something like that is backported by someone.

@ahukkanen
Copy link

This is fixed in Rails 7.1 through this commit:
0f5e7a6

This commit is not part of the 7-0-stable branch.

ahukkanen added a commit to mainio/rails that referenced this issue Jan 16, 2025
unflxw added a commit to appsignal/appsignal-ruby that referenced this issue Jan 16, 2025
Due to a mismatch in expectations between the latest version of
`concurrent-ruby` and older versions of Rails, `logger` must be
required before other dependencies are required:
rails/rails#54260
@zzak zzak marked this as a duplicate of #54272 Jan 16, 2025
olavloite added a commit to GoogleCloudPlatform/pgadapter that referenced this issue Jan 17, 2025
Many existing Ruby ActiveRecord applications have been broken
by rails/rails#54260. This also
includes the tests and samples for PGAdapter. This workaround
makes sure that Logger is required before running the test/sample.
olavloite added a commit to GoogleCloudPlatform/pgadapter that referenced this issue Jan 17, 2025
Many existing Ruby ActiveRecord applications have been broken
by rails/rails#54260. This also
includes the tests and samples for PGAdapter. This workaround
makes sure that Logger is required before running the test/sample.
olavloite added a commit to GoogleCloudPlatform/pgadapter that referenced this issue Jan 17, 2025
Many existing Ruby ActiveRecord applications have been broken
by rails/rails#54260. This also
includes the tests and samples for PGAdapter. This workaround
makes sure that Logger is required before running the test/sample.
tagliala added a commit to diowa/ruby3-rails6-bootstrap-heroku that referenced this issue Jan 21, 2025
Restrict 'concurrent-ruby' to '< 1.3.5' because of rails/rails#54260
tagliala added a commit to diowa/ruby3-rails6-bootstrap-heroku that referenced this issue Jan 21, 2025
Restrict 'concurrent-ruby' to '< 1.3.5' because of rails/rails#54260
tagliala added a commit to tagliala/annotaterb that referenced this issue Jan 22, 2025
To address compatibility issues with Rails 7.0, this commit locks
`concurrent-ruby` gem to version 1.3.4.

This change is necessary to prevent an uninitialized constant error
related to `ActiveSupport::LoggerThreadSafeLevel::Logger`, as documented
in issue rails/rails#54260.

By specifying this version, we ensure that our CI integration specs pass
consistently, providing a stable development and testing environment.

This measure will remain in place until the integration tests upgrade
to Rails 7.1, which involves significant changes that require careful
consideration and testing.
tagliala added a commit to tagliala/annotaterb that referenced this issue Jan 22, 2025
To address compatibility issues with Rails 7.0, this commit locks
`concurrent-ruby` gem to version 1.3.4.

This change is necessary to prevent an uninitialized constant error
related to `ActiveSupport::LoggerThreadSafeLevel::Logger`, as documented
in issue rails/rails#54260.

By specifying this version, we ensure that our CI integration specs pass
consistently, providing a stable development and testing environment.

This measure will remain in place until the integration tests upgrade
to Rails 7.1, which involves significant changes that require careful
consideration and testing.
tagliala added a commit to tagliala/annotaterb that referenced this issue Jan 22, 2025
To address compatibility issues with Rails 7.0, this commit locks
`concurrent-ruby` gem to version 1.3.4.

This change is necessary to prevent an uninitialized constant error
related to `ActiveSupport::LoggerThreadSafeLevel::Logger`, as documented
in issue rails/rails#54260.

By specifying this version, we ensure that our CI integration specs pass
consistently, providing a stable development and testing environment.

This measure will remain in place until the integration tests upgrade
to Rails 7.1, which involves significant changes that require careful
consideration and testing.
tagliala added a commit to tagliala/annotaterb that referenced this issue Jan 22, 2025
To address compatibility issues with Rails 7.0, this commit locks
`concurrent-ruby` gem to version 1.3.4.

This change is necessary to prevent an uninitialized constant error
related to `ActiveSupport::LoggerThreadSafeLevel::Logger`, as documented
in issue rails/rails#54260.

By specifying this version, we ensure that our CI integration specs pass
consistently, providing a stable development and testing environment.

This measure will remain in place until the integration tests upgrade
to Rails 7.1, which involves significant changes that require careful
consideration and testing.
jmpage added a commit to ezcater/activerecord-postgres_pub_sub that referenced this issue Feb 3, 2025
…el::Logger

rails/rails#54260 concurrent-ruby 1.3.5 introduces a change which
reveals a bug in activerecord 6.1 and 7.0, breaking specs
jmpage added a commit to ezcater/activerecord-postgres_pub_sub that referenced this issue Feb 3, 2025
…el::Logger

rails/rails#54260 concurrent-ruby 1.3.5 introduces a change which
reveals a bug in activerecord 6.1 and 7.0, breaking specs
jmpage added a commit to ezcater/activerecord-postgres_pub_sub that referenced this issue Feb 3, 2025
…el::Logger

rails/rails#54260 concurrent-ruby 1.3.5 introduces a change which
reveals a bug in activerecord 6.1 and 7.0, breaking specs
jmpage added a commit to ezcater/activerecord-postgres_pub_sub that referenced this issue Feb 3, 2025
…el::Logger

rails/rails#54260 concurrent-ruby 1.3.5 introduces a change which
reveals a bug in activerecord 6.1 and 7.0, breaking specs
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Feb 5, 2025
…eadSafeLevel::Logger

The upgrade of gem concurrent-ruby to 1.3.5 made a bug in activesupport visible.
The bug seems to be fixed for rails 7.1 and 7.2 but not 7.0 which gitlab uses.
rails/rails#49372
rails/rails#54260

So we import the Logger to fix the error message:
bundler: failed to load command: puma (/usr/local/bin/puma)
/usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:12:in `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

    Logger::Severity.constants.each do |severity|
          ^^^^^^^^^^
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:9:in `<module:ActiveSupport>'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:8:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_silence.rb:5:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger.rb:3:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support.rb:29:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/all.rb:3:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/www/gitlab/gems/gitlab-utils/lib/gitlab/utils.rb:4:in `<top (required)>'
        from /usr/local/www/gitlab/gems/gitlab-utils/lib/gitlab/utils/all.rb:3:in `require_relative'
        from /usr/local/www/gitlab/gems/gitlab-utils/lib/gitlab/utils/all.rb:3:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/www/gitlab/lib/gitlab/cluster/lifecycle_events.rb:3:in `<top (required)>'
        from /usr/local/www/gitlab/config/puma.rb:38:in `require_relative'
        from /usr/local/www/gitlab/config/puma.rb:38:in `_load_from'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/dsl.rb:135:in `instance_eval'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/dsl.rb:135:in `_load_from'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/configuration.rb:246:in `block in load'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/configuration.rb:246:in `each'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/configuration.rb:246:in `load'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/launcher.rb:56:in `initialize'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/cli.rb:66:in `new'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/cli.rb:66:in `initialize'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/bin/puma:8:in `new'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/bin/puma:8:in `<top (required)>'
        from /usr/local/bin/puma:25:in `load'
        from /usr/local/bin/puma:25:in `<top (required)>'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `load'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `kernel_load'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:23:in `run'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli.rb:452:in `exec'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli.rb:35:in `dispatch'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli.rb:29:in `start'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/exe/bundle:28:in `block in <top (required)>'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/exe/bundle:20:in `<top (required)>'
        from /usr/local/bin/bundle:25:in `load'
        from /usr/local/bin/bundle:25:in `<main>'
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Feb 13, 2025
…eadSafeLevel::Logger

The upgrade of gem concurrent-ruby to 1.3.5 made a bug in activesupport visible.
The bug seems to be fixed for rails 7.1 and 7.2 but not 7.0 which gitlab uses.
rails/rails#49372
rails/rails#54260

So we import the Logger to fix the error message:
bundler: failed to load command: puma (/usr/local/bin/puma)
/usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:12:in `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

    Logger::Severity.constants.each do |severity|
          ^^^^^^^^^^
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:9:in `<module:ActiveSupport>'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:8:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger_silence.rb:5:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/logger.rb:3:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support.rb:29:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/lib/ruby/gems/3.2/gems/activesupport-7.0.8.7/lib/active_support/all.rb:3:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/www/gitlab/gems/gitlab-utils/lib/gitlab/utils.rb:4:in `<top (required)>'
        from /usr/local/www/gitlab/gems/gitlab-utils/lib/gitlab/utils/all.rb:3:in `require_relative'
        from /usr/local/www/gitlab/gems/gitlab-utils/lib/gitlab/utils/all.rb:3:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /usr/local/www/gitlab/lib/gitlab/cluster/lifecycle_events.rb:3:in `<top (required)>'
        from /usr/local/www/gitlab/config/puma.rb:38:in `require_relative'
        from /usr/local/www/gitlab/config/puma.rb:38:in `_load_from'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/dsl.rb:135:in `instance_eval'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/dsl.rb:135:in `_load_from'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/configuration.rb:246:in `block in load'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/configuration.rb:246:in `each'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/configuration.rb:246:in `load'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/launcher.rb:56:in `initialize'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/cli.rb:66:in `new'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/lib/puma/cli.rb:66:in `initialize'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/bin/puma:8:in `new'
        from /usr/local/lib/ruby/gems/3.2/gems/puma-6.5.0/bin/puma:8:in `<top (required)>'
        from /usr/local/bin/puma:25:in `load'
        from /usr/local/bin/puma:25:in `<top (required)>'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `load'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in `kernel_load'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:23:in `run'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli.rb:452:in `exec'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor.rb:538:in `dispatch'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli.rb:35:in `dispatch'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/cli.rb:29:in `start'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/exe/bundle:28:in `block in <top (required)>'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
        from /usr/local/lib/ruby/gems/3.2/gems/bundler-2.6.3/exe/bundle:20:in `<top (required)>'
        from /usr/local/bin/bundle:25:in `load'
        from /usr/local/bin/bundle:25:in `<main>'

(cherry picked from commit 7040041)
mamhoff added a commit to mamhoff/sprockets-rails that referenced this issue Feb 15, 2025
mamhoff added a commit to mamhoff/sprockets-rails that referenced this issue Feb 15, 2025
mamhoff added a commit to mamhoff/sprockets-rails that referenced this issue Feb 15, 2025
mamhoff added a commit to mamhoff/sprockets-rails that referenced this issue Feb 15, 2025
mamhoff added a commit to mamhoff/sprockets-rails that referenced this issue Feb 15, 2025
mvz added a commit to ActsAsParanoid/acts_as_paranoid that referenced this issue Feb 22, 2025
This can be removed once Rails 7.0 support is dropped.

See rails/rails#54260
kevin-j-m added a commit to kevin-j-m/playground that referenced this issue Mar 6, 2025
rails/rails#54263
rails/rails#54260

concurrent-ruby 1.3.5 changes this for Rails, because concurrent-ruby
used to load the logger gem. 1.3.5 no longer does, and Rails needs it.

This should be fixed by newer versions of Rails (include on the 7.0
series), but in the meantime, this fixes the issue. We should remove
this require once we upgrade Rails.

rails/rails#54264
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

4 participants