UniqueViolation: duplicate key value violates unique constraint "origin_visit_pkey"
https://sentry.softwareheritage.org/organizations/swh/issues/9545/?referrer=phabricator_plugin
UniqueViolation: duplicate key value violates unique constraint "origin_visit_pkey"
DETAIL: Key (origin, visit)=(179514690, 2) already exists.
CONTEXT: SQL function "swh_origin_visit_add" statement 1
(4 additional frame(s) were not displayed)
...
File "swh/core/api/negotiation.py", line 81, in __call__
result = self.func(*args, **kwargs)
File "swh/core/api/__init__.py", line 510, in f
ret = obj_meth(**kw)
File "swh/core/db/common.py", line 73, in _meth
return meth(self, *args, db=db, cur=cur, **kwargs)
File "swh/storage/postgresql/storage.py", line 1026, in origin_visit_add
visit.origin, visit.date, visit.type, cur=cur
File "swh/storage/postgresql/db.py", line 474, in origin_visit_add
"SELECT swh_origin_visit_add(%s, %s, %s)", (origin, ts, type)
Migrated from T4444 (view on Phabricator)