# Unhandled AssertionError during collection deletion: \`len(self.content\_ids) == self.\_content\_relationships().count()\`

**URL:** <https://forum.ansible.com/t/unhandled-assertionerror-during-collection-deletion-len-self-content-ids-self-content-relationships-count/45950>\
**Category:** Get Help\
**Tags:** galaxy-ng\
**Created:** [June 20, 2026, 1:49am UTC](https://forum.ansible.com/t/unhandled-assertionerror-during-collection-deletion-len-self-content-ids-self-content-relationships-count/45950 "2026-06-20T01:49:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwadman](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mwadman/32/1753_2.png) [@mwadman](https://forum.ansible.com/u/mwadman)\
**Post date:** [June 20, 2026, 1:49am UTC](https://forum.ansible.com/t/unhandled-assertionerror-during-collection-deletion-len-self-content-ids-self-content-relationships-count/45950/1 "2026-06-20T01:49:08Z")

</div>

Attempting to delete any of my collections on the public Ansible Galaxy website fails. For example, when trying to delete the collection [mwadman/dnsmasq\_roles](https://galaxy.ansible.com/ui/repo/published/mwadman/dnsmasq_roles/).  
I’ve checked that none of the collections that I’m trying to delete are dependencies of other collections.

The deletion fails silently without providing a user-facing error message or description in the web UI. I had to navigate to task management to determine it had failed.

See [screenshot here](https://imgur.com/a/iNuk9Oo) for details.  
Traceback pasted here if that’s useful:

```auto
File "/venv/lib64/python3.12/site-packages/pulpcore/tasking/tasks.py", line 73, in _execute_task
  result = task_function()
            ^^^^^^^^^^^^^^^
File "/venv/lib64/python3.12/site-packages/pulp_ansible/app/tasks/deletion.py", line 77, in delete_collection
  _remove_collection_version_from_repos(versions)
File "/venv/lib64/python3.12/site-packages/pulp_ansible/app/tasks/deletion.py", line 39, in _remove_collection_version_from_repos
  add_and_remove(repo.pk, add_content_units=[], remove_content_units=collections)
File "/venv/lib64/python3.12/site-packages/pulpcore/app/tasks/repository.py", line 234, in add_and_remove
  with repository.new_version(base_version=base_version) as new_version:
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib64/python3.12/site-packages/pulpcore/app/models/repository.py", line 1400, in __exit__
  self._compute_counts()
File "/venv/lib64/python3.12/site-packages/pulpcore/app/models/repository.py", line 1331, in _compute_counts
  assert len(self.content_ids) == self._content_relationships().count()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

```

Please let me know if there’s something I need to do to be able to delete collections.

---

<div class="post-metadata">

**Author:** ![shertel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/shertel/32/1241_2.png) [@shertel](https://forum.ansible.com/u/shertel)\
**Post date:** [June 22, 2026, 2:24pm UTC](https://forum.ansible.com/t/unhandled-assertionerror-during-collection-deletion-len-self-content-ids-self-content-relationships-count/45950/2 "2026-06-22T14:24:50Z")

</div>

I’m not sure if it’s possible. This comment was made a few years ago but reflects my current understanding [Deleting/disabling ansible galaxy collection - #5 by sivel](https://forum.ansible.com/t/deleting-disabling-ansible-galaxy-collection/38271/5).

---

<div class="post-metadata">

**Author:** ![ildjarn](https://avatars.discourse-cdn.com/v4/letter/i/8491ac/32.png) [@ildjarn](https://forum.ansible.com/u/ildjarn)\
**Post date:** [June 26, 2026, 10:47am UTC](https://forum.ansible.com/t/unhandled-assertionerror-during-collection-deletion-len-self-content-ids-self-content-relationships-count/45950/3 "2026-06-26T10:47:57Z")

</div>

As a workaround you could publish an empty version and delete everything else. It’s still there but does nothing.
