laws-africa / peachjam

Project Peach Jam
https://agp.africanlii.org
GNU General Public License v3.0
2 stars 0 forks source link

IntegrityError: duplicate key value violates unique constraint "peachjam_documentcontent_document_id_key" #1574

Closed sentry-io[bot] closed 1 year ago

sentry-io[bot] commented 1 year ago

Sentry Issue: LII-RZ

DocumentContent.DoesNotExist: DocumentContent matching query does not exist.
  File "django/db/models/query.py", line 581, in get_or_create
    return self.get(**kwargs), False
  File "django/db/models/query.py", line 435, in get
    raise self.model.DoesNotExist(

UniqueViolation: duplicate key value violates unique constraint "peachjam_documentcontent_document_id_key"
DETAIL:  Key (document_id)=(276910) already exists.

  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)

IntegrityError: duplicate key value violates unique constraint "peachjam_documentcontent_document_id_key"
DETAIL:  Key (document_id)=(276910) already exists.

(15 additional frame(s) were not displayed)
...
  File "peachjam/tasks.py", line 49, in update_document
    ingestor.update_document(document_id)
  File "peachjam/models/ingestors.py", line 62, in update_document
    adapter.update_document(document_id)
  File "peachjam/adapters/gazettes.py", line 136, in update_document
    DocumentContent.objects.update_or_create(
actlikewill commented 1 year ago

@longhotsummer I'm not really sure how this error happened. I cannot replicate it locally. It seems to have resolved because we havent seen it for two weeks. Do you have any insights?

longhotsummer commented 1 year ago

It does seem to have stopped, let's close and re-open if it's still there.