freelawproject / juriscraper

An API to scrape American court websites for metadata.
https://free.law/juriscraper/
BSD 2-Clause "Simplified" License
354 stars 105 forks source link

IndexError: Parsing Attorney in ACMS docket JSON object #1083

Closed sentry-io[bot] closed 1 month ago

sentry-io[bot] commented 1 month ago

This has occurred once so far.

It's directly related to an ACMS docket JSON when parsing the Attorneys

Related PQ: https://www.courtlistener.com/admin/recap/processingqueue/14226598/change/

Sentry Issue: COURTLISTENER-7WW

_RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/concurrent/futures/process.py", line 263, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/courtlistener/cl/recap/tasks.py", line 1018, in parse_acms_json
    return report.data
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/juriscraper/pacer/docket_report.py", line 74, in data
    data["parties"] = self.parties
                      ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/juriscraper/pacer/acms_docket.py", line 269, in parties
    _ = self._parse_attorney(attorney)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/juriscraper/pacer/appellate_docket.py", line 445, in _parse_attorney
    attorney["name"] = attorney_lines.pop(0)
                       ^^^^^^^^^^^^^^^^^^^^^
IndexError: pop from empty list
"""
IndexError: pop from empty list
(9 additional frame(s) were not displayed)
...
  File "cl/recap/views.py", line 73, in perform_create
    await asyncio.shield(recap_upload_task)
  File "cl/recap/tasks.py", line 147, in process_recap_upload
    docket = await process_recap_acms_docket(pq.pk)
  File "cl/recap/tasks.py", line 1156, in process_recap_acms_docket
    data = await asyncio.get_running_loop().run_in_executor(

Filed by: @albertisfu

mlissner commented 1 month ago

Thanks for the detailed report. This must be related to the new roll out of RECAP that supports ACMS. I'll put it on Eduardo's backlog.