redmine-git-hosting / redmine_git_hosting

A Redmine plugin which makes configuring your own Git hosting easy ;)
http://redmine-git-hosting.io
MIT License
275 stars 116 forks source link

Internal error 500 after upgrading from 3.4.4 to 4.1.1 #772

Closed cspk closed 3 years ago

cspk commented 4 years ago

Updated Redmine installation, copied all configs, plugins, did migrations. When clicking on a project that has repos there's "internal error 500". Logs contain this:

Started GET "/projects/xxxx" for ::1 at 2020-08-04 15:09:47 +0500
Processing by ProjectsController#show as HTML
  Parameters: {"id"=>"xxxx"}
  Current user: yyyy (id=5)
Creating scope :system. Overwriting existing method Enumeration.system.
Creating scope :sorted. Overwriting existing method User.sorted.
Creating scope :sorted. Overwriting existing method Group.sorted.
Creating scope :visible. Overwriting existing method Principal.visible.
  Rendering projects/show.html.erb within layouts/base
  Rendered plugins/additionals/app/views/projects/_additionals_show_actions_dropdown.html.slim (5.4ms)
  Rendered plugins/redmine_git_hosting/app/views/common/_git_urls.html.slim (59.7ms)
  Rendered plugins/redmine_git_hosting/app/views/projects/_git_urls.html.slim (105.6ms)
  Rendered projects/show.html.erb within layouts/base (168.6ms)
Completed 500 Internal Server Error in 429ms (ActiveRecord: 27.3ms)

ActionView::Template::Error (undefined method `[]' for nil:NilClass):
     9:     $(document).ready(function() { setFirstGitUrl('.git_url_list'); setGitUrls('.git_url'); });
    10:
    11: - repositories = Array.wrap(repository) unless repositories
    12: - if repositories.map(&:available_urls_sorted).reject { |h| h.empty? }.any?
    13:   - repositories.sort_by { |r| r.is_default ? 0 : 1 }.each do |repository|
    14:     - next if repository.available_urls_sorted.empty?
    15:     - present repository do |p|

plugins/redmine_git_hosting/app/models/concerns/gitolitable/features.rb:93:in `urls_order'
plugins/redmine_git_hosting/app/models/concerns/gitolitable/urls.rb:112:in `available_urls_sorted'
plugins/redmine_git_hosting/app/views/common/_git_urls.html.slim:12:in `map'
plugins/redmine_git_hosting/app/views/common/_git_urls.html.slim:12:in `_22f3e4f1639aa2462a7ec27c4c3a3f66'
plugins/redmine_git_hosting/app/views/projects/_git_urls.html.slim:7:in `_b7b7f60eaf1e8a8f9e1b3ad592c71277'
lib/redmine/hook/view_listener.rb:61:in `block (2 levels) in render_on'
lib/redmine/hook/view_listener.rb:59:in `map'
lib/redmine/hook/view_listener.rb:59:in `block in render_on'
lib/redmine/hook.rb:63:in `block (2 levels) in call_hook'
lib/redmine/hook.rb:63:in `each'
lib/redmine/hook.rb:63:in `block in call_hook'
lib/redmine/hook.rb:60:in `tap'
lib/redmine/hook.rb:60:in `call_hook'
lib/redmine/hook.rb:98:in `call_hook'
app/views/projects/show.html.erb:125:in `_8d74c9ef7c3bd64119764ad34537aaa5'
lib/redmine/sudo_mode.rb:65:in `sudo_mode'
Creating scope :visible. Overwriting existing method AgileQuery.visible.
DEPRECATION WARNING: Using a dynamic :action segment in a route is deprecated and will be removed in Rails 6.0. (called from instance_eval at /home/spk/sys/redmine-4.1.1/config/routes.rb:370)
DEPRECATION WARNING: Using a dynamic :action segment in a route is deprecated and will be removed in Rails 6.0. (called from instance_eval at /home/spk/sys/redmine-4.1.1/config/routes.rb:370)
DEPRECATION WARNING: Using a dynamic :action segment in a route is deprecated and will be removed in Rails 6.0. (called from instance_eval at /home/spk/sys/redmine-4.1.1/config/routes.rb:370)
DEPRECATION WARNING: Using a dynamic :action segment in a route is deprecated and will be removed in Rails 6.0. (called from instance_eval at /home/spk/sys/redmine-4.1.1/config/routes.rb:370)

Debian 10.5 Apache 2.4.38-3+deb10u3 Ruby 2.5.5p157 Rails 2:5.2.2.1+dfsg-1+deb10u1 redmine_git_hosting 4.0.2 redmine_bootstrap_kit 0.2.5

cspk commented 4 years ago

I get same issue with 3.4.4. Seems like my machine config/env (where I perform the upgrade) is kinda different from server's one (where the redmine instance is copied from). Maybe delete the issue?