Problem:
Receiving the following errors when attempting to delete a published content view:
duplicate key value violates unique constraint "core_repositorycontent_repository_id_content_id_fb06c181_uniq"
DETAIL: Key (repository_id, content_id, version_added_id)=(e3bb1f7a-23a6-4e1e-91e6-abb50c0b78ca, f38f4f60-eef4-4361-b075-a68fa52735d8, 27981258-e3f3-40d1-9062-370f89f2d7ca) already exists.
duplicate key value violates unique constraint "core_repositorycontent_repository_id_content_id_fb06c181_uniq"
DETAIL: Key (repository_id, content_id, version_added_id)=(8c0020f2-50d8-4ba5-affe-e76767d44f55, cc6287c0-46fa-4c41-8f7e-741f82a3c664, b9d1ab92-0462-4917-8c88-0b18bdc4f9b2) already exists.
Expected outcome:
Content view version is deleted without issue.
Foreman and Proxy versions:
Foreman 2.5.1
Foreman and Proxy plugin versions:
Distribution and version:
CentOS Linux release 7.9.2009 (Core)
Other relevant data:
Dynaflow error output:
---
response:
task: "/pulp/api/v3/tasks/6daf2ac6-061f-4a40-8f16-f141c6591d29/"
pulp_tasks:
- pulp_href: "/pulp/api/v3/tasks/6daf2ac6-061f-4a40-8f16-f141c6591d29/"
pulp_created: '2021-11-04T19:37:19.254+00:00'
state: failed
name: pulpcore.app.tasks.repository.delete_version
logging_cid: 2528b44c-558a-4e6c-a767-39d4d7d7efa7
started_at: '2021-11-04T19:37:19.585+00:00'
finished_at: '2021-11-04T19:37:19.746+00:00'
error:
traceback: |2
File "/usr/lib/python3.6/site-packages/rq/worker.py", line 975, in perform_job
rv = job.perform()
File "/usr/lib/python3.6/site-packages/rq/job.py", line 696, in perform
self._result = self._execute()
File "/usr/lib/python3.6/site-packages/rq/job.py", line 719, in _execute
return self.func(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/pulpcore/app/tasks/repository.py", line 49, in delete_version
version.delete()
File "/usr/lib/python3.6/site-packages/pulpcore/app/models/repository.py", line 829, in delete
self._squash(repo_relations, next_version)
File "/usr/lib/python3.6/site-packages/pulpcore/app/models/repository.py", line 812, in _squash
repo_relations.filter(version_added=self).update(version_added=next_version)
File "/usr/lib/python3.6/site-packages/django/db/models/query.py", line 741, in update
rows = query.get_compiler(self.db).execute_sql(CURSOR)
File "/usr/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1471, in execute_sql
cursor = super().execute_sql(result_type)
File "/usr/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
cursor.execute(sql, params)
File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
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/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
description: |
duplicate key value violates unique constraint "core_repositorycontent_repository_id_content_id_fb06c181_uniq"
DETAIL: Key (repository_id, content_id, version_added_id)=(e3bb1f7a-23a6-4e1e-91e6-abb50c0b78ca, f38f4f60-eef4-4361-b075-a68fa52735d8, 27981258-e3f3-40d1-9062-370f89f2d7ca) already exists.
worker: "/pulp/api/v3/workers/8d0ad29e-c2f3-4d45-be83-80bc55178dc4/"
child_tasks: []
progress_reports: []
created_resources: []
reserved_resources_record:
- "/pulp/api/v3/repositories/rpm/rpm/e3bb1f7a-23a6-4e1e-91e6-abb50c0b78ca/"
task_groups: []
poll_attempts:
total: 22
failed: 7
My pulp versions:
$ pip3 list --format=columns|grep pulp
pulp-ansible 0.7.3
pulp-certguard 1.2.0
pulp-container 2.5.3
pulp-deb 2.11.2
pulp-file 1.6.0
pulp-rpm 3.11.0
pulpcore 3.11.2
The repo in question here was hung up unbeknowst to me while I was testing various errata filters and published several versions of the content view containing this repo. I sorted out the repo and was able to eventually get it synchronized. No tasks are currently in a “paused” state. I was trying to delete my content views to start over when I hit the above error.
This issue has already come up here:
https://pulp.plan.io/issues/9396
But no workaround has been mentioned and the issue has been pushed the last several sprints. Is there something I can do now to get around this issue and delete the content view?
Thank you!