Vote #72439
未完了Internal error when view the diff when using the redmine with git
0%
説明
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:
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_erb384619615619711618'
journals
--------------------------------------------------------------------------------
I cannot reproduce and all test passes.
http://www.redmine.org/builds/index.html
--------------------------------------------------------------------------------
hi! it`s new log for thie issue:
<pre>
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'
</pre>
I added the three repository and they do not work with the same problem (see log)
--------------------------------------------------------------------------------
Please give more details and read [[SubmittingBugs]].
This operation is tested.
source:tags/2.0.3/test/integration/repositories_git_test.rb#L45
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Internal error when view the diff when using the redmine with *SVN*
<pre>
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'
</pre>
<pre>
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
</pre>
Permission /opt/redmine-2.1/tmp/cache
<pre>
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
</pre>
--------------------------------------------------------------------------------
Related issues:
Defect #11263
Defect #11962
--------------------------------------------------------------------------------
Please test with no plugin installed.
--------------------------------------------------------------------------------
<pre>
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
</pre>
<pre>
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.
</pre>
--------------------------------------------------------------------------------
Try to clean your cache with @rake tmp:cache:clear@?
--------------------------------------------------------------------------------
If it doesn't work, you can try to replace @<% cache(@cache_key) do -%>@ with @<% cache(@cache_key, nil) do -%>@ directly in the code.
--------------------------------------------------------------------------------
<% cache(@cache_key, nil) do -%>
Not work.
<pre>
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'
</pre>
rake tmp:cache:clear
rake tmp:sessions:clear
touch tmp/restart.txt
TEST
less log/production.log
--------------------------------------------------------------------------------
File views* is blank 0 byte files.
Is it ok?
<pre>
l /opt/redmine-2.1/tmp/cache
-rw------- 1 apache apache 0 Oct 25 19:12 views%2Frepositories%2Fdiff%2F1%2Fdbae4169ef2c7681fca525cf3fcc90ba20121026-28170-l8r6hh-0
</pre>
--------------------------------------------------------------------------------
h2. Solution
*Upgrade Ruby version to 1.9.3*
<pre>
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
</pre>
*It's Work!*
"How to upgrade Redmine 1.4 to Redmine 2.1 (CentOS 5.8)":http://www.bilot.com/?p=1538
--------------------------------------------------------------------------------