Bug 1723733

Summary: Connection error for EC2 CR not rescued correctly
Product: Red Hat Satellite Reporter: Lukáš Hellebrandt <lhellebr>
Component: Compute Resources - EC2Assignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: dvoss, lzap, mmccune
Target Milestone: 6.6.0Keywords: Regression, TestBlocker, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.22.0.22-1 Doc Type: If docs needed, set a value
Doc Text:
In certain situations the error messages when creating new Amazon EC2 Compute Resources may be misleading. Users are encouraged to verify their username and passwords before creating EC2 Compute Resources.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 12:47:39 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 Lukáš Hellebrandt 2019-06-25 09:04:07 UTC
Description of problem:
When trying to add a Compute Resource of type EC2 (when Loading Regions), I get the following error in WebUI: "An error occurred while testing the connection: Internal Server Error". The resource is then not added.

Also, I get the traceback (attached) in logs.
The traceback suggests that there are wrong credentials but I triple-checked them and the same credentials work for me on Sat 6.5.

Version-Release number of selected component (if applicable):
Reproduced on 3 different hosts with Sat 6.6 snap 7. Couldn not reproduce on Sat 6.5.

How reproducible:
Deterministic

Steps to Reproduce:
1. Infrastructure -> Compute Resources -> Create
2. Select type AWS
3. Enter your Access Key and Secret Key
4. Click "Load Regions"

Actual results:
Error, traceback

Expected results:
Regions loaded

Comment 4 Lukáš Hellebrandt 2019-06-25 11:53:51 UTC
This issue has been there for days and shortly after I reported it, it is fixed. Has somebody fixed it and forgot to write it here? Or maybe just some infra issues. Anyway:
1) I can create an EC2 CR now in 6.6
2) This is still an issue because the displayed message was ISE
3) I don't have a reproducer for this now. Merely entering wrong credentials doesn't work because the message in WebUI doesn't say "ISE" but "Error while trying to create resource: AuthFailure => AWS was not able to validate the provided access credentials" which is correct. And it obviously shows that the original issue was not caused just by incorrect credentials.

Comment 5 jcallaha 2019-06-28 15:35:26 UTC
Lukas, can you verify that the core functionality is working and that the only issue remaining in this bug is the displayed message? If so, could you remove the blocker flag?

Comment 6 Lukáš Hellebrandt 2019-07-01 12:48:34 UTC
Unfortunately, I can't. The issue manifests again. And again, only in Sat 6.6. As this has changed at least two times, I suspect some dependency on external resource has been added in 6.6.

Comment 7 Marek Hulan 2019-08-08 15:07:57 UTC
Please provide the full trace, if there's none in the UI, then at least production.log.

Comment 8 Marek Hulan 2019-08-08 15:08:30 UTC
Created redmine issue https://projects.theforeman.org/issues/27555 from this bug

Comment 10 Lukas Zapletal 2019-08-14 13:12:34 UTC
Associating issue that does NOT fix the issue, however it fixes error message.

https://projects.theforeman.org/issues/27624

Need more info, EC2 is returning me 401 all the time, I probably have a wrong password.

Comment 12 Lukáš Hellebrandt 2019-09-04 09:40:12 UTC
As described in comment 4 and comment 6, this BZ's reproducer is not deterministic (perhaps due to dependency on some external resource). Sometimes, this can be reproduced for days and sometimes it can't. Right now, I am not able to reproduce the issue. If you want to solve this BZ by fixing the error message, it would be fine. In that case, I will file a new BZ once I hit the issue again.

Comment 14 Lukáš Hellebrandt 2019-09-16 11:49:10 UTC
Verified with Sat 6.6 snap 20.

I am still not able to reproduce the exact issue. Verified by causing error by filling incorrect credentials. => "AuthFailure => AWS was not able to validate the provided access credentials", no traceback.

Comment 16 errata-xmlrpc 2019-10-22 12:47:39 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, 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-2019:3172