Removing a repository does not delete its content in /var/lib/pulp on Red Hat Satellite Server.
Environment
- Red Hat Satellite 6.x
Issue
- Disabling some (enabled) repositories in Red Hat Satellite 6.x does not shrink adequately in
/var/lib/pulp. - Why
pulpholds packages for disabled repositories, wasting disk space? - Is there any way to know which pulp repositories are being removed by command
foreman-rake katello:delete_orphaned_content RAILS_ENV=production >/dev/null?
Resolution
-
In Red Hat Satellite 6 (< 6.4), the cleanup of
var/lib/pulpis scheduled via cron this way:# cat /etc/cron.weekly/katello-remove-orphans #!/bin/env bash # Script for intiating removal of orphaned content # foreman-rake katello:delete_orphaned_content RAILS_ENV=production >/dev/null -
In Red Hat Satellite 6.4 and later the job looks like:
# grep delete_orphaned /etc/cron.d/katello 00 22 * * 0 root foreman-rake katello:delete_orphaned_content RAILS_ENV=production >/dev/null 2>&1 -
For more frequent clean-up of the directory, schedule as necessary. To immediately trigger the clean up of the directory, run it on the command line:
# foreman-rake katello:delete_orphaned_content RAILS_ENV=production >/dev/null -
Upon successful completion, a summary of any deleted content will be printed to
/var/log/messages:Aug 20 16:14:13 hostname pulp: celery.worker.strategy:INFO: Received task: pulp.server.managers.content.orphan.delete_all_orphans[026508bc-9a14-4308-8f95-a750cdef9a03] Aug 20 16:17:29 hostname pulp: celery.app.trace:INFO: [026508bc] Task pulp.server.managers.content.orphan.delete_all_orphans[026508bc-9a14-4308-8f95-a750cdef9a03] succeeded in 196.271635305s: {'erratum': 18, 'package_group': 308, 'package_category': 1, 'package_environment': 24, 'rpm': 378, 'yum_repo_metadata_file': 11}
For more KB articles/solutions related to Red Hat Satellite 6.x Repository Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Repository Issues.
For more KB articles/solutions related to Red Hat Satellite 6.x Pulp 2.0 Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Pulp 2.0-related Issues
Root Cause
- There is no way to know which content is being removed by command
foreman-rake katello:delete_orphaned_content RAILS_ENV=production >/dev/null. An (internal) feature request has been has been filed as This content is not included.RHBZ#1264960 to add these details, but denied later on. In case of more details on internal Bugzilla ticket, please contact This content is not included.Red Hat Technical Support.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.