In run.py, the --delete -n /path/to/bibcode/list is used to trigger row deletions from master_pipeline.records. In the event one of the fields in this row is used as a foreign key in another table, this will generate a ForeignKeyViolation Error on the sqlalchemy operation. The call to adsmp.tasks.task_delete_documents in run.py is not contained within a try-except, and the task itself doesn't either. The result is that the task generates a fatal exception, and so run.py generates an exception and stops.
The task itself should have a try-except on the sqlalchemy delete action as well as the solr delete action.