Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidationError: Duplicate values violate save constraint and we are unable to fix it #4835

Open
sentry-io bot opened this issue Dec 17, 2024 · 1 comment

Comments

@sentry-io
Copy link

sentry-io bot commented Dec 17, 2024

While debugging #4824, I found this validation error in Sentry that's preventing the main document from saving. This error is also blocking the creation of the corresponding document for associated attachments.

Sentry Issue: COURTLISTENER-840

RECAPDocument.DoesNotExist: RECAPDocument matching query does not exist.
  File "cl/recap/mergers.py", line 1670, in merge_attachment_page_data
    main_rd = await RECAPDocument.objects.select_related(

ValidationError: Duplicate values violate save constraint and we are unable to fix it because the items have different pacer_doc_id values. The rds are None and 376976961 
(12 additional frame(s) were not displayed)
...
  File "cl/recap/tasks.py", line 115, in process_recap_upload
    await process_recap_attachment(pq_pk)
  File "cl/recap/tasks.py", line 760, in process_recap_attachment
    rds_affected, de = await merge_attachment_page_data(
  File "cl/recap/mergers.py", line 1766, in merge_attachment_page_data
    await rd.asave()
  File "cl/search/models.py", line 1533, in asave
    return await sync_to_async(self.save)(
  File "cl/search/models.py", line 1504, in save
    raise ValidationError(

Filed by @ERosendo

@mlissner
Copy link
Member

Do you see a path to a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant