Project

General

Profile

Actions

Defect #42113

closed

Redmine 5.x not starting with ActiveSupport Logger error

Added by Abe Tomoaki 2 days ago. Updated about 15 hours ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When I try to start using the 5.1-stable branch on GitHub, it does not start with the following issue.
https://github.com/rails/rails/issues/54272
https://github.com/rails/rails/pull/54264


Files

42113.diff (483 Bytes) 42113.diff Go MAEDA, 2025-01-17 02:31

Related issues

Has duplicate Redmine - Defect #42120: NameError: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger - Redmine-5.xClosed

Actions
Actions #1

Updated by Mizuki ISHIKAWA 2 days ago

I was able to reproduce a problem that looked like that.
I switched to 5.1-stable and then deleted the Gemfile.lock in my development environment and did a bundle install.

/usr/local/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:16:in `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

    Logger::Severity.constants.each do |severity|
          ^^^^^^^^^^
        from /usr/local/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:9:in `<module:ActiveSupport>'
        from /usr/local/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:8:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /usr/local/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7.10/lib/active_support/logger_silence.rb:5:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /usr/local/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7.10/lib/active_support/logger.rb:3:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /usr/local/lib/ruby/gems/3.2.0/gems/activesupport-6.1.7.10/lib/active_support.rb:29:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /usr/local/lib/ruby/gems/3.2.0/gems/railties-6.1.7.10/lib/rails/command.rb:3:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /usr/local/lib/ruby/gems/3.2.0/gems/railties-6.1.7.10/lib/rails/commands.rb:3:in `<top (required)>'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from bin/rails:4:in `<main>'
Actions #2

Updated by Mizuki ISHIKAWA 2 days ago

I have confirmed that the issue can be resolved by making the following changes, as referenced in https://github.com/rails/rails/pull/54264#issuecomment-2596149819 .

diff --git a/Gemfile b/Gemfile
index 290011946..68f40f2bb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -15,6 +15,7 @@ gem 'i18n', '~> 1.14.1'
 gem 'rbpdf', '~> 1.21.3'
 gem 'addressable'
 gem 'rubyzip', '~> 2.3.0'
+gem 'concurrent-ruby', '< 1.3.5'

 #  Ruby Standard Gems
 gem 'csv', '~> 3.2.6'

Although this is not a Redmine-specific issue, Rails 6.1 has already reached EOL. If Redmine 5.1 is to continue being supported, it might be necessary for the Redmine project to address this problem on its end.

Actions #3

Updated by Mizuki ISHIKAWA 2 days ago

This issue does not reproduce on Redmine 6.0-stable or trunk

Actions #4

Updated by Go MAEDA 2 days ago

  • Status changed from New to Confirmed
  • Target version set to 5.1.6
Actions #5

Updated by Go MAEDA 2 days ago

Another workaround:

Index: config/boot.rb
===================================================================
--- config/boot.rb    (revision 23435)
+++ config/boot.rb    (working copy)
@@ -4,3 +4,5 @@
 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

 require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
+
+require 'logger'
Actions #6

Updated by Mizuki ISHIKAWA 2 days ago

Go MAEDA wrote in #note-5:

Another workaround:

[...]

Good. I think your solution works better.

Actions #7

Updated by Go MAEDA 2 days ago

I will commit the attached patch in the 5.1-stable branch.

Actions #8

Updated by Go MAEDA 2 days ago

  • Status changed from Confirmed to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix in r23442.
Thank you for reporting the issue.

Actions #9

Updated by Abe Tomoaki 2 days ago

Thanks for the quick response.
I forgot to mention the 5.0-stable branch, sorry.
I get the same error on the 5.0-stable branch, will it be committed on there too?

Actions #10

Updated by Holger Just 1 day ago

  • Has duplicate Defect #42120: NameError: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger - Redmine-5.x added
Actions #11

Updated by Go MAEDA 1 day ago

Abe Tomoaki wrote in #note-9:

I forgot to mention the 5.0-stable branch, sorry.
I get the same error on the 5.0-stable branch, will it be committed on there too?

Although Redmine 5.0 is no longer maintained, this issue is critical as it prevents Redmine from starting. Therefore, I have committed the fix in r23444.

Actions #12

Updated by Jobin J about 15 hours ago

Thank you for the fix. Can you please confirm that this issue is fixed in any of the official download links, such as 5.1.5 or 5.0.10?

I spent the whole day yesterday trying to run Redmine on different operating systems and logged ticket #42120.

Actions

Also available in: Atom PDF