500 error when creating new milestones - logs included

Whenever i try to add a milestone (any name) i get this error :

  • the name is unique and never used it before - tried several other names as well

:persevere:

==> /var/log/gitlab/gitlab-rails/production.log <==

ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint “index_milestones_on_project_id_and_iid”
DETAIL: Key (project_id, iid)=(29, 4) already exists.
: INSERT INTO “milestones” (“title”, “description”, “state”, “project_id”, “iid”, “created_at”, “updated_at”, “title_html”, “description_html”, “cached_markdown_version”) VALUES (‘sometitle’, ‘pilot’, ‘active’, 29, 4, ‘2018-07-26 13:27:16.634083’, ‘2018-07-26 13:27:16.634083’, ‘sometitle’, ‘

pilot

’, 11) RETURNING “id”):
config/initializers/active_record_locking.rb:11:in _create_record' app/services/milestones/create_service.rb:6:in execute’
app/controllers/projects/milestones_controller.rb:53:in create' lib/gitlab/i18n.rb:51:in with_locale’
lib/gitlab/i18n.rb:57:in with_user_locale' app/controllers/application_controller.rb:370:in set_locale’
lib/gitlab/middleware/multipart.rb:97: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:38: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’