Bug 2051752

Summary: Wrong message is displayed when GRC fails to connect to an ansible tower
Product: Red Hat Advanced Cluster Management for Kubernetes Reporter: Derek Ho <dho>
Component: ConsoleAssignee: Kevin Cormier <kcormier>
Status: CLOSED ERRATA QA Contact: Derek Ho <dho>
Severity: medium Docs Contact: Mikela Dockery <mdockery>
Priority: unspecified    
Version: rhacm-2.4.zCC: dho, dhuynh, huichen, kcormier, magchen
Target Milestone: ---Flags: dho: qe_test_coverage+
bot-tracker-sync: rhacm-2.4.z+
Target Release: rhacm-2.4.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2079909 (view as bug list) Environment:
Last Closed: 2022-06-27 17:04:01 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:
Attachments:
Description Flags
Screenshot for the problem none

Description Derek Ho 2022-02-08 00:23:49 UTC
Created attachment 1859683 [details]
Screenshot for the problem

Description of the problem:
When the ansible tower was down, the GRC panel failed to connect. However, instead of displaying more informative message such as "connection timeout", the GRC panel displayed message like "JSON.parse: unexpected character at line 1 column 1 of the JSON data"

Release version:
2.4.z

Operator snapshot version:

OCP version:
4.9.18

Browser Info:
Firefox

Steps to reproduce:
1. Configure an Ansible Automation Platform credential
2. Deploy a policy and configure an automation ansible job
3. With the associated ansible tower down, select the created credential
4. GRC attempted to connect to the tower to retrieve available ansible jobs

Actual results:
The connection ended with message, "JSON.parse: unexpected character at line 1 column 1 of the JSON data"

Expected results:
Should be some message like "Connection timed out"

Additional info:

Comment 1 bot-tracker-sync 2022-04-28 14:15:09 UTC
G2Bsync 1112246282 comment 
 chenz4027 Thu, 28 Apr 2022 14:03:56 UTC 
 G2Bsync The fix will enhance the notification to make it more informative. However, the root cause of this issue - the fetch for an ansible secret with invalid url and invalid token is not resolved. What happened was that the fetch will stuck in pending  state instead of immediate timeout. After discussed with @jamestalton, The ideal way to handle this behavior is to introduce https://www.npmjs.com/package/ky to timeout, but we believe it is pretty risky to introduce a new library now. Will open a doc issue to doc this behavior. If the user is on this page, they will eventually time out and see the enhanced error message.

@KevinFCormier Do we still plan to put the fix for 2.4.5?

Comment 9 errata-xmlrpc 2022-06-27 17:04:01 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: Red Hat Advanced Cluster Management 2.4.5 security updates and bug fixes), 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:5201