Long commit message causes 500 error on project details page
Summary
The Project overview "Details" page https://gitlab.com/<group>/<project>
raises Error 500 on a GET method with URL: http://gitlab.com/<group>/<project>/-/refs/master/logs_tree/?format=json&offset=0
The Problem can be reproduced when using a very long commit message (see attached file). By removing the last 50 lines from the file, the problem does not seem to happen any more.
Steps to reproduce
-
Create a repository, add 3+ new files to it (2 was not enough, and all files must be within the same commit):
touch test1 test2 test3
-
Add all 3 files to the commit:
git add test1 test2 test3
. It's important that at least 3 files are added to the same commit, committing them one by one does not trigger this bug. -
Create a file named "commit_message" with the contents of the attached file (this makes it easier to add it to the commit). This will be our very long commit message.
-
Create the commit with:
git commit -F ./commit_message
-
Push changes to GitLab:
git push -u origin master
-
Go to the Project page:
Project overview -> Details
. GitLab will not load the last commits for the added files.
Example Project
https://gitlab.com/dnldnz/too-long-commit-message
What is the current bug behaviour?
Commit messages are not displayed for the repository files. GET
Call to fetch this data raises a 500 exception.
What is the expected correct behaviour?
Commit messages should be displayed for all files in the project overview.
Relevant logs and/or screenshots
production.log ruby stacktrace
Completed 500 Internal Server Error in 273ms (ActiveRecord: 53.2ms | Elasticsearch: 0.0ms | Allocations: 59153)
TypeError (singleton can't be dumped):
lib/gitlab/tree_summary.rb:109:in `fetch_last_cached_commits_list'
lib/gitlab/tree_summary.rb:91:in `fill_last_commits!'
lib/gitlab/tree_summary.rb:43:in `block in summarize'
lib/gitlab/tree_summary.rb:43:in `tap'
lib/gitlab/tree_summary.rb:43:in `summarize'
ee/lib/ee/gitlab/tree_summary.rb:12:in `summarize'
lib/gitlab/tree_summary.rb:49:in `fetch_logs'
app/controllers/projects/refs_controller.rb:52:in `block (2 levels) in logs_tree'
app/controllers/projects/refs_controller.rb:49:in `logs_tree'
app/controllers/application_controller.rb:549:in `block in allow_gitaly_ref_name_caching'
lib/gitlab/gitaly_client.rb:318:in `allow_ref_name_caching'
app/controllers/application_controller.rb:548:in `allow_gitaly_ref_name_caching'
ee/lib/gitlab/ip_address_state.rb:10:in `with'
ee/app/controllers/ee/application_controller.rb:44:in `set_current_ip_address'
app/controllers/application_controller.rb:494:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:485:in `set_session_storage'
lib/gitlab/i18n.rb:73:in `with_locale'
lib/gitlab/i18n.rb:79:in `with_user_locale'
app/controllers/application_controller.rb:479:in `set_locale'
lib/gitlab/error_tracking.rb:52:in `with_context'
app/controllers/application_controller.rb:544:in `sentry_context'
app/controllers/application_controller.rb:472:in `block in set_current_context'
lib/gitlab/application_context.rb:54:in `block in use'
lib/gitlab/application_context.rb:54:in `use'
lib/gitlab/application_context.rb:21:in `with_context'
app/controllers/application_controller.rb:464:in `set_current_context'
lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'
lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'
lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'
lib/gitlab/metrics/transaction.rb:56:in `run'
lib/gitlab/metrics/rack_middleware.rb:16:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:21:in `call'
lib/gitlab/middleware/multipart.rb:234:in `call'
lib/gitlab/middleware/read_only/controller.rb:50:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:23:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:76:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'
Output of checks
This bug happens on GitLab.com