Unable to Enable/disable repository on Red Hat Satellite server due to error repository conflicts with existing relative URL.
Environment
- Red Hat Satellite 6.9 and below
Issue
- Unable to Enable/disable repository on Red Hat Satellite server due to error repository conflicts with existing relative URL..
Relative URL [Organization/Library/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/6.4/os] for repository [5643b217-cfa4-4a90-9e69-63f538cdaa83] conflicts with existing relative URL [Organization/Library/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/6.4/os] for repository [88fed7ce-ac38-4f98-b244-82f0cd89af87]
Resolution
- Delete the orphaned repository from Pulp using pulp-admin command as below. To install pulp-admin, please follow this link
- Delete the repository with UUID at the end of the error log -
88fed7ce-ac38-4f98-b244-82f0cd89af87in our example:
$ pass=$(grep ^default_password /etc/pulp/server.conf | cut -d' ' -f2)
$ pulp-admin --username admin --password $pass rpm repo delete --repo-id 88fed7ce-ac38-4f98-b244-82f0cd89af87
-
Run below command to optionally remove the repository from the katello DB, replace the pulp-id with the id of repo which needs to be deleted:
# su - postgres -c "psql foreman -c \"DELETE from katello_repositories where pulp_id = '5643b217-cfa4-4a90-9e69-63f538cdaa83' or pulp_id = '88fed7ce-ac38-4f98-b244-82f0cd89af87';\"" -
Run below command to remove the relative path of the repository from the katello db:
# su - postgres -c "psql foreman -c \"DELETE from katello_repositories where relative_path = 'Organization/Library/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/6.4/os';\"" -
If either postgres DELETE command fails to delete anything, it is OK - those entries might but not need to be present. Just if they exist, they would prevent proper repo enabling/disabling.
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.
Root Cause
- The currently-synced repository caused a conflict with a newer repository that was trying to be synced.
Diagnostic Steps
- Check whether the repository exists in the Katello database or not.
1) su - postgres -c "psql foreman -c \"select * from katello_repositories where pulp_id = '5643b217-cfa4-4a90-9e69-63f538cdaa83' or pulp_id = '88fed7ce-ac38-4f98-b244-82f0cd89af87';\""
2) su - postgres -c "psql foreman -c \"select * from katello_repositories where relative_path='$Organization/Library/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/6.4/os';\""
- If the above commands show nothing then check whether it exists in Pulp or not :
$ pass=$(grep ^default_password /etc/pulp/server.conf | cut -d' ' -f2)
$ pulp-admin --username admin --password $pass repo list --repo-id 88fed7ce-ac38-4f98-b244-82f0cd89af87
+----------------------------------------------------------------------+
Repositories
+----------------------------------------------------------------------+
Id: 88fed7ce-ac38-4f98-b244-82f0cd89af87
Display Name: Example Repository
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.