Project

General

Profile

Actions

Defect #11752

closed

Internal error when view the diff when using the redmine with git

Added by Dmitriy Sadoviy over 12 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

I have install the redmine 2.0.3 and git on Centos server.

The redmine directory and the git repositories directory's owner is apache.

If I create a project on the git, the redmine can find the file and change history of it.

But when i click the "diff" button , the redmine give a internal error.

From the production.log , I got the following messages:

Started GET "/projects/multisite/repository/revisions/d7244fe0b3e47e1f0a5a3ff821aebb4906b4302e/diff/inc/sid.inc.php" for XX.XX.XX.XX at Fri Aug 31 12:41:24 +0000 2012
Processing by RepositoriesController#diff as HTML
Parameters: {"rev"=>"d7244fe0b3e47e1f0a5a3ff821aebb4906b4302e", "id"=>"multisite", "path"=>"inc/sid.inc.php"}
Read fragment views/repositories/diff/10/197f466abce532d01b4c4051522c1145 (0.2ms)
Read fragment views/repositories/diff/10/197f466abce532d01b4c4051522c1145 (0.2ms)
Rendered common/_diff.html.erb (1.4ms)
Write fragment views/repositories/diff/10/197f466abce532d01b4c4051522c1145 (1.0ms)
Rendered repositories/diff.html.erb within layouts/base (7.5ms)
Completed 500 Internal Server Error in 164ms

ActionView::Template::Error (wrong number of arguments (2 for 1)):
13: </p>
14: <% end >
15:
16: <
cache(@cache_key) do ->
17: <
= render :partial => 'common/diff', :locals => {:diff => @diff} >
18: <
end -%>
19:
app/views/repositories/diff.html.erb:16:in `_app_views_repositories_diff_html_erb___384619615__619711618'

Actions #1

Updated by Toshi MARUYAMA over 12 years ago

  • Category changed from Core Plugins to SCM
  • Assignee deleted (Jim Mulholland)
Actions #2

Updated by Toshi MARUYAMA over 12 years ago

  • Status changed from New to Closed
  • Resolution set to Cant reproduce

I cannot reproduce and all test passes.
http://www.redmine.org/builds/index.html

Actions #3

Updated by Dmitriy Sadoviy over 12 years ago

  • Status changed from Closed to Reopened
  • Assignee set to Toshi MARUYAMA

hi! it`s new log for thie issue:

Started GET "/projects/multisite/repository/crontabs/diff?utf8=%E2%9C%93&rev=f1275950b6181233b2ad0c39c4b7df82ff652f91&rev_to=4baa201d5d3c0248a0bf0970e5b5731309261fe6" for XX.XX.XX.XX at Tue Sep 04 13:00:09 +0000 2012
Processing by RepositoriesController#diff as HTML
  Parameters: {"rev_to"=>"4baa201d5d3c0248a0bf0970e5b5731309261fe6", "rev"=>"f1275950b6181233b2ad0c39c4b7df82ff652f91", "utf8"=>"✓", "id"=>"multisite", "repository_id"=>"crontabs"}
Read fragment views/repositories/diff/15/2dee32e5f777ac8ea956679051bd646a (0.2ms)
Read fragment views/repositories/diff/15/2dee32e5f777ac8ea956679051bd646a (0.2ms)
  Rendered common/_diff.html.erb (49.4ms)
  Rendered repositories/diff.html.erb within layouts/base (55.5ms)
Completed 500 Internal Server Error in 130ms

ActionView::Template::Error (undefined local variable or method `diff_type' for #<#<Class:0xb61d9690>:0xb61d697c>):
    1: <% diff = Redmine::UnifiedDiff.new(
    2:             diff, :type => diff_type,
    3:             :max_lines => Setting.diff_max_lines_displayed.to_i) -%>
    4: 
    5: <% diff.each do |table_file| -%>
  app/views/common/_diff.html.erb:2:in `_app_views_common__diff_html_erb__491608834__619852408'
  app/views/repositories/diff.html.erb:17:in `_app_views_repositories_diff_html_erb___384619615__619804828'
  app/views/repositories/diff.html.erb:16:in `_app_views_repositories_diff_html_erb___384619615__619804828'

I added the three repository and they do not work with the same problem (see log)

Actions #4

Updated by Toshi MARUYAMA over 12 years ago

  • Status changed from Reopened to Closed

Please give more details and read SubmittingBugs.

This operation is tested.
source:tags/2.0.3/test/integration/repositories_git_test.rb#L45

Actions #5

Updated by Toshi MARUYAMA over 12 years ago

  • Assignee deleted (Toshi MARUYAMA)
Actions #6

Updated by Dimitri Sapunou about 12 years ago

  • Status changed from Closed to Reopened

Internal error when view the diff when using the redmine with SVN

Started GET "/projects/XXXXX/repository/diff?utf8=%E2%9C%93&rev=443&rev_to=442" for XX.XX.XX.XX at Fri Oct 25 19:21:02 +0200 2012
Processing by RepositoriesController#diff as HTML
  Parameters: {"rev_to"=>"442", "rev"=>"443", "utf8"=>"â", "id"=>"XXXXX"}
  Current user: sapunou (id=6)
Read fragment views/repositories/diff/1/dbae4169ef2c7681fca525cf3fcc90ba (0.2ms)
Read fragment views/repositories/diff/1/dbae4169ef2c7681fca525cf3fcc90ba (0.2ms)
  Rendered common/_diff.html.erb (9.2ms)
Write fragment views/repositories/diff/1/dbae4169ef2c7681fca525cf3fcc90ba (1.8ms)
  Rendered repositories/diff.html.erb within layouts/base (16.0ms)
Completed 500 Internal Server Error in 125ms

ActionView::Template::Error (wrong number of arguments (2 for 1)):
    14:   </p>
    15: <% end %>
    16:
    17: <% cache(@cache_key) do -%>
    18: <%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
    19: <% end -%>
    20:
  app/views/repositories/diff.html.erb:17:in `_app_views_repositories_diff_html_erb___2147035361_23764049681760'


Environment:
  Redmine version                          2.1.2.stable.10701
  Ruby version                             1.8.7 (x86_64-linux)
  Rails version                            3.2.8
  Environment                              production
  Database adapter                         MySQL
Redmine plugins:
  redirect_to_after_login                  0.0.2
  wiking                                   0.0.1b

Permission /opt/redmine-2.1/tmp/cache

drwxr-xr-x 8 apache apache 4096 Oct 26 10:12 .
drwxr-xr-x 8 apache apache 4096 Oct 23 15:08 ..
drwxr-xr-x 3 apache apache 4096 Oct 23 18:56 417
drwxr-xr-x 3 apache apache 4096 Oct 23 19:08 4D8
drwxr-xr-x 3 apache apache 4096 Oct 23 18:56 518
drwxr-xr-x 6 apache apache 4096 Oct 23 12:30 .svn
-rw------- 1 apache apache    0 Oct 25 19:12 views%2Frepositories%2Fdiff%2F1%2Fdbae4169ef2c7681fca525cf3fcc90ba20121026-28170-12zskke-0
-rw------- 1 apache apache    0 Oct 25 19:12 views%2Frepositories%2Fdiff%2F1%2Fdbae4169ef2c7681fca525cf3fcc90ba20121026-28170-l8r6hh-0

Actions #7

Updated by Dimitri Sapunou about 12 years ago

Related issues:
Defect #11263
Defect #11962

Actions #8

Updated by Etienne Massip about 12 years ago

Please test with no plugin installed.

Actions #9

Updated by Dimitri Sapunou about 12 years ago

Environment:
  Redmine version                          2.1.2.stable.10701
  Ruby version                             1.8.7 (x86_64-linux)
  Rails version                            3.2.8
  Environment                              production
  Database adapter                         MySQL
Redmine plugins:
  no plugin installed

Started GET "/projects/XX/repository/revisions/444/diff/trunk/XX/src/XX/SandboxBundle/Resources/views/extjs.html.twig" for XX.XX.XX.XX at Fri Oct 26 19:07:06 +0200 2012
Processing by RepositoriesController#diff as HTML
  Parameters: {"rev"=>"444", "id"=>"ris", "path"=>"trunk/XX/src/XX/SandboxBundle/Resources/views/extjs.html.twig"}
  Current user: sapunou (id=6)
Read fragment views/repositories/diff/1/aee1fc590eba6ca1cc4906d227fabb52 (0.2ms)
Read fragment views/repositories/diff/1/aee1fc590eba6ca1cc4906d227fabb52 (0.2ms)
  Rendered common/_diff.html.erb (3.3ms)
Write fragment views/repositories/diff/1/aee1fc590eba6ca1cc4906d227fabb52 (2.0ms)
  Rendered repositories/diff.html.erb within layouts/base (9.6ms)
Completed 500 Internal Server Error in 197ms

ActionView::Template::Error (wrong number of arguments (2 for 1)):
    14:   </p>
    15: <% end %>
    16:
    17: <% cache(@cache_key) do -%>
    18: <%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
    19: <% end -%>
    20:
  app/views/repositories/diff.html.erb:17:in `_app_views_repositories_diff_html_erb___2147035361_23764052918600'

Connecting to database specified by database.yml
OpenIdAuthentication.store is nil. Using in-memory store.
Actions #10

Updated by Etienne Massip about 12 years ago

Try to clean your cache with rake tmp:cache:clear?

Actions #11

Updated by Etienne Massip about 12 years ago

If it doesn't work, you can try to replace <% cache(@cache_key) do -%> with <% cache(@cache_key, nil) do -%> directly in the code.

Actions #12

Updated by Dimitri Sapunou about 12 years ago

<% cache(@cache_key, nil) do -%>

Not work.

Rendered repositories/show.html.erb within layouts/base (1136.7ms)
Completed 200 OK in 2143ms (Views: 1301.4ms | ActiveRecord: 35.1ms)

Started GET "/projects/XXX/repository/diff?utf8=%E2%9C%93&rev=448&rev_to=447" for XX.XX.XX.XX at Sun Oct 28 08:34:41 +0100 2012
Processing by RepositoriesController#diff as HTML
  Parameters: {"rev_to"=>"447", "rev"=>"448", "utf8"=>"â", "id"=>"XXX"}
  Current user: sapunou (id=6)
Read fragment views/repositories/diff/1/fe427eae45ecb2d336a115a14ad24e6a (0.2ms)
Read fragment views/repositories/diff/1/fe427eae45ecb2d336a115a14ad24e6a (0.2ms)
  Rendered common/_diff.html.erb (179.7ms)
Write fragment views/repositories/diff/1/fe427eae45ecb2d336a115a14ad24e6a (1.9ms)
  Rendered repositories/diff.html.erb within layouts/base (188.7ms)
Completed 500 Internal Server Error in 259ms

ActionView::Template::Error (wrong number of arguments (2 for 1)):
    14:   </p>
    15: <% end %>
    16:
    17: <% cache(@cache_key, nil) do -%>
    18: <%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
    19: <% end -%>
    20:
  app/views/repositories/diff.html.erb:17:in `_app_views_repositories_diff_html_erb___2147035361_23468958181600'

rake tmp:cache:clear
rake tmp:sessions:clear
touch tmp/restart.txt

TEST

less log/production.log

Actions #13

Updated by Dimitri Sapunou about 12 years ago

File views* is blank 0 byte files.
Is it ok?

l /opt/redmine-2.1/tmp/cache
-rw------- 1 apache apache    0 Oct 25 19:12 views%2Frepositories%2Fdiff%2F1%2Fdbae4169ef2c7681fca525cf3fcc90ba20121026-28170-l8r6hh-0

Actions #14

Updated by Dimitri Sapunou about 12 years ago

Solution

Upgrade Ruby version to 1.9.3

Environment:
  Redmine version                          2.1.2.stable.10701
  Ruby version                             1.9.3 (x86_64-linux)
  Rails version                            3.2.8
  Environment                              production
  Database adapter                         Mysql2
Redmine plugins:
  redirect_to_after_login                  0.0.2
  wiking                                   0.0.1b

It's Work!

How to upgrade Redmine 1.4 to Redmine 2.1

Actions #15

Updated by Holger Just almost 2 years ago

  • Status changed from Reopened to Closed
  • Priority changed from High to Normal
  • Resolution deleted (Cant reproduce)
Actions

Also available in: Atom PDF