Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2033568 - Repository sync gets failed due to pulp error "Cannot delete some instances of model 'ReservedResource' because they are referenced through a protected foreign key"
Summary: Repository sync gets failed due to pulp error "Cannot delete some instances o...
Keywords:
Status: CLOSED DUPLICATE of bug 2031154
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.10.1
Hardware: All
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-17 09:33 UTC by Devendra Singh
Modified: 2022-01-10 15:55 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-01-10 15:55:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Devendra Singh 2021-12-17 09:33:51 UTC
Description of problem: Repository sync gets failed due to pulp error "Cannot delete some instances of model 'ReservedResource' because they are referenced through a protected foreign key"


Version-Release number of selected component (if applicable):
6.10

How reproducible:
always

Steps to Reproduce:
1- Prepare the Satellite and Capsule using the latest 6.9.z GA version.
2- Run the sync for all the repositories and it completes successfully.
3- Run the pulp migration and that completes successfully.
4. Upgrade the satellite from 6.9.z GA to 6.10.1.1 GA
5. Run the Repository sync for the "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server" repository.
6. Repository sync gets failed due to the below error

pulpcore-worker-2: pulp [None]: pulpcore.tasking.entrypoint:INFO: Starting distributed type worker
pulpcore-worker-2: pulp [None]: pulpcore.tasking.worker_watcher:INFO: New worker '2916' discovered
pulpcore-worker-5: pulp [None]: pulpcore.tasking.pulpcore_worker:INFO: Clean offline worker 14817.
pulpcore-worker-5: Traceback (most recent call last):
pulpcore-worker-5: File "/usr/bin/pulpcore-worker", line 11, in <module>
pulpcore-worker-5: load_entry_point('pulpcore==3.14.9', 'console_scripts', 'pulpcore-worker')()
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/click/core.py", line 829, in __call__
pulpcore-worker-5: return self.main(*args, **kwargs)
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/click/core.py", line 782, in main
pulpcore-worker-5: rv = self.invoke(ctx)
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
pulpcore-worker-5: return ctx.invoke(self.callback, **ctx.params)
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/click/core.py", line 610, in invoke
pulpcore-worker-5: return callback(*args, **kwargs)
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/pulpcore/tasking/entrypoint.py", line 44, in worker
pulpcore-worker-5: NewPulpWorker().run_forever()
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py", line 277, in run_forever
pulpcore-worker-5: self.sleep()
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py", line 187, in sleep
pulpcore-worker-5: self.beat()
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py", line 100, in beat
pulpcore-worker-5: self.worker_cleanup()
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py", line 90, in worker_cleanup
pulpcore-worker-5: worker.delete()
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/django_lifecycle/mixins.py", line 146, in delete
pulpcore-worker-5: value = super().delete(*args, **kwargs)
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 921, in delete
pulpcore-worker-5: collector.collect([self], keep_parents=keep_parents)
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/django/db/models/deletion.py", line 224, in collect
pulpcore-worker-5: field.remote_field.on_delete(self, field, sub_objs, self.using)
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/django/db/models/deletion.py", line 16, in CASCADE
pulpcore-worker-5: source_attr=field.name, nullable=field.null)
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/django/db/models/deletion.py", line 224, in collect
pulpcore-worker-5: field.remote_field.on_delete(self, field, sub_objs, self.using)
pulpcore-worker-5: File "/usr/lib/python3.6/site-packages/django/db/models/deletion.py", line 27, in PROTECT
pulpcore-worker-5: sub_objs
pulpcore-worker-5: django.db.models.deletion.ProtectedError: ("Cannot delete some instances of model 'ReservedResource' because they are referenced through a protected foreign key: 'TaskReservedResource.resource'", <QuerySet [<TaskReservedResource: pk=c8d7b1db-6cc4-4174-810b-85c295fcc2fb>]>)
systemd: pulpcore-worker: main process exited, code=exited, status=1/FAIL


Actual results:
The RHEL7 repository sync got failed due to the "Cannot delete some instances of model 'ReservedResource' because they are referenced through a protected foreign key" error.

Expected results:

Repository sync should be completed successfully.

Additional info:
Repository sync only gets failed for "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server" for other Rhel and custom repo it works perfectly.


Note You need to log in before you can comment on or make changes to this bug.