Project

General

Profile

Actions

Defect #42113

closed

Redmine 5.x not starting with ActiveSupport Logger error

Defect #42113: Redmine 5.x not starting with ActiveSupport Logger error

Added by Abe Tomoaki almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails support
Target version:
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 1 (0 open — 1 closed)

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

Updated by Mizuki ISHIKAWA almost 2 years ago Actions #1

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>'

Updated by Mizuki ISHIKAWA almost 2 years ago Actions #2

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.

Updated by Mizuki ISHIKAWA almost 2 years ago Actions #3

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

Updated by Go MAEDA almost 2 years ago Actions #4

  • Status changed from New to Confirmed
  • Target version set to 5.1.6

Updated by Go MAEDA almost 2 years ago Actions #5

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'

Updated by Mizuki ISHIKAWA almost 2 years ago Actions #6

Go MAEDA wrote in #note-5:

Another workaround:

[...]

Good. I think your solution works better.

Updated by Go MAEDA almost 2 years ago Actions #7

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

Updated by Go MAEDA almost 2 years ago Actions #8

  • 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.

Updated by Abe Tomoaki almost 2 years ago Actions #9

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?

Updated by Holger Just almost 2 years ago Actions #10

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

Updated by Go MAEDA almost 2 years ago Actions #11

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.

Updated by Jobin J almost 2 years ago Actions #12

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.

Updated by Abe Tomoaki almost 2 years ago Actions #13

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

Updated by Miguel Jacq almost 2 years ago Actions #14

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.

Updated by Jobin J almost 2 years ago Actions #15

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.

Updated by Holger Just almost 2 years ago Actions #16

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'

Updated by Go MAEDA almost 2 years ago Actions #17

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

Updated by Holger Just almost 2 years ago Actions #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?

Updated by Go MAEDA almost 2 years ago Actions #19

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.

Updated by Holger Just almost 2 years ago Actions #20

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.

Updated by Go MAEDA almost 2 years ago Actions #21

  • Target version changed from 5.1.6 to 5.0.11

Updated by Marius BĂLTEANU almost 2 years ago Actions #23

Thanks for releasing 5.0.11!

Updated by Brajendra shukla over 1 year ago Actions #24

Hi @GO MAEDA

Thanks to provide very usefull tool to us.

I am facing this above issue "NameError: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger"
Requesting you , please fixed this issue in any 5.0.x version Or give me any free SLA plugin which will work on Redmine version 5.1.8. I need to give a demo of SLA plugin

Thanks
Brajendra

Actions

Also available in: PDF Atom