[Satellite6] How to fix a broken repository on Capsule?

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.9 or older
    • Capsule of the same version

Issue

  • A Capsule has broken pulp repository due to whatever reason:
    • repo has invalid symbolic links to individual packages
    • or it has broken metadata
    • or it can't be synchronized or published
  • The repository sync & publish does not help.

How to fix the repo?

Resolution

Delete the repository on the Capsule and sync whole Capsule manually.

  • On Capsule:
pulpAdminPassword=$(grep ^default_password /etc/pulp/server.conf | cut -d' ' -f2)

repo=putHereThePulpRepoID

curl -i -H "Content-Type: application/json" -X DELETE -u admin:$pulpAdminPassword https://$(hostname -f)/pulp/api/v2/repositories/${repo}/

Wait few seconds till pulp deletes it (or to be 100% sure, run curl -u admin:$pulpAdminPassword https://$(hostname -f)/ with URI followed by _href value from the previous curl output and see if the state of the task is finished).

  • On Satellite, invoke Capsule synchronization - optimized one is sufficient.

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

During Capsule sync, Satellite compares list of repositories that are present on Capsule with the list of repositories expected to be there. Any extra repository is deleted and any missing repository is created and synchronized (and published).

Deleting the broken repository, we force Satellite to re-create it again, synchronize and publish on the Capsule from scratch.

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.