Bug 1545322

Summary: Metrics capture logs errors for NetworkPort without ems_ref on Undercloud Network provider
Product: Red Hat CloudForms Management Engine Reporter: Ido Ovadia <iovadia>
Component: ProvidersAssignee: Scott Seago <sseago>
Status: CLOSED ERRATA QA Contact: Ido Ovadia <iovadia>
Severity: high Docs Contact:
Priority: medium    
Version: 5.9.0CC: cpelland, gblomqui, jfrey, jhardy, obarenbo, simaishi, sseago
Target Milestone: GA   
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-07 23:01:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Openstack Target Upstream Version:
Description Flags
evm log none

Description Ido Ovadia 2018-02-14 16:04:51 UTC
Created attachment 1396008 [details]
evm log

Description of problem:
Metrics capture logs errors for NetworkPort without ems_ref on Undercloud Network provider

Error: [undefined method `[]' for nil:NilClass] on evm log

evm.log enclosed 

Version-Release number of selected component:
============================================= + RHOS10
How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 1 Scott Seago 2018-03-26 03:45:51 UTC
There seem to be two different things going on here:
1) Something has caused a NetworkPort to lose its ems_ref (or to never get it in the first place).
2) In trying to map metrics from NetworkPorts to the parent resource for metrics capture, the code is blowing up on a nil ems_ref

For 1), there's no information in the bug report to point to exactly what NetworkPorts have a nil ems_ref and how that came about. If that is, itself, a reproducible event, perhaps that could be fixed separately in another reported bug.

For here, 2) points to an obvious bug in the codebase. We need to check for nil references in the mapping and move onto the next one when it happens (since a NetworkPort nil ems_ref isn't actually useful in mapping from the metrics to the parent resource)

Comment 3 CFME Bot 2018-04-02 18:27:09 UTC
New commit detected on ManageIQ/manageiq-providers-openstack/master:

commit ee268196200d7e2c1ae3480a681184d22bcc4459
Author:     Scott Seago <sseago@redhat.com>
AuthorDate: Wed Mar 28 12:59:10 2018 -0400
Commit:     Scott Seago <sseago@redhat.com>
CommitDate: Wed Mar 28 12:59:10 2018 -0400

    BZ1545322: metrics capture shouldn't fail on nil NetworkPort ems_ref

    Check for nil before attempting to generate a resource ID based on ems_ref

 app/models/manageiq/providers/openstack/base_metrics_capture.rb | 14 +-
 1 file changed, 8 insertions(+), 6 deletions(-)

Comment 4 Ido Ovadia 2018-08-19 15:11:01 UTC

Comment 5 errata-xmlrpc 2019-02-07 23:01:17 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.