Project

Profile

Help

Issue #7096

closed

Deleting a repository with a kickstart raises exception

Added by mathiasdasilva over 4 years ago. Updated over 4 years 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
Quarter:

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)

Actions #1

Updated by dkliban@redhat.com over 4 years ago

  • Project changed from Pulp to RPM Support
  • Category deleted (Installer - Moved to GitHub issues)
Actions #2

Updated by daviddavis over 4 years 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.

Actions #3

Updated by daviddavis over 4 years ago

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

Updated by ttereshc over 4 years ago

  • Assignee set to ttereshc
  • Sprint set to Sprint 77

Added by ttereshc over 4 years ago

Revision ca39e84c | View on GitHub

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]

Actions #5

Updated by ttereshc over 4 years ago

  • Status changed from NEW to MODIFIED
Actions #6

Updated by ttereshc over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #7

Updated by ttereshc over 4 years ago

  • Sprint/Milestone set to Pulp RPM 3.5.0

Also available in: Atom PDF