Defect #42113
closedRedmine 5.x not starting with ActiveSupport Logger error
0%
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
Related issues
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>'
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.
Updated by Mizuki ISHIKAWA 2 months ago
This issue does not reproduce on Redmine 6.0-stable or trunk
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'
Updated by Mizuki ISHIKAWA 2 months ago
Updated by Go MAEDA 2 months ago
- File 42113.diff 42113.diff added
- Category set to Rails support
I will commit the attached patch in the 5.1-stable branch.
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?
Updated by Holger Just 2 months ago
- Has duplicate Defect #42120: NameError: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger - Redmine-5.x added
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.
Updated by Abe Tomoaki 2 months ago
I was able to start it with 5.0 and 5.1.
Thanks for the support.
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.
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'
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
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?
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.
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.
Updated by Go MAEDA about 2 months ago
- Target version changed from 5.1.6 to 5.0.11