Error 500 when trying to view some commits
Summary
When I'm trying to view some commits, I'm getting "something went wrong on our end" error 500 page.
sudo gitlab-ctl tail
output:
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/sampleprojects/SampleProject/commit/49dadfe8892c27a9c765b51d0bc145629dfefbf2" for 192.168.20.241 at 2017-04-05 15:11:50 +0300
Processing by Projects::CommitController#show as HTML
Parameters: {"namespace_id"=>"sampleprojects", "project_id"=>"SampleProject", "id"=>"49dadfe8892c27a9c765b51d0bc145629dfefbf2"}
Completed 500 Internal Server Error in 47ms (ActiveRecord: 9.6ms)
ActionView::Template::Error (no implicit conversion of nil into String):
16: Click to expand it.
17: - elsif diff_file.diff_lines.length > 0
18: - total_lines = 0
19: - if blob.lines.any?
20: - total_lines = blob.lines.last.chomp == '' ? blob.lines.size - 1 : blob.lines.size
21: - if diff_view == :parallel
22: = render "projects/diffs/parallel_view", diff_file: diff_file, total_lines: total_lines
app/views/projects/diffs/_content.html.haml:19:in `_app_views_projects_diffs__content_html_haml__2560791524943726838_70283635743060'
app/views/projects/diffs/_file.html.haml:21:in `_app_views_projects_diffs__file_html_haml___58867326088432700_70283633616040'
app/views/projects/diffs/_diffs.html.haml:33:in `block in _app_views_projects_diffs__diffs_html_haml___2963763978136095072_70283631091160'
lib/gitlab/git/diff_collection.rb:29:in `each'
lib/gitlab/git/diff_collection.rb:29:in `each'
app/views/projects/diffs/_diffs.html.haml:26:in `each_with_index'
app/views/projects/diffs/_diffs.html.haml:26:in `_app_views_projects_diffs__diffs_html_haml___2963763978136095072_70283631091160'
app/views/projects/commit/show.html.haml:12:in `_app_views_projects_commit_show_html_haml___3423296794603200211_70283616695160'
app/controllers/projects/commit_controller.rb:21:in `show'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
lib/gitlab/etag_caching/middleware.rb:14:in `call'
lib/gitlab/request_context.rb:18:in `call'
==> /var/log/gitlab/gitlab-workhorse/current <==
2017-04-05_12:11:50.52532 2017/04/05 15:11:50 ErrorPage: serving predefined error page: 500
2017-04-05_12:11:50.52542 git.example.ua @ - - [2017-04-05 15:11:50.454365465 +0300 EEST] "GET /sampleprojects/SampleProject/commit/49dadfe8892c27a9c765b51d0bc145629dfefbf2 HTTP/1.1" 500 2648 "https://git.example.ua/sampleprojects/SampleProject/commits/add-sqlite" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36" 0.071022
==> /var/log/gitlab/nginx/gitlab_access.log <==
192.168.20.241 - - [05/Apr/2017:15:11:50 +0300] "GET /sampleprojects/SampleProject/commit/49dadfe8892c27a9c765b51d0bc145629dfefbf2 HTTP/2.0" 500 2857 "https://git.example.ua/sampleprojects/SampleProject/commits/add-sqlite" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36"
Output of checks
Results of GitLab environment info
sudo gitlab-rake gitlab:env:info
output:
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Redis Version: 3.2.5
Git Version: 2.10.2
Sidekiq Version:4.2.7
GitLab information
Version: 9.0.2
Revision: 3e59fd2
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://git.example.ua
HTTP Clone URL: https://git.example.ua/some-group/some-project.git
SSH Clone URL: git@git.example.ua:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 5.0.0
Repository storage paths:
- default: /home/git/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
sudo gitlab-rake gitlab:check SANITIZE=true
output:
Checking GitLab Shell ...
GitLab Shell version >= 5.0.0 ? ... OK (5.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: ...
3/3 ... ok
3/4 ... ok
3/5 ... ok
3/6 ... ok
3/7 ... ok
3/8 ... ok
3/9 ... ok
15/10 ... ok
15/11 ... ok
3/12 ... ok
3/13 ... ok
3/16 ... ok
3/17 ... ok
10/18 ... ok
21/19 ... ok
10/21 ... ok
12/22 ... ok
3/24 ... ok
3/25 ... ok
3/26 ... ok
28/27 ... ok
34/28 ... ok
33/29 ... ok
34/30 ... ok
34/34 ... ok
34/35 ... ok
34/36 ... ok
8/37 ... ok
34/38 ... ok
34/39 ... ok
34/40 ... ok
34/41 ... ok
8/42 ... ok
21/43 ... ok
26/44 ... ok
3/45 ... ok
34/47 ... ok
34/48 ... ok
34/49 ... ok
34/50 ... ok
34/51 ... ok
39/52 ... repository is empty
12/53 ... ok
34/54 ... ok
34/55 ... ok
34/56 ... ok
3/58 ... ok
3/59 ... ok
3/60 ... ok
3/61 ... ok
3/62 ... ok
3/63 ... ok
3/64 ... ok
12/65 ... ok
4/66 ... ok
33/68 ... ok
3/69 ... ok
34/70 ... ok
40/72 ... ok
34/73 ... ok
40/74 ... ok
6/75 ... ok
34/76 ... ok
2/77 ... ok
12/78 ... ok
44/80 ... ok
3/81 ... ok
3/86 ... ok
4/89 ... ok
40/90 ... ok
34/91 ... ok
11/93 ... ok
40/94 ... ok
40/95 ... ok
40/96 ... ok
40/97 ... ok
51/100 ... ok
33/101 ... ok
51/102 ... ok
51/103 ... repository is empty
52/104 ... repository is empty
40/105 ... ok
1/106 ... ok
33/107 ... ok
3/108 ... ok
29/109 ... ok
10/110 ... ok
3/111 ... ok
58/112 ... ok
3/114 ... ok
3/115 ... ok
34/116 ... ok
34/117 ... ok
3/119 ... ok
32/120 ... ok
33/121 ... 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 ...
Reply by email is disabled in config/gitlab.yml
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: ...
3/3 ... yes
3/4 ... yes
3/5 ... yes
3/6 ... yes
3/7 ... yes
3/8 ... yes
3/9 ... yes
15/10 ... yes
15/11 ... yes
3/12 ... yes
3/13 ... yes
3/16 ... yes
3/17 ... yes
10/18 ... yes
21/19 ... yes
10/21 ... yes
12/22 ... yes
3/24 ... yes
3/25 ... yes
3/26 ... yes
28/27 ... yes
34/28 ... yes
33/29 ... yes
34/30 ... yes
34/34 ... yes
34/35 ... yes
34/36 ... yes
8/37 ... yes
34/38 ... yes
34/39 ... yes
34/40 ... yes
34/41 ... yes
8/42 ... yes
21/43 ... yes
26/44 ... yes
3/45 ... yes
34/47 ... yes
34/48 ... yes
34/49 ... yes
34/50 ... yes
34/51 ... yes
39/52 ... yes
12/53 ... yes
34/54 ... yes
34/55 ... yes
34/56 ... yes
3/58 ... yes
3/59 ... yes
3/60 ... yes
3/61 ... yes
3/62 ... yes
3/63 ... yes
3/64 ... yes
12/65 ... yes
4/66 ... yes
33/68 ... yes
3/69 ... yes
34/70 ... yes
40/72 ... yes
34/73 ... yes
40/74 ... yes
6/75 ... yes
34/76 ... yes
2/77 ... yes
12/78 ... yes
44/80 ... yes
3/81 ... yes
3/86 ... yes
4/89 ... yes
40/90 ... yes
34/91 ... yes
11/93 ... yes
40/94 ... yes
40/95 ... yes
40/96 ... yes
40/97 ... yes
51/100 ... yes
33/101 ... yes
51/102 ... yes
51/103 ... yes
52/104 ... yes
40/105 ... yes
1/106 ... yes
33/107 ... yes
3/108 ... yes
29/109 ... yes
10/110 ... yes
3/111 ... yes
58/112 ... yes
3/114 ... yes
3/115 ... yes
34/116 ... yes
34/117 ... yes
3/119 ... yes
32/120 ... yes
33/121 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.10.2)
Active users: 45
Checking GitLab ... Finished