Bug 1984548 - Unregistering satellite host from insights doesn't change insights status for that host to "Not reporting" on Satellite UI.
Summary: Unregistering satellite host from insights doesn't change insights status for...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: RH Cloud - Inventory
Version: 6.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.9.4
Assignee: Shimon Shtein
QA Contact: Jameer Pathan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-21 15:22 UTC by James Jeffers
Modified: 2021-07-29 12:59 UTC (History)
5 users (show)

Fixed In Version: tfm-rubygem-foreman_rh_cloud-3.0.24.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1976853
Environment:
Last Closed: 2021-07-29 12:58:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:2948 0 None None None 2021-07-29 12:59:12 UTC

Comment 2 Ashish Humbe 2021-07-26 18:17:48 UTC
FAILED_QA:

After unregistering the client system using " insights-client --unregister", we can still see Insights status as Reporting for the client system in Satellite webui ( All Hosts page)


Insights:	Reporting

Comment 3 Ashish Humbe 2021-07-26 18:18:11 UTC
# rpm -qa | grep rh_cloud
tfm-rubygem-foreman_rh_cloud-3.0.24.1-1.el7sat.noarch

Comment 4 Ashish Humbe 2021-07-27 10:24:02 UTC
When we use legacy_upload = False option in the /etc/insights-client/insights-client.conf I see the --test-connection works properly


# insights-client --test-connection --net-debug
GET https://dhcp130-146.gsslab.pnq2.redhat.com:443/redhat_access/r/insights/v1/branch_info
GET branch_info status: 200
Running Connection Tests...
=== Begin Upload URL Connection Test ===
Testing https://dhcp130-146.gsslab.pnq2.redhat.com:443/redhat_access/r/insights/platform/ingress/v1/upload
HTTP Status Code: 202
HTTP Status Text: Accepted
HTTP Response Text: {"request_id":"12b555601eda4fb48bc624d0a2f0d463","upload":{"account_number":"540155"}}
Successfully connected to: https://dhcp130-146.gsslab.pnq2.redhat.com:443/redhat_access/r/insights/platform/ingress/v1/upload
=== End Upload URL Connection Test: SUCCESS ===

=== Begin API URL Connection Test ===
Testing https://dhcp130-146.gsslab.pnq2.redhat.com:443/redhat_access/r/insights/platform/apicast-tests/ping
HTTP Status Code: 200
HTTP Status Text: OK
HTTP Response Text: {"status":"available"}
Successfully connected to: https://dhcp130-146.gsslab.pnq2.redhat.com:443/redhat_access/r/insights/platform/apicast-tests/ping
=== End API URL Connection Test: SUCCESS ===

Connectivity tests completed successfully
See /var/log/insights-client/insights-client.log for more details.

Comment 5 Ashish Humbe 2021-07-27 10:26:40 UTC
Please ignore the earlier comment, it was for the bz #1984550 update. 

Sorry for the confusion.

Comment 6 Shimon Shtein 2021-07-27 10:58:15 UTC
You will have to wait until the aging mechanism decides it's a stale host. By default it's 48 hours and then the status updating task will run and move it to "red".

You can speed up the process, if you patch the code:

The interval lives here: https://github.com/theforeman/foreman_rh_cloud/blob/e61ab9d2af519e3aec5b9f40a4de324d27d9811f/app/models/insights_client_report_status.rb#L2
you can change it to 1.minutes
The task schedule lives here: https://github.com/theforeman/foreman_rh_cloud/blob/e61ab9d2af519e3aec5b9f40a4de324d27d9811f/lib/foreman_rh_cloud/engine.rb#L152
you can change the cron line to '0 * * * *' and it will run every minute.

@ahumbe can you please retest it with the patches?

Comment 7 Sudhir Mallamprabhakara 2021-07-27 12:23:00 UTC
Based on Comment 6, adding need info flag for Ashish.

Comment 8 Ashish Humbe 2021-07-27 12:35:59 UTC
Hi Shim,

I tried the suggested changes and set REPORT_INTERVAL =  1.minutes instead of 48.hours and also the cron change followed by # foreman-maintain service restart 

Even after 5-10 mins, I see insights status as Reporting.


Regards,
Ashish

Comment 10 Ashish Humbe 2021-07-27 16:12:11 UTC
Manually executing rake command to update the insights client aging data with " ForemanTasks.sync_task(InsightsCloud::Async::InsightsClientStatusAging)" command helps to reflect the webui status immediately. 

After executing the rake task, the Insights Status gets updated as " Not reporting " for the system which is unregistered from Insights, so marking this Bugzilla verified.

Comment 15 errata-xmlrpc 2021-07-29 12:58:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Satellite 6.9.4 Async Bug Fix Update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:2948


Note You need to log in before you can comment on or make changes to this bug.