Project

Profile

Help

Issue #8351

closed

Error when deleting content - violates foreign key constraint

Added by adam.winberg@smhi.se about 3 years ago. Updated about 3 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

I've run into some problems with deleting content - I've run my migrations and put my pulp3 box into production. Since migrations were finished I uninstalled the 2to3migration plugin, thinking it would clean up after itself. But now I run into some issues when trying to remove some repository versions and also when trying to delete orphans.

Error message when trying to delete a repository version:

django.db.utils.IntegrityError: update or delete on table "core_publication" violates foreign key constraint "pulp_2to3_migration__pulp3_publication_id_221e8b1c_fk_core_publ" on table "pulp_2to3_migration_pulp2distributor"

This does not happen on all repositories, but on those where it does I get the same error when trying to delete the whole repository.

Error message when deleting orphans:

psycopg2.errors.ForeignKeyViolation: update or delete on table "core_content" violates foreign key constraint "pulp_2to3_migration__pulp3_content_id_6271a7bb_fk_core_cont" on table "pulp_2to3_migration_pulp2content"
DETAIL:  Key (pulp_id)=(0126dbf5-560d-4e9f-9278-92b468dbb1de) is still referenced from table "pulp_2to3_migration_pulp2content".

Not sure if this should be filed under the migration category since I have uninstalled the plugin, but since the errors are very much related to the migration plugin it might belong here.

I am aware of #7822, but in the mean time is there a safe way for me to clean my db from 2to3migration stuff manually to get rid of these errors?

Versions: python3-pulpcore-3.9.1-1.el8.noarch python3-pulp-rpm-3.8.0-1.el8.noarch

Was using python3-pulp-2to3-migration-0.6.0-2.el8.noarch when doing my migration, but has since uninstalled it.

Also available in: Atom PDF