How to regenerate repository metadata on Red Hat Satellite 6.10 or above?
Environment
- Red Hat Satellite 6.10+
Issue
-
Is it possible to regenerate metadata of the synchronized repositories in a Satellite 6.10 or above as the GUI option no longer exists?
-
Having corrupted/inconcsistent/missing some repository metadata of a Content View version, is there a way to fix that?
Resolution
Republish metadata of standalone repositories:
-
If the requirement is to republish/regenerate the metadata of a repository that is synced in Satellite but perhaps showing the wrong package count or missing some of the metadata files, then use the following API:
For Red Hat Satellite OS RHEL8:
# curl -ku admin:password -X PUT -H "Content-Type: application/json" \ https://`hostname -f`/katello/api/repositories/10/republish?force=true | python3 -m json.toolFor Red Hat Satellite OS RHEL7:
# curl -ku admin:password -X PUT -H "Content-Type: application/json" \ https://`hostname -f`/katello/api/repositories/10/republish?force=true | python -m json.toolwhere,
admin:passwordis basically the user credentials of Satellite having the correct privileges that can execute the API successfully.10is the example ID of the repository in question. The id of the repositories can be obtained from thehammer repository listcommand, or as the trailing number inproducts/123/repositories/10-like URI when opening the repository in WebUI -
Wait until the invoked
Metadata generatetask is complete (one can monitor their status e.g. inWebUI -> Monitor -> Tasks page).
Republish metadata of all the repositories part of a specific content-view version:
-
If the requirement is to republish\regenerate the metadata of all the repositories part of a specific content-view version, Then follow the approach documented below.
-
Use the
hammer content-view version listcommand to list all the versions of the content-views and then identify the ID associated with those versions. -
Or, In the WebUI, click open the version of the CV to be repaired and the URI will end up with something like
/content_views/4/versions/23. The number (23here) is the CV version ID. -
Once the CV version ID has been identified, Use the same with the following command:
hammer content-view version republish-repositories --id 23 --force true -
Wait until the invoked
Republish RepositoriesandMetadata generatetasks are completed (one can monitor their status e.g. inWebUI -> Monitor -> Tasks page).
-
In case of any further concerns or queries, reach out to This content is not included.Red Hat Technical Support.
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.
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.