UpdateMergeRequestsWorker: ActiveRecord::RecordInvalid: Validation failed: Merge request has already been taken
https://sentry.gitlab.net/gitlab/gitlabcom/issues/836086/
ActiveRecord::RecordInvalid: Validation failed: Merge request has already been taken
from active_record/validations.rb:78:in `raise_validation_error'
from active_record/validations.rb:50:in `save!'
from active_record/attribute_methods/dirty.rb:43:in `save!'
from active_record/transactions.rb:313:in `block in save!'
from active_record/transactions.rb:384:in `block in with_transaction_returning_status'
from active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
from active_record/transactions.rb:210:in `transaction'
from active_record/transactions.rb:381:in `with_transaction_returning_status'
from active_record/transactions.rb:313:in `save!'
from active_record/suppressor.rb:46:in `save!'
from active_record/associations/collection_association.rb:369:in `insert_record'
from active_record/associations/has_many_association.rb:34:in `insert_record'
from active_record/associations/collection_association.rb:360:in `block (2 levels) in _create_record'
from active_record/associations/collection_association.rb:447:in `replace_on_target'
from active_record/associations/collection_association.rb:281:in `add_to_target'
from active_record/associations/collection_association.rb:358:in `block in _create_record'
from active_record/associations/collection_association.rb:129:in `block in transaction'
from active_record/connection_adapters/abstract/database_statements.rb:233:in `transaction'
from active_record/transactions.rb:210:in `transaction'
from active_record/associations/collection_association.rb:128:in `transaction'
from active_record/associations/collection_association.rb:357:in `_create_record'
from active_record/associations/has_many_association.rb:121:in `_create_record'
from active_record/associations/association.rb:200:in `create!'
from active_record/associations/collection_proxy.rb:363:in `create!'
from merge_request.rb:905:in `block (2 levels) in cache_merge_request_closes_issues!'
from merge_request.rb:902:in `each'
from merge_request.rb:902:in `block in cache_merge_request_closes_issues!'
from active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
from active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
from monitor.rb:230:in `mon_synchronize'
from active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
from active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
from active_record/transactions.rb:210:in `transaction'
from active_record/transactions.rb:299:in `transaction'
from gitlab/database.rb:322:in `transaction'
from merge_request.rb:899:in `cache_merge_request_closes_issues!'
from gitlab/metrics/instrumentation.rb:161:in `block in cache_merge_request_closes_issues!'
from gitlab/metrics/method_call.rb:36:in `measure'
from gitlab/metrics/instrumentation.rb:161:in `cache_merge_request_closes_issues!'
from merge_requests/refresh_service.rb:245:in `block in cache_merge_requests_closing_issues'
from active_record/relation/delegation.rb:39:in `each'
from active_record/relation/delegation.rb:39:in `each'
from merge_requests/refresh_service.rb:244:in `cache_merge_requests_closing_issues'
from gitlab/metrics/instrumentation.rb:161:in `block in cache_merge_requests_closing_issues'
from gitlab/metrics/method_call.rb:36:in `measure'
from gitlab/metrics/instrumentation.rb:161:in `cache_merge_requests_closing_issues'
from merge_requests/refresh_service.rb:29:in `refresh_merge_requests!'
from ee/merge_requests/refresh_service.rb:13:in `block in refresh_merge_requests!'
from ee/merge_requests/refresh_service.rb:41:in `update_approvers'
from ee/merge_requests/refresh_service.rb:12:in `refresh_merge_requests!'
from merge_requests/refresh_service.rb:11:in `execute'
from gitlab/metrics/instrumentation.rb:161:in `block in execute'
from gitlab/metrics/method_call.rb:36:in `measure'
from gitlab/metrics/instrumentation.rb:161:in `execute'
from update_merge_requests_worker.rb:18:in `block in perform'
...
Validation failed: Merge request has already been taken
Edited by Nick Thomas