Bug 2079909

Summary: Wrong message is displayed when GRC fails to connect to an ansible tower
Product: Red Hat Advanced Cluster Management for Kubernetes Reporter: Kevin Cormier <kcormier>
Component: ConsoleAssignee: magchen@redthat.com <magchen>
Status: CLOSED ERRATA QA Contact: Derek Ho <dho>
Severity: medium Docs Contact: Christopher Dawson <cdawson>
Priority: unspecified    
Version: rhacm-2.5CC: dho, dhuynh, ecai, gparvin, huichen, mdockery
Target Milestone: ---Flags: bot-tracker-sync: rhacm-2.5+
Target Release: rhacm-2.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2051752 Environment:
Last Closed: 2022-06-09 02:11:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kevin Cormier 2022-04-28 13:25:12 UTC
+++ This bug was initially created as a clone of Bug #2051752 +++

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 15:35:38 UTC
G2Bsync 1112353629 comment 
 KevinFCormier Thu, 28 Apr 2022 15:33:07 UTC 
 G2Bsync From @chenz4027 : 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.

Comment 6 errata-xmlrpc 2022-06-09 02:11:57 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 (Important: Red Hat Advanced Cluster Management 2.5 security updates, images, 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:4956