Bug 2123776

Summary: Insights-client is in an unhandled state once the system is unregistered from rhsm
Product: Red Hat Enterprise Linux 9 Reporter: Alba Hita <ahitacat>
Component: insights-clientAssignee: Alba Hita <ahitacat>
Status: CLOSED CURRENTRELEASE QA Contact: Pavol Kotvan <pakotvan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.1CC: ahumbe, cmarinea, fjansen, stomsa
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-07 08:16:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alba Hita 2022-09-02 15:12:16 UTC
>>> Description of problem:
Insights-client is in a faulty state when the system is unregistered from rhsm. 

>>> Version-Release number of selected component (if applicable):
Client: 3.1.7
Core: 3.0.291-1

>>> How reproducible:
Every time the system is unregistered from rhsm.

Steps to Reproduce:
1.Register to rhsm via subscription-manager and insights-client
> sudo subscription-manager register
> sudo insights-client --register
> sudo insights-client --status
System is registered locally via .registered file. Registered at 2022-08-31T12:29:02.150601
Insights API confirms registration.

2. Unregister with subscription-manager
> sudo subscription-manager unregister
Unregistering from: subscription.rhsm.redhat.com:443/subscription
System has been unregistered.

3. Register again with subscription-manager
> sudo subscription-manager register
Registering to: subscription.rhsm.redhat.com:443/subscription
Username: ahitacat
Password: 
The system has been registered with ID: 367d8152-8d84-4565-9c06-a5da4a5db323
The registered system name is: localhost.localdomain


Actual results:
> sudo insights-client --status
System is registered locally via .registered file. Registered at 2022-08-31T12:29:02.150601
Insights API says this machine is NOT registered.


Expected results:
If API says that the machine is NOT registered it should remove the registration files that are in the system.

Additional info:

This will bring a consistent status to insights-client when it detects it is not register to rhsm.

Comment 4 Alba Hita 2022-12-05 10:34:49 UTC
This fix is part of egg version 3.0.303.