500 error when viewing merge request
Summary
When trying to view an old merge request, GitLab throws a 500 error. Recent merge requests work fine, but I have several that suffer this issue.
Steps to reproduce
Follow the link to the issue such as http://our_server/group/project/merge_requests/NUMBER
Expected behavior
Show the merge request.
Relevant logs and/or screenshots
From production.log:
Started GET "/mall/mall/merge_requests/794" for 127.0.0.1 at 2016-04-06 11:05:47 +0200
Processing by Projects::MergeRequestsController#show as HTML
Parameters: {"namespace_id"=>"mall", "project_id"=>"mall", "id"=>"794"}
Completed 500 Internal Server Error in 577ms (ActiveRecord: 21.8ms)
ActionView::Template::Error (Invalid raw diff type: Grit::Diff):
64: %li.diffs-tab
65: = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
66: Changes
67: %span.badge= @merge_request.diff_size
68:
69: .tab-content
70: #notes.notes.tab-pane.voting_notes
app/models/merge_request_diff.rb:48:in `size'
app/models/merge_request.rb:199:in `diff_size'
app/views/projects/merge_requests/_show.html.haml:67:in `block in _app_views_projects_merge_requests__show_html_haml__3023763848050708349_70088160170180'
app/views/projects/merge_requests/_show.html.haml:65:in `_app_views_projects_merge_requests__show_html_haml__3023763848050708349_70088160170180'
app/views/projects/merge_requests/show.html.haml:1:in `_app_views_projects_merge_requests_show_html_haml___178418565415621817_70088160014600'
app/controllers/projects/merge_requests_controller.rb:57:in `show'
lib/gitlab/middleware/go.rb:16:in `call'
Output of checks
Results of GitLab Application Check
Checking GitLab Shell ...
GitLab Shell version >= 2.6.11 ? ... OK (2.6.12)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
hooks directories in repos are links: ...
79/2 ... ok
5/3 ... repository is empty
6/5 ... ok
55/7 ... ok
73/8 ... ok
73/9 ... ok
73/10 ... ok
48/11 ... ok
73/12 ... ok
13/13 ... ok
13/14 ... ok
73/16 ... ok
71/20 ... ok
71/21 ... ok
78/25 ... ok
5/26 ... repository is empty
5/27 ... ok
73/28 ... ok
84/31 ... ok
84/32 ... ok
84/33 ... ok
43/35 ... ok
48/43 ... ok
55/50 ... ok
55/52 ... ok
71/53 ... ok
77/55 ... ok
55/56 ... ok
55/59 ... ok
61/60 ... ok
73/61 ... ok
55/62 ... ok
87/63 ... ok
73/64 ... ok
71/65 ... ok
87/66 ... ok
62/69 ... ok
86/72 ... ok
73/73 ... ok
30/75 ... ok
72/76 ... ok
72/77 ... ok
71/78 ... ok
84/80 ... ok
73/82 ... ok
5/85 ... repository is empty
33/86 ... ok
70/87 ... ok
73/88 ... ok
72/90 ... ok
72/91 ... ok
72/92 ... ok
48/93 ... ok
73/94 ... ok
48/96 ... ok
73/97 ... ok
73/98 ... ok
72/100 ... ok
55/101 ... ok
52/102 ... ok
86/103 ... repository is empty
55/105 ... ok
55/106 ... ok
73/107 ... ok
86/108 ... ok
86/109 ... ok
72/110 ... ok
55/112 ... ok
72/113 ... ok
55/114 ... ok
72/120 ... ok
88/121 ... ok
72/122 ... ok
73/123 ... ok
73/124 ... ok
55/125 ... ok
73/127 ... repository is empty
72/129 ... ok
73/130 ... ok
73/131 ... ok
49/132 ... ok
4/133 ... ok
5/134 ... ok
86/135 ... ok
72/136 ... ok
72/137 ... ok
55/144 ... ok
77/145 ... ok
72/146 ... ok
86/147 ... ok
72/149 ... ok
5/151 ... repository is empty
13/152 ... ok
77/153 ... ok
73/154 ... ok
55/155 ... ok
73/157 ... ok
55/158 ... ok
86/159 ... ok
72/160 ... ok
72/161 ... ok
72/162 ... ok
77/163 ... ok
73/164 ... ok
73/165 ... ok
33/166 ... ok
86/167 ... ok
86/168 ... ok
73/169 ... ok
72/170 ... ok
95/172 ... ok
95/173 ... ok
95/174 ... ok
95/175 ... ok
48/177 ... ok
95/178 ... ok
95/179 ... ok
95/180 ... ok
33/181 ... ok
55/182 ... ok
33/183 ... ok
13/184 ... ok
72/185 ... ok
73/186 ... ok
106/187 ... ok
95/188 ... ok
86/189 ... ok
66/190 ... ok
54/191 ... ok
5/192 ... ok
73/193 ... ok
30/194 ... ok
91/195 ... ok
95/196 ... ok
4/197 ... ok
72/198 ... ok
4/199 ... ok
95/200 ... ok
69/201 ... ok
95/202 ... ok
48/203 ... ok
4/204 ... ok
95/205 ... ok
95/207 ... ok
73/208 ... ok
3/209 ... ok
86/210 ... ok
4/211 ... ok
95/212 ... ok
72/214 ... ok
66/215 ... ok
6/216 ... ok
95/217 ... ok
4/218 ... ok
4/219 ... ok
72/220 ... ok
72/222 ... ok
4/223 ... ok
78/224 ... ok
78/225 ... ok
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.4.10
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP users with access to your GitLab server (only showing the first 100 results)
Server: ldapmain
(REMOVED)
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ...
79/2 ... yes
5/3 ... yes
6/5 ... yes
55/7 ... yes
73/8 ... yes
73/9 ... yes
73/10 ... yes
48/11 ... yes
73/12 ... yes
13/13 ... yes
13/14 ... yes
73/16 ... yes
71/20 ... yes
71/21 ... yes
78/25 ... yes
5/26 ... yes
5/27 ... yes
73/28 ... yes
84/31 ... yes
84/32 ... yes
84/33 ... yes
43/35 ... yes
48/43 ... yes
55/50 ... yes
55/52 ... yes
71/53 ... yes
77/55 ... yes
55/56 ... yes
55/59 ... yes
61/60 ... yes
73/61 ... yes
55/62 ... yes
87/63 ... yes
73/64 ... yes
71/65 ... yes
87/66 ... yes
62/69 ... yes
86/72 ... yes
73/73 ... yes
30/75 ... yes
72/76 ... yes
72/77 ... yes
71/78 ... yes
84/80 ... yes
73/82 ... yes
5/85 ... yes
33/86 ... yes
70/87 ... yes
73/88 ... yes
72/90 ... yes
72/91 ... yes
72/92 ... yes
48/93 ... yes
73/94 ... yes
48/96 ... yes
73/97 ... yes
73/98 ... yes
72/100 ... yes
55/101 ... yes
52/102 ... yes
86/103 ... yes
55/105 ... yes
55/106 ... yes
73/107 ... yes
86/108 ... yes
86/109 ... yes
72/110 ... yes
55/112 ... yes
72/113 ... yes
55/114 ... yes
72/120 ... yes
88/121 ... yes
72/122 ... yes
73/123 ... yes
73/124 ... yes
55/125 ... yes
73/127 ... yes
72/129 ... yes
73/130 ... yes
73/131 ... yes
49/132 ... yes
4/133 ... yes
5/134 ... yes
86/135 ... yes
72/136 ... yes
72/137 ... yes
55/144 ... yes
77/145 ... yes
72/146 ... yes
86/147 ... yes
72/149 ... yes
5/151 ... yes
13/152 ... yes
77/153 ... yes
73/154 ... yes
55/155 ... yes
73/157 ... yes
55/158 ... yes
86/159 ... yes
72/160 ... yes
72/161 ... yes
72/162 ... yes
77/163 ... yes
73/164 ... yes
73/165 ... yes
33/166 ... yes
86/167 ... yes
86/168 ... yes
73/169 ... yes
72/170 ... yes
95/172 ... yes
95/173 ... yes
95/174 ... yes
95/175 ... yes
48/177 ... yes
95/178 ... yes
95/179 ... yes
95/180 ... yes
33/181 ... yes
55/182 ... yes
33/183 ... yes
13/184 ... yes
72/185 ... yes
73/186 ... yes
106/187 ... yes
95/188 ... yes
86/189 ... yes
66/190 ... yes
54/191 ... yes
5/192 ... yes
73/193 ... yes
30/194 ... yes
91/195 ... yes
95/196 ... yes
4/197 ... yes
72/198 ... yes
4/199 ... yes
95/200 ... yes
69/201 ... yes
95/202 ... yes
48/203 ... yes
4/204 ... yes
95/205 ... yes
95/207 ... yes
73/208 ... yes
3/209 ... yes
86/210 ... yes
4/211 ... yes
95/212 ... yes
72/214 ... yes
66/215 ... yes
6/216 ... yes
95/217 ... yes
4/218 ... yes
4/219 ... yes
72/220 ... yes
72/222 ... yes
4/223 ... yes
78/224 ... yes
78/225 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.6)
Your git bin path is "/usr/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 54
Checking GitLab ... Finished
Results of GitLab Environment Info
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.1.6p336
Gem Version: 2.2.3
Bundler Version:1.11.2
Rake Version: 10.5.0
Sidekiq Version:4.0.1
GitLab information
Version: 8.6.1
Revision: a96d737
Directory: /home/git/gitlab
DB Adapter: postgresql
URL: http://gitlab.mall.local
HTTP Clone URL: http://gitlab.mall.local/some-group/some-project.git
SSH Clone URL: git@gitlab.mall.local:some-group/some-project.git
Using LDAP: yes
Using Omniauth: yes
Omniauth Providers:
GitLab Shell
Version: 2.6.12
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git