ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_vulnerability_...
https://sentry.gitlab.net/gitlab/gitlabcom/issues/3165625/?referrer=gitlab_plugin
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_vulnerability_occurrences_on_unique_keys"
DETAIL: Key (project_id, primary_identifier_id, location_fingerprint, scanner_id)=(15642544, 1083447, \x27e5fbd2c567177e351b0b77385e48a275e66f26, 8489) already exists.
lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
connection.send(...)
lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
yield connection
lib/gitlab/database/load_balancing/load_balancer.rb:179:in `retry_with_backoff'
return yield
lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
retry_with_backoff do
lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
@load_balancer.read_write do |connection|
...
(192 additional frame(s) were not displayed)
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_vulnerability_occurrences_on_unique_keys"
DETAIL: Key (project_id, primary_identifier_id, location_fingerprint, scanner_id)=(15642544, 1083447, \x27e5fbd2c567177e351b0b77385e48a275e66f26, 8489) already exists.
Implementation plan:
-
Write a migration to remove unique index index_vulnerability_occurrences_on_unique_keys
Edited by Subashis Chakraborty