Error 500 a on merge request
Summary
Got an unexpected 500 error on loading the page a of MR.
Steps to reproduce
The merge requests is publicly accessible here: https://forge.extranet.logilab.fr/open-source/yams/merge_requests/3
I do not know how to reproduce this bug. I have been unable to reproduce it on a test repository.
What is the current bug behavior?
A 500 error is raised
What is the expected correct behavior?
See the actual MR.
Relevant logs and/or screenshots
Started GET "/open-source/yams/merge_requests/3" for 93.26.58.90 at 2020-04-15 09:58:10 +0000
Processing by Projects::MergeRequestsController#show as HTML
Parameters: {"namespace_id"=>"open-source", "project_id"=>"yams", "id"=>"3"}
Completed 500 Internal Server Error in 62ms (ActiveRecord: 9.9ms)
NoMethodError (undefined method `target' for nil:NilClass):
lib/gitlab/git/repository.rb:753:in `can_hg_merge?'
app/services/merge_requests/mergeability_check_service.rb:157:in `can_hg_merge?'
app/services/merge_requests/mergeability_check_service.rb:120:in `update_merge_status'
app/services/merge_requests/mergeability_check_service.rb:55:in `check_mergeability'
app/services/merge_requests/mergeability_check_service.rb:43:in `block in execute'
lib/gitlab/exclusive_lease_helpers.rb:29:in `in_lock'
app/services/merge_requests/mergeability_check_service.rb:90:in `in_write_lock'
app/services/merge_requests/mergeability_check_service.rb:37:in `execute'
app/models/merge_request.rb:777:in `check_mergeability'
app/controllers/projects/merge_requests_controller.rb:37:in `show'
app/controllers/application_controller.rb:544:in `block in allow_gitaly_ref_name_caching'
lib/gitlab/gitaly_client.rb:300:in `allow_ref_name_caching'
app/controllers/application_controller.rb:543:in `allow_gitaly_ref_name_caching'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:461:in `set_session_storage'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:455:in `set_locale'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
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:26:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'
Possible fixes
The MR which fails to load has for topic « type_annotations » which is the same as the MR n°2, which has been successfuly merged. I dont know if this is related or not.