Bug 2069640

Summary: insights total risk chart network errors in new host page's overview tab
Product: Red Hat Satellite Reporter: Ron Lavi <rlavi>
Component: RH Cloud - InsightsAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: tstrych
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: aruzicka, ehelms
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_rh_cloud-5.0.34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:34:52 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 Ron Lavi 2022-03-29 10:47:53 UTC
Description of problem:

When accessing the overview tab on the new host page,
there are two network error responses with a 500 status.
the first one which tries the endpoint `/insights_cloud/hits/3` is because that specific host doesn't have recommendations.

and the second which comes right after that is failing due to the path ends with `/insights_cloud/hits/undefined`

this doesn't cause errors to be seen on the UI,
but rather an API call that could be avoided.

Version-Release number of selected component (if applicable):
6.11

How reproducible:
always

Steps to Reproduce:
1. go to the host's page and click on a host.
2. you should be redirected to the new host page's overview tab
3. open the dev-tools and inspect the network calls

Actual results:
a call with `undefined` instead of host_id is being executed

Expected results:
avoid the API call in case there's no available id,
try to make the first failure (if there are no hits) clearer

Additional info:

Comment 1 tstrych 2022-05-10 11:50:25 UTC
verified with sat 6.11 snap 19

 - error is now 404, with response message: "No recommendations were found for this host"
 - undefined error is no longer shown

Comment 4 errata-xmlrpc 2022-07-05 14:34:52 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 (Moderate: Satellite 6.11 Release), 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/RHSA-2022:5498