Project

Profile

Help

Issue #8166

closed

Migration fails with ForeignKeyViolation: insert or update on table "pulp_2to3_migration_pulp2erratum" violates foreign key constraint "pulp_2to3_migration

Added by jsherril@redhat.com almost 4 years ago. Updated almost 4 years ago.

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

Description

On a user database, the following was observed:

pulp: rq.worker:ERROR: Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 240, in _commit
return self.connection.commit()
psycopg2.errors.ForeignKeyViolation: insert or update on table "pulp_2to3_migration_pulp2erratum" violates foreign key constraint "pulp_2to3_migration__pulp2content_id_157e4b7e_fk_pulp_2to3"
DETAIL:  Key (pulp2content_id)=(92d6bb6c-531c-43c7-82d8-dc51d752d00e) is not present in table "pulp_2to3_migration_pulp2content".
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/rq/worker.py", line 936, in perform_job
rv = job.perform()
File "/usr/lib/python3.6/site-packages/rq/job.py", line 684, in perform
self._result = self._execute()
File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in _execute
return self.func(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/tasks/migrate.py", line 137, in migrate_from_pulp2
pre_migrate_all_content(plan)
File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/pre_migration.py", line 68, in pre_migrate_all_content
pre_migrate_content_type(content_model, mutable_type, lazy_type, premigrate_hook)
File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/pre_migration.py", line 272, in pre_migrate_content_type
content_model.pulp_2to3_detail.pre_migrate_content_detail(pulp2content_batch)
File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/plugin/rpm/pulp_2to3_models.py", line 370, in pre_migrate_content_detail
batch_size=DEFAULT_BATCH_SIZE)
File "/usr/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 480, in bulk_create
obj_without_pk._state.db = self.db
File "/usr/lib/python3.6/site-packages/django/db/transaction.py", line 240, in __exit__
connection.commit()
File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 262, in commit
self._commit()
File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 240, in _commit
return self.connection.commit()
File "/usr/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 240, in _commit
return self.connection.commit()
django.db.utils.IntegrityError: insert or update on table "pulp_2to3_migration_pulp2erratum" violates foreign key constraint "pulp_2to3_migration__pulp2content_id_157e4b7e_fk_pulp_2to3"
DETAIL:  Key (pulp2content_id)=(92d6bb6c-531c-43c7-82d8-dc51d752d00e) is not present in table "pulp_2to3_migration_pulp2content".
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 240, in _commit
return self.connection.commit()
psycopg2.errors.ForeignKeyViolation: insert or update on table "pulp_2to3_migration_pulp2erratum" violates foreign key constraint "pulp_2to3_migration__pulp2content_id_157e4b7e_fk_pulp_2to3"
DETAIL:  Key (pulp2content_id)=(92d6bb6c-531c-43c7-82d8-dc51d752d00e) is not present in table "pulp_2to3_migration_pulp2content".
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/rq/worker.py", line 936, in perform_job
rv = job.perform()
File "/usr/lib/python3.6/site-packages/rq/job.py", line 684, in perform
self._result = self._execute()
File "/usr/lib/python3.6/site-packages/rq/job.py", line 690, in _execute
return self.func(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/tasks/migrate.py", line 137, in migrate_from_pulp2
pre_migrate_all_content(plan)
File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/pre_migration.py", line 68, in pre_migrate_all_content
pre_migrate_content_type(content_model, mutable_type, lazy_type, premigrate_hook)
File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/pre_migration.py", line 272, in pre_migrate_content_type
content_model.pulp_2to3_detail.pre_migrate_content_detail(pulp2content_batch)
File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/plugin/rpm/pulp_2to3_models.py", line 370, in pre_migrate_content_detail
batch_size=DEFAULT_BATCH_SIZE)
File "/usr/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 480, in bulk_create
obj_without_pk._state.db = self.db
File "/usr/lib/python3.6/site-packages/django/db/transaction.py", line 240, in __exit__
connection.commit()
File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 262, in commit
self._commit()
File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 240, in _commit
return self.connection.commit()
File "/usr/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/lib/python3.6/site-packages/django/db/backends/base/base.py", line 240, in _commit
return self.connection.commit()
django.db.utils.IntegrityError: insert or update on table "pulp_2to3_migration_pulp2erratum" violates foreign key constraint "pulp_2to3_migration__pulp2content_id_157e4b7e_fk_pulp_2to3"
DETAIL:  Key (pulp2content_id)=(92d6bb6c-531c-43c7-82d8-dc51d752d00e) is not present in table "pulp_2to3_migration_pulp2content".

Also available in: Atom PDF