Bug 1767512

Summary: When collecting logs with unconfigured redhat-support tool, it says the collection is successful in the UI
Product: Red Hat CloudForms Management Engine Reporter: Angelina Vasileva <anikifor>
Component: ApplianceAssignee: drew uhlmann <duhlmann>
Status: CLOSED CURRENTRELEASE QA Contact: Jaroslav Henner <jhenner>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.10.12CC: abellott, dmetzger, jrafanie, obarenbo
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.12.0Flags: mfeifer: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1771720 1771722 (view as bug list) Environment:
Last Closed: 2020-10-26 16:25:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1765635, 1771720, 1771722    

Description Angelina Vasileva 2019-10-31 15:50:53 UTC
Description of problem:
New tool for log collection was introduced here https://bugzilla.redhat.com/show_bug.cgi?id=1765635 and according to "Notes about using this tool." it should be configured.

However, in the UI it is possible to select "Red Hat Support" option and collect logs. In this case, after clicking the collect button, it says:

Last Message    Log files were successfully collected

In the evm.log there's a message:
[----] I, [2019-10-31T11:13:37.371690 #10643:10b8f50]  INFO -- : MIQ(FileDepotRedhatSupport#upload) Please enter your RHN user ID: 
failed.
ERROR: The RHN user ID cannot be empty.
 
But also in the logs it looks like the logs were collected, e.g.:
[----] I, [2019-10-31T11:13:37.392029 #10643:10b8f50]  INFO -- : MIQ(MiqTask#update_status) Task: [50] [Active] [Ok] [Current log files from EVM default MiqServer 1 are posted]

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

How reproducible:
Always

Steps to Reproduce:
1. Configuration -> Diagnostics -> Collect Logs -> Edit
2. Type: Red Hat Support
3. Save
4. Collect -> Collect current logs

Actual results:
The UI message and messages in the logs are misleading.

Expected results:
If there's an error, logs are not collected and it's reflected both in the UI and in the logs.

Additional info:

Comment 4 Joe Rafaniello 2019-11-01 14:00:51 UTC
Also see https://bugzilla.redhat.com/show_bug.cgi?id=1765635#c10

That's an example of an error from the support-tool that we should propagate up through an exception so it's not lost

Comment 6 drew uhlmann 2019-11-07 18:07:17 UTC
https://github.com/ManageIQ/manageiq/pull/19480

Comment 7 Joe Rafaniello 2019-11-07 20:23:38 UTC
We opened a bug in support tool to fix the the error handling so errors exit with non-zero exit code and write to stderr.

See https://bugzilla.redhat.com/show_bug.cgi?id=1769963

Comment 8 drew uhlmann 2019-11-12 18:43:00 UTC
Moving to post because our hacky hack will "fix" this until comment 7 gets resolved, if it gets resolved.