+++ 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:
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.
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