GitLab 500 Internal Server Error - ActionView::Template::Error
Summary
Error 500 on many different commits over different projects when trying to view the commit information, especially for larger commits which involve many files.
Steps to reproduce
Click on commit comment to view commit Error 500
What is the current bug behavior?
Error 500
What is the expected correct behavior?
Commit changed files with diff
Relevant logs and/or screenshots
Completed 500 Internal Server Error in 36342ms (ActiveRecord: 29.9ms)
ActionView::Template::Error (4:Deadline Exceeded):
24: %a.diff-changed-file{ href: "##{hexdigest(diff_file.file_path)}", title: diff_file.new_path }
25: = sprite_icon(diff_file_changed_icon(diff_file), size: 16, css_class: "#{diff_file_changed_icon_color(diff_file)} diff-file-changed-icon append-right-8")
26: %span.diff-changed-file-content.append-right-8
27: - if diff_file.blob&.name
28: %strong.diff-changed-file-name
29: = diff_file.blob.name
30: - else
lib/gitlab/gitaly_client/blobs_stitcher.rb:15:in `each'
lib/gitlab/gitaly_client/blobs_stitcher.rb:15:in `each'
lib/gitlab/git/blob.rb:66:in `to_a'
lib/gitlab/git/blob.rb:66:in `batch'
lib/gitlab/git/repository.rb:782:in `batch_blobs'
app/models/repository.rb:528:in `blobs_at'
app/models/blob.rb:84:in `block in lazy'
lib/gitlab/diff/file.rb:118:in `new_blob'
lib/gitlab/diff/file.rb:140:in `blob'
app/views/projects/diffs/_stats.html.haml:27:in `block in _app_views_projects_diffs__stats_html_haml___1294283024597717059_69873895238120'
lib/gitlab/git/diff_collection.rb:43:in `each'
lib/gitlab/git/diff_collection.rb:43:in `each'
app/views/projects/diffs/_stats.html.haml:22:in `_app_views_projects_diffs__stats_html_haml___1294283024597717059_69873895238120'
app/views/projects/diffs/_diffs.html.haml:22:in `_app_views_projects_diffs__diffs_html_haml___2932552002743543355_69873894726980'
app/views/projects/commit/show.html.haml:16:in `_app_views_projects_commit_show_html_haml__518227794528004765_69873877304480'
app/controllers/application_controller.rb:116:in `render'
app/controllers/projects/commit_controller.rb:28:in `block (2 levels) in show'
app/controllers/projects/commit_controller.rb:26:in `show'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:420:in `set_locale'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:16:in `call'
lib/gitlab/middleware/go.rb:19:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/correlation_id.rb:15:in `use_id'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/read_only/controller.rb:40:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:20:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'
Output of checks
What checks should I run?
Results of GitLab environment info
System information
System: Ubuntu 18.04
Current User: git
Using RVM: no
Ruby Version: 2.5.3p105
Gem Version: 2.7.6
Bundler Version:1.16.6
Rake Version: 12.3.1
Redis Version: 3.2.12
Git Version: 2.18.1
Sidekiq Version:5.2.3
Go Version: unknown
GitLab information
Version: 11.6.3
Revision: bc9391c2944
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: <redacted>
HTTP Clone URL: <redacted>/some-group/some-project.git
SSH Clone URL: git@<redacted>:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers:
GitLab Shell
Version: 8.4.3
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.3 ? ... OK (8.4.3)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... 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: ...
5/1 ... yes
5/2 ... yes
5/3 ... yes
5/4 ... yes
5/5 ... yes
8/8 ... yes
9/9 ... yes
9/10 ... yes
9/11 ... yes
10/13 ... yes
10/14 ... yes
10/15 ... yes
10/16 ... yes
11/17 ... yes
12/18 ... yes
10/19 ... yes
12/20 ... yes
10/21 ... yes
13/22 ... yes
13/23 ... yes
10/24 ... yes
14/25 ... yes
12/26 ... yes
14/27 ... yes
16/28 ... yes
16/29 ... yes
16/30 ... yes
16/31 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.5.3)
Git version >= 2.18.0 ? ... yes (2.18.1)
Git user has default SSH configuration? ... yes
Active users: ... 8
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
Edited by Jeffrey Shen