Bug 1333095 - [NoMethodError] undefined method `metrics_collector_queue_name'
Summary: [NoMethodError] undefined method `metrics_collector_queue_name'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: C&U Capacity and Utilization
Version: 5.5.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: GA
: 5.5.5
Assignee: Keenan Brock
QA Contact: Nandini Chandra
URL:
Whiteboard: c&u:report
: 1333096 (view as bug list)
Depends On: 1332579
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-04 16:03 UTC by John Prause
Modified: 2019-12-16 05:44 UTC (History)
9 users (show)

Fixed In Version: 5.5.5.2
Doc Type: Bug Fix
Doc Text:
Previously, some reports run on virtual machines did not generate any data, and reported an error with the metrics_collector_queue_name method. This problem occurred when a virtual machine was disconnected from the EMS but remained connected to a cluster, and metrics collection continued to be scheduled for that virtual machine. The capture_cloud_targets metric has been rewritten to fix this issue, so that metrics collection only occurs on virtual machines which are both powered on and attached to an EMS.
Clone Of: 1332579
Environment:
Last Closed: 2016-07-26 15:33:27 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:


Attachments (Terms of Use)
Only Send vms with an ems (883 bytes, patch)
2016-05-18 16:13 UTC, Keenan Brock
no flags Details | Diff
patch b to fix missing ems with infra provider (392 bytes, patch)
2016-06-14 19:46 UTC, Keenan Brock
no flags Details | Diff
patch ab (cumulative) to fix metrics_collector_queue_name error (missing ems) (1.08 KB, patch)
2016-06-14 19:47 UTC, Keenan Brock
no flags Details | Diff
Patch c to fix cap u for storages (2.16 KB, patch)
2016-06-24 18:01 UTC, Keenan Brock
no flags Details | Diff
patch abc to fix metrics_collector_queue_name error (2.83 KB, patch)
2016-06-24 18:02 UTC, Keenan Brock
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1488 normal SHIPPED_LIVE CFME 5.5.5 bug fixes and enhancement update 2016-07-26 19:28:27 UTC

Comment 1 Keenan Brock 2016-05-18 16:13:15 UTC
Created attachment 1158902 [details]
Only Send vms with an ems

This will limit out the suspect VMs

Comment 2 Keenan Brock 2016-05-18 16:14:45 UTC
Hello Colin,

Does this fix things for you.

Comment 4 Keenan Brock 2016-05-18 17:16:50 UTC
This has been fixed upstream on master

5.5 MR for this issue:

https://gitlab.cloudforms.lab.eng.rdu2.redhat.com/cloudforms/cfme/merge_requests/944

jared - there is an included patch. did you try using that to fix the customer's issue?

Comment 5 Keenan Brock 2016-05-18 17:23:47 UTC
*** Bug 1333096 has been marked as a duplicate of this bug. ***

Comment 9 CFME Bot 2016-06-14 15:41:45 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=7a4f936d9fcee3d5809f9179eb09c2bc5195130f

commit 7a4f936d9fcee3d5809f9179eb09c2bc5195130f
Merge: 36e52a8 8dd4da6
Author:     Oleg Barenboim <obarenbo@redhat.com>
AuthorDate: Tue Jun 14 11:37:41 2016 -0400
Commit:     Oleg Barenboim <obarenbo@redhat.com>
CommitDate: Tue Jun 14 11:37:41 2016 -0400

    Merge branch 'cap_u_queue_name' into '5.5.z'
    
    Cap&U: don't capture vms that have no ems
    
    This is custom code and NOT a backport
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1333095
    
    The error:
    
    [NoMethodError]: undefined method `metrics_collector_queue_name'
    for nil:NilClass  Method:[rescue in deliver]
    
    This has been fixed on master across a number of PRs.
    It is too invasive to back port these changes to 5.5.
    So this is a temporary fix that will fix the problem but will
    not get the performance advantages of those on master.
    
    Master has these instead: [#8429], [#8363], (and probably others)
    
    [#8429]: http://github.com/ManageIQ/manageiq/issues/8429
    [#8363]: http://github.com/ManageIQ/manageiq/issues/8363
    
    See merge request !944

 app/models/metric/targets.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comment 10 Keenan Brock 2016-06-14 19:46:16 UTC
Created attachment 1167956 [details]
patch b to fix missing ems with infra provider

Providing a second patch to apply on an environment that has already been patched with the previous patch

Comment 11 Keenan Brock 2016-06-14 19:47:54 UTC
Created attachment 1167957 [details]
patch ab (cumulative) to fix metrics_collector_queue_name error (missing ems)

Also adding 1333095_ab.patch which contains the contents of both _a and _b.

This will allow you to apply this to new customers.

The _a is currently in 5.5.z, working on getting second patch into z stream for next week

Comment 12 Keenan Brock 2016-06-24 18:01:21 UTC
Created attachment 1172019 [details]
Patch c to fix cap u for storages

There were issues with the past patch for storages.
This is the current proposal for c.

This is meant to apply on top of patches a,b (or ab)

There is another patch abc that is a cumulation of a,b,c

Comment 13 Keenan Brock 2016-06-24 18:02:49 UTC
Created attachment 1172020 [details]
patch abc to fix metrics_collector_queue_name error

Cumulative patch for metrics_collector_queue_name errors

Comment 14 Thomas Hennessy 2016-06-24 18:47:21 UTC
I have a customer who has encountered the same reported problem but unlike the other SF cases I have reviewed (where the CFME level is at 5.5.2.4) this customer is at CFME 5.5.3.4.

Is this patch appropriate for this  level of code?

Please advise

Comment 15 CFME Bot 2016-06-25 04:57:33 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=0ea81dd9b0dc24e2157bb0ce9778e7520373f104

commit 0ea81dd9b0dc24e2157bb0ce9778e7520373f104
Author:     Keenan Brock <kbrock@redhat.com>
AuthorDate: Tue Jun 14 15:41:03 2016 -0400
Commit:     Keenan Brock <kbrock@redhat.com>
CommitDate: Fri Jun 24 15:49:50 2016 -0400

    Fix metrics_collector_queue_name error
    
    aka: Don't cap&u infra vms without an ems
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1333095
    
    The previous patches were for cloud
    
    ```
    ERROR -- : [NoMethodError]: undefined method `metrics_collector_queue_name` for nil:NilClass
    app/models/metric/ci_mixin/capture.rb:19:in `queue_name_for_metrics_collection'
    app/models/metric/ci_mixin/capture.rb:69:in `perf_capture_queue'
    app/models/metric/capture.rb:127:in `block in perf_capture_timer'
    app/models/metric/capture.rb:112:in `each'
    app/models/metric/capture.rb:112:in `perf_capture_timer'
    ```

 app/models/metric/ci_mixin/capture.rb | 5 +----
 app/models/metric/targets.rb          | 5 +++--
 app/models/storage.rb                 | 4 ++++
 3 files changed, 8 insertions(+), 6 deletions(-)

Comment 16 CFME Bot 2016-06-25 04:57:37 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=f8489706f3d4ee1157d75ef87100afae248dbcf8

commit f8489706f3d4ee1157d75ef87100afae248dbcf8
Merge: 177848f 0ea81dd
Author:     Greg Blomquist <gblomqui@redhat.com>
AuthorDate: Sat Jun 25 00:55:20 2016 -0400
Commit:     Greg Blomquist <gblomqui@redhat.com>
CommitDate: Sat Jun 25 00:55:20 2016 -0400

    Merge branch '55z_queue_name_infra' into '5.5.z'
    
    Fix metrics_collector_queue_name error
    
    aka: Don't cap & u infra vms that have no ems
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1333095
    
    The previous patches were for cloud
    
    This is not from a MR. This is not an issue on 5.6.
    The changes to 5.6 seemed a little too big for me, so I applied a simple fix to 5.5
    
    ---
    
    Current error
    ```
    ERROR -- : [NoMethodError]: undefined method `metrics_collector_queue_name` for nil:NilClass
    app/models/metric/ci_mixin/capture.rb:19:in `queue_name_for_metrics_collection'
    app/models/metric/ci_mixin/capture.rb:69:in `perf_capture_queue'
    app/models/metric/capture.rb:127:in `block in perf_capture_timer'
    app/models/metric/capture.rb:112:in `each'
    app/models/metric/capture.rb:112:in `perf_capture_timer'
    ```
    
    See merge request !970

 app/models/metric/ci_mixin/capture.rb | 5 +----
 app/models/metric/targets.rb          | 5 +++--
 app/models/storage.rb                 | 4 ++++
 3 files changed, 8 insertions(+), 6 deletions(-)

Comment 18 Nandini Chandra 2016-07-19 18:05:34 UTC
Verified in  5.5.5.2

Comment 20 errata-xmlrpc 2016-07-26 15:33:27 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://rhn.redhat.com/errata/RHBA-2016-1488.html


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