500 error on merge reqeust

post update to 11.0.4 we are getting 500 error on creating merge requests have checked the DB migrate logs, they show a good return code. restart and reconfigured gitlab, did a gitlab-rake db:migrate

A gitlab-rake db:migrate:status dose not show any problems jobs (as I would expect from looking at the logs of the migrations).

New branches repositories are ok and work.

======production.log======== Completed 500 Internal Server Error in 125ms (ActiveRecord: 68.1ms)

ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_merge_requests_on_target_project_id_and_iid" DETAIL: Key (target_project_id, iid)=(XXXX, XXX) already exists.
INSERT INTO "merge_requests" ("merge_params", "target_project_id", "source_project_id", "source_branch", "assignee_id", "description", "target_branch", "title", "author_id", "iid", "created_at", "updated_at", "title_html", "description_html", "cached_markdown_version", "time_estimate") VALUES ('--- force_remove_source_branch: ''0'' ', 3249, 3249, 'st-915', 338, 'Closes st-915', 'Dev', 'Resolve st-915', 538, 447, '2018-07-24 13:45:10.168425', '2018-07-24 13:45:10.168425', 'Resolve st-915', '

Closes st-915

', 3, 0) RETURNING "id"): config/initializers/active_record_locking.rb:15:in _create_record' app/services/issuable_base_service.rb:132:in block in create_issuable' app/services/issuable_base_service.rb:131:in create_issuable' app/services/issuable_base_service.rb:151:in create' app/services/merge_requests/create_service.rb:34:in create' app/services/merge_requests/create_service.rb:12:in execute' app/controllers/projects/merge_requests/creations_controller.rb:21:in create' lib/gitlab/i18n.rb:50:in with_locale' lib/gitlab/i18n.rb:56:in with_user_locale' app/controllers/application_controller.rb:362:in set_locale' lib/gitlab/middleware/multipart.rb:95:in call' lib/gitlab/request_profiler/middleware.rb:14: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:28:in call' lib/gitlab/middleware/read_only.rb:16: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'
Edited Jul 07, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading