freelawproject / recap

This repository is for filing issues on any RECAP-related effort.
https://free.law/recap/
12 stars 4 forks source link

IntegrityError: "pacer_case_id" is not available on some RECAP appellate attachment pages uploads #365

Open sentry-io[bot] opened 5 months ago

sentry-io[bot] commented 5 months ago

I checked some of the uploads related to this issue and found that the caseID is either blank or null in all the URLs within the upload, for example:

TransportRoom?servlet=ShowDoc&caseId=null&recapDocNum=1&recapCaseNum=20-15019&dls_id='+dls+'&caseId=

TransportRoom?servlet=ShowDocMulti&caseId=null&recapDocNum=1&recapCaseNum=20-15019&outputType=doc&d=11552967&outputForm=view&incPdfFooter=

As a result, the PQ receives a null pacer_case_id and it is also missing in the parsed data. I'm not sure if there is a different way to obtain it from the extension side, or perhaps the pacer_doc_id (available), court (available), and docket number (which is not being parsed or received in the upload) from the attachment page could be used to search for the case and docket entry.

Sentry Issue: COURTLISTENER-5T3

NotNullViolation: null value in column "pacer_case_id" of relation "recap_processingqueue" violates not-null constraint
DETAIL:  Failing row contains (12306355, 2024-02-02 00:38:06.681483+00, 2024-02-02 00:38:06.828818+00, null, , null, recap_processing_queue/2024/02/02/4acf2bbeb8e94349ba376a8114cb4e..., 4, 6, , ca5, 7742, null, null, null, null, f).
  File "django/db/backends/utils.py", line 105, in _execute
    return self.cursor.execute(sql, params)
  File "psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)

IntegrityError: null value in column "pacer_case_id" of relation "recap_processingqueue" violates not-null constraint
DETAIL:  Failing row contains (12306355, 2024-02-02 00:38:06.681483+00, 2024-02-02 00:38:06.828818+00, null, , null, recap_processing_queue/2024/02/02/4acf2bbeb8e94349ba376a8114cb4e..., 4, 6, , ca5, 7742, null, null, null, null, f).
(24 additional frame(s) were not displayed)
...
  File "cl/recap/views.py", line 65, in perform_create
    await asyncio.shield(recap_upload_task)
  File "cl/recap/tasks.py", line 127, in process_recap_upload
    await process_recap_appellate_attachment(pq.pk)
  File "cl/recap/tasks.py", line 1142, in process_recap_appellate_attachment
    await pq.asave()

Filed by: @albertisfu

mlissner commented 5 months ago

Thanks. Yeah, I think the better place to solve this is in the extension, so I'll migrate it there.