Defect #19820

SCM diff view crashes on some commits in Redmine 3.0.3

Added by Benoît Courtine about 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:-
Resolution:Invalid Affected version:3.0.3

Description

I just migrated a Redmine instance from 2.5.1 to 3.0.3, and discovered a regression. We use git as SCM.

In the SCM view, the file diff page crashes (internal server error) on several commits (the same page with the same commit is correct in version 2.5.1).

I could neither find the reason of this crash nor the common point of the crashing commits (the problem concerns only a few number of commits).

Here is the error log when the crash occurs:

Processing by RepositoriesController#diff as HTML
  Parameters: {"id"=>"my-project", "rev"=>"6a1965444b30020730416f4aa9540874fc4e6d02", "path"=>"batchs/src/main/java/com/company/File.java"}
  Current user: bcourtine (id=26)
Read fragment views/repositories/diff/3/c673bdad9f8b301a97c9dfcb0656c093 (19.9ms)
Read fragment views/repositories/diff/3/c673bdad9f8b301a97c9dfcb0656c093/5bbdde9de6be260b043673887b4894a5 (0.2ms)
  Rendered common/_diff.html.erb (5.2ms)
  Rendered repositories/diff.html.erb within layouts/base (10.7ms)
Completed 500 Internal Server Error in 57ms (ActiveRecord: 11.9ms)

ActionView::Template::Error (undefined method `each' for nil:NilClass):
    1: <% diff = Redmine::UnifiedDiff.new(
    2:             diff, :type => diff_type,
    3:             :max_lines => Setting.diff_max_lines_displayed.to_i,
    4:             :style => diff_style) -%>
  lib/redmine/unified_diff.rb:31:in `initialize'
  app/views/common/_diff.html.erb:1:in `new'
  app/views/common/_diff.html.erb:1:in `_app_views_common__diff_html_erb___96846821702686826_70363864763580'
  app/views/repositories/diff.html.erb:16:in `block in _app_views_repositories_diff_html_erb___4167826210359697366_70363864619900'
  app/views/repositories/diff.html.erb:15:in `_app_views_repositories_diff_html_erb___4167826210359697366_70363864619900'

History

#1 Updated by Benoît Courtine about 4 years ago

Here is the general information about my installation:

Environment:
  Redmine version                3.0.3.stable
  Ruby version                   1.9.3-p385 (2013-02-06) [x86_64-linux]
  Rails version                  4.2.1
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.6.11
  Git                            1.7.1
  Filesystem                     
Redmine plugins:
  redmine_app__space             1.0.3
  redmine_app_timesheets         1.5.3

#2 Updated by Toshi MARUYAMA about 4 years ago

Could you try clear cache?

$ bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production

#3 Updated by Benoît Courtine about 4 years ago

  • Status changed from New to Resolved

It resolved the issue. Thanks a lot.

#4 Updated by Toshi MARUYAMA about 4 years ago

  • Status changed from Resolved to Closed
  • Resolution set to Invalid

Thank you for your feedback.

#5 Updated by C Tibirna over 3 years ago

I encounter the exact problem (identical trace) with latest 3.1.2 (git revision 2e43f22). Clearing the cache doesn't help. My installation:

Environment:
  Redmine version                3.1.2.stable
  Ruby version                   2.1.3-p242 (2014-09-19) [x86_64-linux-gnu]
  Rails version                  4.2.4
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.13
  Git                            2.1.4
  Filesystem                     
Redmine plugins:
  redmine_latex_mathjax          0.1.0
  redmine_ldap_sync              2.0.4.devel.g733b3760d7
  wiking                         1.0.0b

#6 Updated by Toshi MARUYAMA over 3 years ago

C Tibirna wrote:

I encounter the exact problem (identical trace) with latest 3.1.2 (git revision 2e43f22). Clearing the cache doesn't help. My installation:

Try #13520#note-12

#7 Updated by C Tibirna over 3 years ago

Toshi MARUYAMA wrote:

C Tibirna wrote:

I encounter the exact problem (identical trace) with latest 3.1.2 (git revision 2e43f22). Clearing the cache doesn't help. My installation:

Try #13520#note-12

A subsequent cache cleaning attempt seems to have done the right job. For now I can't anymore reproduce the crashes I used to see. Thanks.

Also available in: Atom PDF