unt-libraries / catalog-api

A Django project that lets you build and expose a REST API for your library's Sierra ILS-based catalog
BSD 3-Clause "New" or "Revised" License
17 stars 8 forks source link

IndexError: list index out of range in django/sierra/export/tasks.py line 283 #46

Closed jthomale closed 5 years ago

jthomale commented 5 years ago

Nightly BibsToAlphaSmAndAttachedToSolr in production raised this error on 5/12/2019 and 5/13/2019, at 1:15 AM. Full traceback:

Traceback: Traceback (most recent call last):
  File "/home/catalog-api/current/env/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/catalog-api/current/env/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/catalog-api/releases/20190508101929/django/sierra/export/tasks.py", line 41, in _wrapper
    ret_val = job_func(*args, **kwargs)
  File "/home/catalog-api/releases/20190508101929/django/sierra/export/tasks.py", line 439, in delegate_batch
    plan.log_plan_summary(exp)
  File "/home/catalog-api/releases/20190508101929/django/sierra/export/tasks.py", line 283, in log_plan_summary
    first_chunk_id = self.registry[batch_ids[0]][0]
IndexError: list index out of range

Given the dates this happened (Saturday night and Sunday night after finals, while the library was closed), I'm willing to bet that there were no records to update, which led to the IndexError while trying to reference index 0 on an empty list (batch_ids).