Defect #33021
closed[v.4.0.5-stable] Internal Server Error 500 when accessing 'repository' tab
0%
Description
Using Arch Linux kernel version 5.5.3-arch1-1, Redmine served using mod_passenger (v6.0.4-2) on Apache (2.4.41-1). Trying to access 'repository' tab gives error 500. Changesets can be viewed, and git integration otherwise works well. Issues tagged in commit msgs are properly closed/referenced.
Environment: Redmine version 4.0.5.stable Ruby version 2.7.0-p0 (2019-12-25) [x86_64-linux] Rails version 5.2.3 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery sendmail SCM: Git 2.25.1 Filesystem Redmine plugins: redmine_messenger 1.0.6
App 244788 output: Started GET "/tracker/projects/(PROJECT)/repository" for (IP-ADDRESS) at 2020-02-18 11:18:50 -0500 App 244788 output: Processing by RepositoriesController#show as HTML App 244788 output: Parameters: {"id"=>"(LOCAL_USER)"} App 244788 output: Current user: (REDMINE_USER) (id=5) App 244788 output: Completed 500 Internal Server Error in 30ms (ActiveRecord: 7.6ms) App 244788 output: App 244788 output: FrozenError (can't modify frozen String: ""): App 244788 output: App 244788 output: lib/redmine/scm/adapters/abstract_adapter.rb:279:in `force_encoding' App 244788 output: lib/redmine/scm/adapters/abstract_adapter.rb:279:in `scm_iconv' App 244788 output: lib/redmine/scm/adapters/git_adapter.rb:136:in `entries' App 244788 output: app/models/repository/git.rb:98:in `scm_entries' App 244788 output: app/models/repository.rb:204:in `entries' App 244788 output: app/controllers/repositories_controller.rb:86:in `show' App 244788 output: lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Related issues
Updated by Pavel Rosický almost 5 years ago
redmine 4.0.5 doesn't support ruby 2.7 yet https://www.redmine.org/issues/31500
the error seems to be related to this change https://bugs.ruby-lang.org/issues/16150
https://github.com/redmine/redmine/blob/caa88a2ed308224edc66f411b1466a7e622994c3/app/controllers/repositories_controller.rb#L320
at this line, there's a "params[:path].to_s" that may be nil and "nil.to_s" now returns a frozen string
Updated by Matthew Sexton almost 5 years ago
Manually Downgraded the following packages:
ruby (2.7.0-1 => 2.6.5-1)
rubygems (3.1.2-4 => 3.0.6-1)
ruby-bundler (2.1.4-1 => 2.0.2-1)
and re-ran bundle install --without development test
which fixed the problem. This was my mistaken, looking at the installation guide it does not list ruby 2.7 as supported.
However: It is a good note that I ran Redmine with Ruby 2.7 since December and in the entire time this was the only issue I ran into. Everything else worked pretty flawlessly.
Updated by Go MAEDA almost 5 years ago
- Related to Feature #31500: Ruby 2.7 support added
Updated by Anatol Pomozov almost 5 years ago
It would be great to debug and fix this problem so Arch can switch to ruby2.7 and avoid pulling the old ruby version.
Updated by Marius BĂLTEANU almost 5 years ago
Anatol Pomozov wrote:
It would be great to debug and fix this problem so Arch can switch to ruby2.7 and avoid pulling the old ruby version.
Only Redmine 4.2.0 will have official support for ruby2.7, the fixes won't be back ported to previous versions. You will need to update your Redmine version when the release will be available or manually backport the fixes which I do not recommend.
Updated by Anatol Pomozov almost 5 years ago
Marius BALTEANU wrote:
Only Redmine 4.2.0 will have official support for ruby2.7, the fixes won't be back ported to previous versions.
I wonder what is the reason behind this development practice? ruby 2.7 is mostly compatible with 2.6. And Matthew example above confirms it:
I ran Redmine with Ruby 2.7 since December and in the entire time this was the only issue I ran into
From my experience making a script compatible with ruby2.7 does not require too much efforts. It would be great to see redmine 4.0 compatible with ruby 2.7.
Updated by Pavel Rosický almost 5 years ago
FYI, this issue is already fixed in Redmine 4.1.0 by https://github.com/redmine/redmine/commit/30e341db6963d71fccf2d1bf24744ab828bee151
From my experience making a script compatible with ruby2.7 does not require too much efforts.
I think the main reason why it can't be officially supported is you'll get tons of warnings on Ruby 2.7. Users would blame Redmine for that, but until it's fixed in Rails https://github.com/rails/rails/pull/38386 we can't do much about it. They'll probably won't fix it for Rails 5.2.x anyway...
Updated by Mark Anderson over 4 years ago
This summer am working on upgrading our Redmine node also. My few plugins and using Subversion all worked fine with Ruby 2.7 - I made the same error!
There are MANY deprecation warnings which clutter up the log - but it all works / appears to work!
Matthew Sexton wrote:
<snip>
However: It is a good note that I ran Redmine with Ruby 2.7 since December and in the entire time this was the only issue I ran into. Everything else worked pretty flawlessly.
</snip>
Updated by rumplestilzken - almost 3 years ago
This issue has been resolved as of Redmine v 4.2.4. I pulled it from the subversion repository and configured and installed on ubuntu server 20.04. Initially installed from the ubuntu repository -- which has this issue because it is version 4.0.*
Environment:
Redmine version 4.2.4.stable.21431
Ruby version 2.7.0-p0 (2019-12-25) [x86_64-linux-gnu]
Rails version 5.2.6.2
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
SCM:
Subversion 1.13.0
Git 2.25.1
Filesystem
Redmine plugins:
no plugin installed
Updated by Go MAEDA almost 3 years ago
- Status changed from New to Closed
- Resolution set to Wont fix
Updating your Redmine to 4.1 or later fixes the issue. Closing.
Updated by Go MAEDA almost 3 years ago
- Related to Feature #26561: Enable frozen string literals added