Satellite's delete_orphaned_content task fails with "'Errata' object has no attribute 'get'"
Issue
- Red Hat Satellite's weekly internal cleanup of orphaned pulp objects fails with a backtrace, which is visible in both the
Actions::Katello::OrphanCleanup::RemoveOrphans
foreman task, or the/var/log/messages
of the Capsule being cleaned up.
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 686, in __call__
return super(Task, self).__call__(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 108, in __call__
return super(PulpTask, self).__call__(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
return self.run(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/managers/content/orphan.py", line 178, in delete_all_orphans
count = OrphanManager.delete_orphan_content_units_by_type(content_type_id)
File "/usr/lib/python2.7/site-packages/pulp/server/managers/content/orphan.py", line 314, in delete_orphan_content_units_by_type
content_model.do_post_delete_actions(unit_to_delete)
File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/db/models.py", line 1314, in do_post_delete_actions
ErratumPkglist.objects(errata_id=erratum.get('errata_id')).delete()
AttributeError: 'Errata' object has no attribute 'get'
- Capsules experiencing this failure begin returning "404 not found" to Content Hosts attempting to retrieve repository metadata, as seen in the
/var/log/httpd/pulp-https_access_ssl.log
. (Note: there are other circumstances that can cause repomd.xml to not be found, but this issue is focused on when it happens shortly after the above failed orphan cleanup.)
Environment
- Red Hat Satellite 6.7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.