Skip to content

ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_ci_pipelines_o...

https://sentry.gitlap.com/gitlab/gitlabcom/issues/286091/

PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_ci_pipelines_on_project_id_and_iid"
DETAIL:  Key (project_id, iid)=(7522015, 213) already exists.

  peek/views/pg.rb:17:in `async_exec'
    super(*args)
  peek/views/pg.rb:17:in `async_exec'
    super(*args)
  active_record/connection_adapters/postgresql_adapter.rb:592:in `block in exec_no_cache'
    log(sql, name, binds) { @connection.async_exec(sql, []) }
  active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
    :binds          => binds) { yield }
  active_support/notifications/instrumenter.rb:20:in `instrument'
    yield payload
...
(212 additional frame(s) were not displayed)

ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_ci_pipelines_on_project_id_and_iid"
DETAIL:  Key (project_id, iid)=(7522015, 213) already exists.
: INSERT INTO "ci_pipelines" ("status", "source", "project_id", "ref", "sha", "before_sha", "user_id", "protected", "config_source", "iid", "created_at", "updated_at") VALUES ('created', 2, 7522015, 'master', 'db0df1e0b1778c4d16caf2b3d01499672d3fbfb9', '0000000000000000000000000000000000000000', 56708, 't', 1, 213, '2018-07-20 12:29:25.294373', '2018-07-20 12:29:25.294373') RETURNING "id"

ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_ci_pipelines_on_project_id_and_iid"
DETAIL:  Key (project_id, iid)=(7522015, 213) already exists.
: INSERT INTO "ci_pipelines" ("status", "source", "project_id", "ref", "sha", "before_sha", "user_id", "protected", "config_source", "iid", "created_at", "updated_at") VALUES ('created', 2, 7522015, 'master', 'db0df1e0b1778c4d16caf2b3d01499672d3fbfb9', '0000000000000000000000000000000000000000', 56708, 't', 1, 213, '2018-07-20 12:29:25.294373', '2018-07-20 12:29:25.294373') RETURNING "id"