Forcefully republishing pulp repository makes no real effect

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.2
    • pulp-rpm-plugins version 2.8.3.5-1 till 2.8.7.18-1

Issue

  • content of some pulp published repository is broken (wrong metadata, broken symlinks for immediate sync repo download policy or so)
  • forcefully (re)publishing the repository is expected to fix that problem
  • but the re-publish does not improve anything

Resolution

Ideally, upgrade to Satellite 6.3 or newer that has the underlying flaw fixed.

As a temporary workaround, only for pulp-rpm-plugins versions 2.8.7.12-1 or newer, comment out one very redundant line in /usr/lib/python2.7/site-packages/pulp_rpm/plugins/distributors/yum/publish.py: around line 280:

        last_published = publish_conduit.last_publish()
        last_deleted = repo.last_unit_removed
        force_full = config.get('force_full', False)
        date_filter = None
#        force_full = False  # comment out this line by adding # at the beginning of the line

Then apply the change (recommended when no repo is being synced or published):

for i in pulp_resource_manager pulp_workers pulp_celerybeat; do service $i restart; done

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

The force_full overridden parameter was ignored, due to a bug in pulp source code.

Diagnostic Steps

  • force-fully publishing a repository e.g. like:
curl -i -H "Content-Type: application/json" -X POST -d "{\"id\":\"$repo\",\"override_config\":{\"force_full\":true}}" -u admin:$pulpAdminPassword https://$(hostname -f)/pulp/api/v2/repositories/$repo/actions/publish/
  • new directory under /var/lib/pulp/published/yum/master/yum_distributor/${repo} is created, but content is unchanged
SBR
Product(s)
Components
Category

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.