You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is blocking the correct function of pupa clean on the dashboard.
Example stack trade:
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - 33 objects in your database have not been seen in 7 days.
Proceeding to deletion because you specified --yes.
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - Deleting Ad Hoc 2028 Olympics Committee...
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - Traceback (most recent call last):
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 242, in _commit
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO -
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - return self.connection.commit()
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - psycopg2.errors.ForeignKeyViolation: update or delete on table "opencivicdata_organization" violates foreign key constraint "councilmatic_core_or_organization_id_2d4baacb_fk_opencivic" on table "councilmatic_core_organization"
DETAIL: Key (id)=(ocd-organization/30e97a57-c264-4580-8fd6-e77ebee18154) is still referenced from table "councilmatic_core_organization".
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/pupa", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/pupa/cli/__main__.py", line 75, in main
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - subcommands[args.subcommand].handle(args, other)
File "/usr/local/lib/python3.10/site-packages/pupa/cli/commands/clean.py", line 122, in handle
self.remove_stale_objects(args.window)
File "/usr/local/lib/python3.10/site-packages/pupa/cli/commands/clean.py", line 80, in remove_stale_objects
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - obj.delete()
File "/usr/local/lib/python3.10/site-packages/django/db/models/base.py", line 967, in delete
return collector.delete()
File "/usr/local/lib/python3.10/site-packages/django/db/models/deletion.py", line 400, in delete
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - with transaction.atomic(using=self.using, savepoint=False):
File "/usr/local/lib/python3.10/site-packages/django/db/transaction.py", line 246, in __exit__
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - connection.commit()
File "/usr/local/lib/python3.10/site-packages/django/utils/asyncio.py", line 33, in inner
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 266, in commit
self._commit()
File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 241, in _commit
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - with self.wrap_database_errors:
File "/usr/local/lib/python3.10/site-packages/django/db/utils.py", line 90, in __exit__
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.10/site-packages/django/db/backends/base/base.py", line 242, in _commit
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - return self.connection.commit()
django.db.utils.IntegrityError: update or delete on table "opencivicdata_organization" violates foreign key constraint "councilmatic_core_or_organization_id_2d4baacb_fk_opencivic" on table "councilmatic_core_organization"
DETAIL: Key (id)=(ocd-organization/30e97a57-c264-4580-8fd6-e77ebee18154) is still referenced from table "councilmatic_core_organization".
[2024-09-19, 16:46:03 CDT] {docker.py:391} INFO - Sentry is attempting to send 2 pending events
Waiting up to 2 seconds
Press Ctrl-C to quit
The text was updated successfully, but these errors were encountered:
This is interesting, since the Councilmatic models specify
on_delete=models.CASCADE
.django-councilmatic/councilmatic_core/models.py
Lines 159 to 165 in c68962a
Could this have to do with our use of
parent_link
? Related docs: https://docs.djangoproject.com/en/3.2/ref/models/fields/#django.db.models.OneToOneFieldThis is blocking the correct function of
pupa clean
on the dashboard.Example stack trade:
The text was updated successfully, but these errors were encountered: