Error 500 when viewing old merge request
Summary
When we attempted to view old merge request (about a year old or so), we've got error 500.
Steps to reproduce
- Open merge request created about a year ago.
- Observe Error 500.
Expected behavior
Merge request should be shown.
Actual behavior
Error 500 shown.
Relevant logs and/or screenshots
Completed 500 Internal Server Error in 1416ms (ActiveRecord: 492.1ms)
ActionView::Template::Error (undefined method `text?' for nil:NilClass):
72: %li.diffs-tab
73: = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: { target: 'div#diffs', action: 'diffs', toggle: 'tab' } do
74: Changes
75: %span.badge= @merge_request.diff_size
76: %li#resolve-count-app.line-resolve-all-container.pull-right.prepend-top-10.hidden-xs{ "v-cloak" => true }
77: %resolve-count{ "inline-template" => true, ":logged-out" => "#{current_user.nil?}" }
78: %div
lib/gitlab/diff/file_collection/merge_request_diff.rb:64:in `cacheable?'
lib/gitlab/diff/file_collection/merge_request_diff.rb:23:in `decorate_diff!'
lib/gitlab/diff/file_collection/base.rb:24:in `block in diff_files'
lib/gitlab/diff/file_collection/base.rb:24:in `diff_files'
lib/gitlab/diff/file_collection/merge_request_diff.rb:15:in `diff_files'
lib/gitlab/diff/file_collection/base.rb:7:in `size'
app/models/merge_request.rb:209:in `diff_size'
app/views/projects/merge_requests/_show.html.haml:75:in `block in _app_views_projects_merge_requests__show_html_haml__3157434656234278208_69820301988120'
app/views/projects/merge_requests/_show.html.haml:73:in `_app_views_projects_merge_requests__show_html_haml__3157434656234278208_69820301988120'
app/views/projects/merge_requests/show.html.haml:1:in `_app_views_projects_merge_requests_show_html_haml___2919749644147331752_69820300608100'
lib/gitlab/request_profiler/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
lib/gitlab/middleware/readonly_geo.rb:29:in `call'
Output of checks
Results of GitLab application Check
$ sudo gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 4.0.0 ? ... OK (4.0.0)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
10/11 ... ok
10/14 ... ok
10/15 ... ok
10/18 ... ok
2/19 ... ok
2/20 ... ok
10/21 ... ok
10/22 ... ok
10/23 ... ok
2/25 ... ok
2/26 ... ok
5/27 ... ok
11/28 ... ok
13/29 ... ok
2/31 ... ok
13/32 ... ok
10/33 ... ok
5/34 ... ok
14/35 ... ok
14/36 ... ok
14/37 ... ok
5/38 ... ok
5/39 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
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 ...
IMAP server credentials are correct? ... yes
Init.d configured correctly? ... skipped (omnibus-gitlab has no init script)
MailRoom running? ... can't check because of previous errors
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
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? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
10/11 ... yes
10/14 ... yes
10/15 ... yes
10/18 ... yes
2/19 ... yes
2/20 ... yes
10/21 ... yes
10/22 ... yes
10/23 ... yes
2/25 ... yes
2/26 ... yes
5/27 ... yes
11/28 ... yes
13/29 ... yes
2/31 ... yes
13/32 ... yes
10/33 ... yes
5/34 ... yes
14/35 ... yes
14/36 ... yes
14/37 ... yes
5/38 ... yes
5/39 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 5
Checking GitLab ... Finished
Results of GitLab environment info
$ sudo gitlab-rake gitlab:env:info
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.6.6
Bundler Version:1.13.6
Rake Version: 10.5.0
Sidekiq Version:4.2.1
GitLab information
Version: 8.14.2-ee
Revision: b4c40a5
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 9.2.18
URL: https://hidden.url
HTTP Clone URL: https://hidden.url/some-group/some-project.git
SSH Clone URL: git@hidden.url:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 4.0.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Possible fixes
Unknown.