Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1619563 - Health check met python KeyError: 'resources'
Health check met python KeyError: 'resources'
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking (Show other bugs)
3.11.0
Unspecified Unspecified
medium Severity medium
: ---
: 3.11.0
Assigned To: Miciah Dashiel Butler Masters
Wenkai Shi
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-21 04:07 EDT by Wenkai Shi
Modified: 2018-10-11 03:25 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-10-11 03:25:25 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github https://github.com/openshift/openshift-ansible/pull/9700 None None None 2018-08-21 12:33 EDT
Red Hat Product Errata RHBA-2018:2652 None None None 2018-10-11 03:25 EDT

  None (edit)
Description Wenkai Shi 2018-08-21 04:07:20 EDT
Description of problem:
Run health check met python KeyError: 'resources'.

Version-Release number of the following components:
openshift-ansible-3.11.0-0.17.0.git.0.d3888d7None.noarch
ansible-2.6.2-1.el7ae.noarch

How reproducible:
100%

Steps to Reproduce:
1. Setup a OCP cluster
2. Execute health check
# ansible-playbook -i inventory -vv /usr/share/ansible/openshift-ansible/playbooks/openshift-checks/health.yml
3.

Actual results:
# ansible-playbook -i inventory -vv /usr/share/ansible/openshift-ansible/playbooks/openshift-checks/health.yml
...
               check "sdn":
               'resources'
               Traceback (most recent call last):
                 File "/usr/share/ansible/openshift-ansible/roles/openshift_health_checker/action_plugins/openshift_health_check.py", line 225, in run_check
                   result = check.run()
                 File "/usr/share/ansible/openshift-ansible/roles/openshift_health_checker/openshift_checks/sdn.py", line 69, in run
                   self.check_master()
                 File "/usr/share/ansible/openshift-ansible/roles/openshift_health_checker/openshift_checks/sdn.py", line 160, in check_master
                   nodes = self.get_resource('nodes')
                 File "/usr/share/ansible/openshift-ansible/roles/openshift_health_checker/openshift_checks/sdn.py", line 214, in get_resource
                   for resource in self.task_vars['resources']['results']:
               KeyError: 'resources'
...


Expected results:
Installer shouldn't never print out python error whatever the cluster is healthy or not.

Additional info:
Comment 4 Miciah Dashiel Butler Masters 2018-08-21 12:33:20 EDT
The issue is that the openshift-checks/health.yml playbook was not getting cluster resources before running the health checks.  The openshift-checks/adhoc.yml playbook does do this, and we want to be able to run the SDN check using either playbook, so I copied the relevant code from the adhoc playbook to the health playbook.

PR: https://github.com/openshift/openshift-ansible/pull/9700
Comment 5 openshift-github-bot 2018-08-31 13:07:48 EDT
Commit pushed to master at https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/1ff1a0bb135f5ebd43c73ff841773cac12e7e6a0
Get cluster resources for SDN check in health.yml

Get cluster resources for the SDN check in health.yml,
same as in adhoc.yml.

This commit fixes bug 1619563.

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

* playbooks/openshift-checks/private/health.yml: Add task
to get cluster resources for the SDN check.
Comment 7 Wenkai Shi 2018-09-06 05:38:41 EDT
Verified with version openshift-ansible-3.11.0-0.28.0.git.0.730d4be.el7.noarch, python error doesn't appear.
Comment 9 errata-xmlrpc 2018-10-11 03:25:25 EDT
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-2018:2652

Note You need to log in before you can comment on or make changes to this bug.