Bug 1828947

Summary: show users actual error when API fails to come up
Product: OpenShift Container Platform Reporter: Abhinav Dahiya <adahiya>
Component: InstallerAssignee: Abhinav Dahiya <adahiya>
Installer sub component: openshift-installer QA Contact: jima
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: jima
Version: 4.5   
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1828948 (view as bug list) Environment:
Last Closed: 2020-07-13 17:32:22 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:
Bug Depends On:    
Bug Blocks: 1828948    

Description Abhinav Dahiya 2020-04-28 16:03:15 UTC
Description of problem:

previously all the errors were context Deadline exceeded, with this change the error returned is the last tracked error.

This is useful as the user has more information about what the failure could be.

For example, BZ https://bugzilla.redhat.com/show_bug.cgi?id=1810318#c8
the `.openshift_install.log` had the following debug log.
```
time="2020-03-04T21:08:13Z" level=debug msg="Still waiting for the Kubernetes API: Get https://api.openshift10.az.test-am-cloudpak.io:6443/version?timeout=32s: dial tcp: lookup api.openshift10.az.test-am-cloudpak.io on 127.0.0.53:53: no such host"
```
but the error returned to the use was
```
FATAL Bootstrap failed to complete: waiting for Kubernetes API: context deadline exceeded
```

returning the last tracked error would help users as they don't have to look into log file for most errors.

Version-Release number of the following components:
rpm -q openshift-ansible
rpm -q ansible
ansible --version

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:
Please include the entire output from the last TASK line through the end of output if an error is generated

Expected results:

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 3 jima 2020-05-07 07:34:09 UTC
The issue has been verified on nightly build: 4.5.0-0.nightly-2020-05-07-033157.
During cluster installation, after lb server is powered on, shutdown it and let installation failed.
The console output print the last error instead of "context deadline exceeded"
https://mastern-jenkins-csb-openshift-qe.cloud.paas.psi.redhat.com/job/Launch Environment Flexy/91931/console

On previous load, we can see "context deadline exceeded" when haproxy service is not started on lb server.
https://mastern-jenkins-csb-openshift-qe.cloud.paas.psi.redhat.com/job/Launch Environment Flexy/91131/console

Comment 4 errata-xmlrpc 2020-07-13 17:32:22 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/RHBA-2020:2409