Description of problem: 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". To reproduce: - run a large premigration - stop it while some errata are premigrated while other are not - run the migration plan again
The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug.
The Pulp upstream bug priority is at Urgent. Updating the external tracker on this bug.
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.
Steps to test: 1. Run migration on a large db (I did a customer one) 2. Stop migration while some errata are premigrated while others are not 3. Rerun migration again Expected result: Migration should continue and migrated successfully afterwards Actual result: Migration continued and migrated successfully after restarting. Verified on 6.9.0_18, python3-pulp-2to3-migration-0.9.1-1.el7pc.noarch
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: Satellite 6.9 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:1313