Project

Profile

Help

Issue #7096

Deleting a repository with a kickstart raises exception

Added by mathiasdasilva about 1 month ago. Updated 14 days ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
OS:
CentOS 7
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 77

Description

Hi,

Seems there is an issue when i try to delete a Centos repository :

Jul 07 06:52:44 XXXX rq[1171]: pulp: rq.worker:ERROR: django.db.models.deletion.ProtectedError: ("Cannot delete some instances of model 'Repository' because they are referenced through a protected foreign key: 'Variant.repository'", <QuerySet [<Variant: CentOS>]>) Jul 07 06:52:44 XXXX rq[1171]: Traceback (most recent call last): Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 883, in perform_job Jul 07 06:52:44 XXXX rq[1171]: rv = job.perform() Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 657, in perform Jul 07 06:52:44 XXXX rq[1171]: self._result = self._execute() Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 663, in _execute Jul 07 06:52:44 XXXX rq[1171]: return self.func(*self.args, **self.kwargs) Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/app/tasks/base.py", line 91, in general_delete Jul 07 06:52:44 XXXX rq[1171]: instance.delete() Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/base.py", line 918, in delete Jul 07 06:52:44 XXXX rq[1171]: collector.collect([self], keep_parents=keep_parents) Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/deletion.py", line 224, in collect Jul 07 06:52:44 XXXX rq[1171]: field.remote_field.on_delete(self, field, sub_objs, self.using) Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/deletion.py", line 27, in PROTECT Jul 07 06:52:44 XXXX rq[1171]: sub_objs Jul 07 06:52:44 XXXX rq[1171]: django.db.models.deletion.ProtectedError: ("Cannot delete some instances of model 'Repository' because they are referenced through a protected foreign key: 'Variant.repository'", <QuerySet [<Variant: CentOS>]>) Jul 07 06:52:44 XXXX rq[1171]: Traceback (most recent call last): Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 883, in perform_job Jul 07 06:52:44 XXXX rq[1171]: rv = job.perform() Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 657, in perform Jul 07 06:52:44 XXXX rq[1171]: self._result = self._execute() Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 663, in _execute Jul 07 06:52:44 XXXX rq[1171]: return self.func(*self.args, **self.kwargs) Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/pulpcore/app/tasks/base.py", line 91, in general_delete Jul 07 06:52:44 XXXX rq[1171]: instance.delete() Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/base.py", line 918, in delete Jul 07 06:52:44 XXXX rq[1171]: collector.collect([self], keep_parents=keep_parents) Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/deletion.py", line 224, in collect Jul 07 06:52:44 XXXX rq[1171]: field.remote_field.on_delete(self, field, sub_objs, self.using) Jul 07 06:52:44 XXXX rq[1171]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/deletion.py", line 27, in PROTECT Jul 07 06:52:44 XXXX rq[1171]: sub_objs Jul 07 06:52:44 XXXX rq[1171]: django.db.models.deletion.ProtectedError: ("Cannot delete some instances of model 'Repository' because they are referenced through a protected foreign key: 'Variant.repository'", <QuerySet [<Variant: CentOS>]>) Jul 07 06:52:44 XXXX rq[1171]: pulp: rq.worker:INFO: : 8ea8c7f4-32a9-4fea-a775-0129295c9605 Jul 07 06:52:44 XXXX rq[1171]: pulp: rq.worker:INFO: : Job OK (8ea8c7f4-32a9-4fea-a775-0129295c9605)

Associated revisions

Revision ca39e84c View on GitHub
Added by ttereshc 15 days ago

Remove FK to the main repo from a distribution tree Variant.

No issues with repository removal. No issues with copying the same distribution tree into multiple repos.

closes #7150 https://pulp.plan.io/issues/7150

closes #7096 https://pulp.plan.io/issues/7096

closes #7046 https://pulp.plan.io/issues/7046

[nocoverage]

History

#1 Updated by dkliban@redhat.com about 1 month ago

  • Project changed from Pulp to RPM Support
  • Category deleted (Installer)

#2 Updated by daviddavis 29 days ago

  • Triaged changed from No to Yes

We discussed this during our RPM meeting but didn't come up with a good solution. The problem is that the variant has a foreign key to the repository. So essentially the distribution tree is pointing back to the repository that contains it.

#3 Updated by daviddavis 28 days ago

  • Subject changed from Repository deletion issue to Deleting a repository with a kickstart raises exception

#4 Updated by ttereshc 15 days ago

  • Assignee set to ttereshc
  • Sprint set to Sprint 77

#5 Updated by ttereshc 15 days ago

  • Status changed from NEW to MODIFIED

#6 Updated by ttereshc 14 days ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

#7 Updated by ttereshc 14 days ago

  • Sprint/Milestone set to Pulp RPM 3.5.0

Please register to edit this issue

Also available in: Atom PDF