Project

General

Profile

Actions

Defect #42113

closed

Redmine 5.x not starting with ActiveSupport Logger error

Added by Abe Tomoaki 2 months ago. Updated about 2 months 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 months 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 months 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 months ago

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

Actions #4

Updated by Go MAEDA 2 months ago

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

Updated by Go MAEDA 2 months 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 months ago

Go MAEDA wrote in #note-5:

Another workaround:

[...]

Good. I think your solution works better.

Actions #7

Updated by Go MAEDA 2 months ago

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

Actions #8

Updated by Go MAEDA 2 months 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 months 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 2 months ago

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

Updated by Go MAEDA 2 months 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 2 months 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 #13

Updated by Abe Tomoaki 2 months ago

I was able to start it with 5.0 and 5.1.
Thanks for the support.

Actions #14

Updated by Miguel Jacq 2 months ago

Thanks for the fix. I had just tried to upgrade from 5.0.10 to 5.1.0 and hit this issue. The fix in https://www.redmine.org/projects/redmine/repository/svn/revisions/23444 works well.

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 don't think it is, they have not yet made a new release with the fix, just applied it in the source.

Since this blocks upgrades, it would be good to get a new release soon.

Actions #15

Updated by Jobin J 2 months ago

Since this blocks upgrades, it would be good to get a new release soon.

It blocks the new installation of 5.x too. Hoping to get a new fixed official release asap.

Actions #16

Updated by Holger Just 2 months ago

For everyone coming across this issue: until there is a new release, you can work around this by adding the following code at the very end of the config/boot.rb file:

require 'logger'
Actions #17

Updated by Go MAEDA about 2 months ago

Redmine 5.1.6, which includes the fix for this issue, has been released.
Details: Redmine 6.0.3 and 5.1.6 released

Actions #18

Updated by Holger Just about 2 months ago

Go MAEDA: Thank you for releasing these updates! Just a question though: based on your comment in #42113#note-11 and the release post in Redmine 6.0.3 and 5.1.6 released, I assumed that you would also release a update for 5.0, i.e. 5.0.11. Did you decide against it?

Actions #19

Updated by Go MAEDA about 2 months ago

Holger Just wrote in #note-18:

Go MAEDA: Thank you for releasing these updates! Just a question though: based on your comment in #42113#note-11 and the release post in Redmine 6.0.3 and 5.1.6 released, I assumed that you would also release a update for 5.0, i.e. 5.0.11. Did you decide against it?

Thank you for your comment.

As I mentioned in #42113#note-11, I have backported the fix into the 5.0-stable branch in response to the user request. However, Redmine typically maintains only the current stable version and the previous stable version, so I did not plan to release version 5.0.11.

Do you think it would be beneficial to release 5.0.11 as well? I would appreciate your thoughts on this.

Actions #20

Updated by Holger Just about 2 months ago

According to the currently published release policy at Download, Redmine 5.0 is still supposed to receive security updates at least. I that is not actually the case anymore, this published policy should be updated.

I understand that this is not a security update in a stricter sense. However given that the fix has very little chance of regression and resolves the issue of not being able to start Redmine (which affects availability during a bundle update, which in turn is part of most definitions of the term "security"), I think it may be worthwhile to release an update here.

Actions #21

Updated by Go MAEDA about 2 months ago

  • Target version changed from 5.1.6 to 5.0.11
Actions #23

Updated by Marius BÄ‚LTEANU about 2 months ago

Thanks for releasing 5.0.11!

Actions

Also available in: Atom PDF