Corpus deletion does not support worker run
When trying to delete a corpus on demo instance, I get exceptions about worker runs:
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | 2023-01-20 10:11:48,908 [INFO] Deleting <Corpus: HTR-MSS-15e-Siecle>
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | 2023-01-20 10:11:48,925 [INFO] Deleted 0 AllowedMetaData
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | 2023-01-20 10:11:48,930 [INFO] Deleted 0 CorpusWorkerVersion
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | 2023-01-20 10:11:48,958 [DEBUG] Handling failed execution of job d6c37d0d-1ada-4242-949a-93ee48a94493
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | 2023-01-20 10:11:49,068 [ERROR] Traceback (most recent call last):
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 89, in _execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return self.cursor.execute(sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | psycopg2.errors.ForeignKeyViolation: update or delete on table "process_workerrun" violates foreign key constraint "documents_element_worker_run_id_794288c7_fk_dataimpor" on table "documents_element"
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | DETAIL: Key (id)=(bfc6f410-1f47-46c9-a8d4-af285a3a1da1) is still referenced from table "documents_element".
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 |
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 |
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | The above exception was the direct cause of the following exception:
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 |
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | Traceback (most recent call last):
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/rq/worker.py", line 1075, in perform_job
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | rv = job.perform()
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/rq/job.py", line 854, in perform
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | self._result = self._execute()
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/rq/job.py", line 877, in _execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | result = self.func(*self.args, **self.kwargs)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/share/arkindex/documents/tasks.py", line 77, in corpus_delete
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 1155, in _raw_delete
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | cursor = query.get_compiler(using).execute_sql(CURSOR)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1398, in execute_sql
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | cursor.execute(sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/django/__init__.py", line 563, in execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return real_execute(self, sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 67, in execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return self._execute_with_wrappers(
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return executor(sql, params, many, context)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 89, in _execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return self.cursor.execute(sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 91, in __exit__
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | raise dj_exc_value.with_traceback(traceback) from exc_value
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 89, in _execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return self.cursor.execute(sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | django.db.utils.IntegrityError: update or delete on table "process_workerrun" violates foreign key constraint "documents_element_worker_run_id_794288c7_fk_dataimpor" on table "documents_element"
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | DETAIL: Key (id)=(bfc6f410-1f47-46c9-a8d4-af285a3a1da1) is still referenced from table "documents_element".
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 |
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | Traceback (most recent call last):
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 89, in _execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return self.cursor.execute(sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | psycopg2.errors.ForeignKeyViolation: update or delete on table "process_workerrun" violates foreign key constraint "documents_element_worker_run_id_794288c7_fk_dataimpor" on table "documents_element"
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | DETAIL: Key (id)=(bfc6f410-1f47-46c9-a8d4-af285a3a1da1) is still referenced from table "documents_element".
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 |
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 |
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | The above exception was the direct cause of the following exception:
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 |
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | Traceback (most recent call last):
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/rq/worker.py", line 1075, in perform_job
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | rv = job.perform()
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/rq/job.py", line 854, in perform
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | self._result = self._execute()
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/rq/job.py", line 877, in _execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | result = self.func(*self.args, **self.kwargs)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/share/arkindex/documents/tasks.py", line 77, in corpus_delete
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 1155, in _raw_delete
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | cursor = query.get_compiler(using).execute_sql(CURSOR)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1398, in execute_sql
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | cursor.execute(sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/django/__init__.py", line 563, in execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return real_execute(self, sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 67, in execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return self._execute_with_wrappers(
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return executor(sql, params, many, context)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 89, in _execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return self.cursor.execute(sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 91, in __exit__
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | raise dj_exc_value.with_traceback(traceback) from exc_value
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 89, in _execute
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | return self.cursor.execute(sql, params)
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | django.db.utils.IntegrityError: update or delete on table "process_workerrun" violates foreign key constraint "documents_element_worker_run_id_794288c7_fk_dataimpor" on table "documents_element"
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 | DETAIL: Key (id)=(bfc6f410-1f47-46c9-a8d4-af285a3a1da1) is still referenced from table "documents_element".
ark-worker-high.1.lkmwnzf84s58@arkindex-demo-web02 |