Getting Error 500 when viewing some commits
Summary
When viewing a single commit of a project, we sometimes get an 500 internal server error.
Steps to reproduce
In a project, go to the list of commits and open a commit. Usually, this works just fine, but for some commit, we get the error.
What is the current bug behavior?
When viewing some commits, we get a 500 error.
What is the expected correct behavior?
The details of the commit shall be shown.
Relevant logs and/or screenshots
From the Rails production log:
ActionView::Template::Error (undefined method `size' for nil:NilClass):
11: .wrap
12: - single_class_name = diff_file.deleted_file? ? 'deleted' : 'added'
13: = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "#{single_class_name} #{class_name} js-image-frame", position: position, note_type: DiffNote.name, image_path: blob_raw_url, alt: diff_file.file_path }
14: %p.image-info= number_to_human_size(blob.size)
app/views/projects/diffs/_single_image_diff.html.haml:14:in `_app_views_projects_diffs__single_image_diff_html_haml__3079303475998112799_70205964059160'
app/views/projects/diffs/viewers/_image.html.haml:8:in `_app_views_projects_diffs_viewers__image_html_haml___849404389953733317_70205964277720'
app/views/projects/diffs/_viewer.html.haml:16:in `_app_views_projects_diffs__viewer_html_haml__2754287134838250755_70206048466600'
app/views/projects/diffs/_content.html.haml:2:in `_app_views_projects_diffs__content_html_haml___2495490478774309286_70206047779980'
app/views/projects/diffs/_file.html.haml:31:in `_app_views_projects_diffs__file_html_haml___3351478076248511302_70206043698220'
app/views/projects/diffs/_diffs.html.haml:28:in `_app_views_projects_diffs__diffs_html_haml___3919639686664812811_70205952371360'
app/views/projects/commit/show.html.haml:16:in `_app_views_projects_commit_show_html_haml__1649550514271936548_70205950647360'
app/controllers/application_controller.rb:114: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:53:in `with_locale'
lib/gitlab/i18n.rb:59:in `with_user_locale'
app/controllers/application_controller.rb:432:in `set_locale'
lib/gitlab/middleware/multipart.rb:101:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
ee/lib/gitlab/jira/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:17:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/middleware/read_only/controller.rb:40:in `call'
lib/gitlab/middleware/read_only.rb:16:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
lib/gitlab/middleware/release_env.rb:10:in `call'
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 2.4.5p335 Gem Version: 2.7.6 Bundler Version:1.16.2 Rake Version: 12.3.1 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.1 Go Version: unknownGitLab information Version: 11.4.5-ee Revision: bf6db46 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.8 URL: https://gitlab.commsolid.com HTTP Clone URL: https://gitlab.commsolid.com/some-group/some-project.git SSH Clone URL: ssh://git@gitlab.commsolid.com:2201/some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 8.3.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