Bug #33305
closedThe katello-ca-consumer is not being removed when the force option is checked in the 'Advanced' tab under Hosts -> Register Host
Description
Description of problem:
Trying to register a host(already register to another Satellite) by going to Hosts -> Register Host and check the 'force' option in 'Advanced' tab is failing as the katello-ca-consumer installed is not being removed.
Version-Release number of selected component (if applicable):
How reproducible:
100%
Steps to Reproduce:
1. Satellite webUI -> Hosts -> Register Host
2. Fill the fields and in the 'Advanced' tab check the 'Force' options
3. Register the host with the registration command generated
Actual results:
The registration command does not remove the katello-ca-consumer packages.
The 'Force' option is supposed to:
---
"Remove any `katello-ca-consumer` rpms before registration and run subscription-manager with `--force` argument."
--
The script seems to look for this 'katello-ca-consumer-latest.noarch.rpm' and can't find a package with this name installed.
Expected results:
Remove the katello-ca-consumer and install a new one. Otherwise, the transaction will conflict:
---
Transaction check error:
file /usr/bin/katello-rhsm-consumer from install of katello-ca-consumer-rguerra-sat610.rguerra.lab-1.0-1.noarch conflicts with file from package katello-ca-consumer-rguerra-cap610.rguerra.lab-1.0-1.noarch
Error Summary
---
Additional info:
From my LAB:
---
1. Register the system to a satellite server:
[root@rhel7-02 ~]# subscription-manager register --org="ACME" --activationkey="ak-rhel7-library" --force
The system has been registered with ID: 2d9c0316-717d-4422-91b0-c2761c87b84a
The registered system name is: rhel7-02.rguerra.lab
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status: Subscribed
[root@rhel7-02 ~]# rpm -qa |grep katello-ca
katello-ca-consumer-janga.rguerra.lab-1.0-9.noarch
[root@rhel7-02 ~]# curl -sS --insecure 'https://rguerra-sat610.rguerra.lab:9090/register?activation_keys=ak-rhel7&force=true&lifecycle_environment_id=2&location_id=2&operatingsystem_id=1&organization_id=1&update_packages=false' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MjkzMDY2ODMsImp0aSI6ImFjMTdhNmNkMTI4MmFkY2RiYzExNzkxMTVlNDEyMmI3ZDI0MTNjY2VlYmU4MDM3YjFjZjBjYmNhYTFmOTM2NDQiLCJleHAiOjE2MjkzMjEwODMsInNjb3BlIjoicmVnaXN0cmF0aW9uI2dsb2JhbCByZWdpc3RyYXRpb24jaG9zdCJ9.goxamrSaQs63-Jjd4HwofckTk9eAIR2dza2YTjE3fiM' | bash #
- Running registration
#
Loaded plugins: enabled_repos_upload, package_upload, product-id, search-disabled-repos, subscription-manager
No Match for argument: katello-ca-consumer-latest.noarch.rpm
No Match for argument: katello-ca-consumer-latest.noarch.rpm.1
No Match for argument: katello-ca-consumer-latest.noarch.rpm.2
No Match for argument: katello-ca-consumer-latest.noarch.rpm.3
No Match for argument: katello-ca-consumer-latest.noarch.rpm.4
No Packages marked for removal
Uploading Enabled Repositories Report
WARNING:dnf:Failed to synchronize cache for repo 'rhel-7-server-satellite-tools-6.7-rpms', ignoring this repo.
WARNING:dnf:Failed to synchronize cache for repo 'rhel-7-server-rpms', ignoring this repo.
WARNING:dnf:Failed to synchronize cache for repo 'rhel-7-server-ansible-2.9-rpms', ignoring this repo.
Loaded plugins: enabled_repos_upload, package_upload, product-id, search-disabled-repos, subscription-manager
Examining /tmp/tmp.NtMfIcwnfG.rpm: katello-ca-consumer-rguerra-sat610.rguerra.lab-1.0-1.noarch
Marking /tmp/tmp.NtMfIcwnfG.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package katello-ca-consumer-rguerra-sat610.rguerra.lab.noarch 0:1.0-1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================
Installing:
katello-ca-consumer-rguerra-sat610.rguerra.lab noarch 1.0-1 /tmp.NtMfIcwnfG 20 k
Transaction Summary
=============================================================================================================================================================================================
Install 1 Package
Total size: 20 k
Installed size: 20 k
Downloading packages:
Running transaction check
Running transaction test
Transaction check error:
file /usr/bin/katello-rhsm-consumer from install of katello-ca-consumer-rguerra-sat610.rguerra.lab-1.0-1.noarch conflicts with file from package katello-ca-consumer-janga.rguerra.lab-1.0-9.noarch
Error Summary
-------------
Uploading Enabled Repositories Report
WARNING:dnf:Failed to synchronize cache for repo 'rhel-7-server-satellite-tools-6.7-rpms', ignoring this repo.
WARNING:dnf:Failed to synchronize cache for repo 'rhel-7-server-rpms', ignoring this repo.
WARNING:dnf:Failed to synchronize cache for repo 'rhel-7-server-ansible-2.9-rpms', ignoring this repo.
Unregistering from: janga.rguerra.lab:8443/rhsm
The system with UUID 2d9c0316-717d-4422-91b0-c2761c87b84a has been unregistered
All local data removed
HTTP error (404 - Not Found): Couldn't find activation key 'ak-rhel7' <<<<< This is due to the katello-ca-consumer installed at the first registration.
3. Check the registration and package installed:
---
[root@rhel7-02 ~]# subscription-manager identity ; rpm qa |grep katello-ca-consumer
This system is not yet registered. Try 'subscription-manager register --help' for more information.
katello-ca-consumer-janga.rguerra.lab-1.0-9.noarch
--
Updated by Rafael Cavalcanti about 3 years ago
- Pull request https://github.com/theforeman/foreman/pull/8723 added
Updated by Ewoud Kohl van Wijngaarden about 3 years ago
- Category set to Host registration
- Status changed from New to Closed
- Target version set to 3.0.0
- Triaged changed from No to Yes
- Fixed in Releases 3.1.0 added
Updated by Amit Upadhye about 3 years ago
- Pull request https://github.com/theforeman/foreman/pull/8737 added
- Fixed in Releases 3.0.0 added