Bug 1223835 - An hourly alert based on provider throws exception
Summary: An hourly alert based on provider throws exception
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.4.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.4.0
Assignee: Bill Wei
QA Contact: Milan Falešník
URL:
Whiteboard:
: 1265325 (view as bug list)
Depends On:
Blocks: 1265323
TreeView+ depends on / blocked
 
Reported: 2015-05-21 13:56 UTC by Dave Johnson
Modified: 2019-07-11 09:53 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-16 13:02:45 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1506153 0 Learn more None On cloudforms 3.1, alerts set for the count of "provider.cluster" do not trigger 2019-07-11 09:53:05 UTC
Red Hat Product Errata RHBA-2015:1100 0 normal SHIPPED_LIVE CFME 5.4.0 bug fixes, and enhancement update 2015-06-16 16:28:42 UTC

Description Dave Johnson 2015-05-21 13:56:58 UTC
Description of problem:
=================================
Upgraded an appliance John Hardy sent me and ran into this exception in the logs which is tied to miq_alert...

[----] E, [2015-05-21T09:34:39.328751 #29375:587e9c] ERROR -- : MIQ(MiqQueue.deliver)    Message id: [1000114186144], Error: [Association named 'ext_management_system' was not found; perhaps you misspelled it?]
[----] E, [2015-05-21T09:34:39.329000 #29375:587e9c] ERROR -- : [ActiveRecord::ConfigurationError]: Association named 'ext_management_system' was not found; perhaps you misspelled it?  Method:[rescue in deliver]
[----] E, [2015-05-21T09:34:39.329158 #29375:587e9c] ERROR -- : /opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:150:in `block in records_by_reflection'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:146:in `each'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:146:in `group_by'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:146:in `records_by_reflection'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:139:in `grouped_records'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:130:in `preload_one'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:109:in `preload'
/var/www/miq/vmdb/lib/extensions/ar_virtual.rb:302:in `preload_with_virtual'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:98:in `block in run'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:98:in `each'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/associations/preloader.rb:98:in `run'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/relation.rb:181:in `block in exec_queries'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/relation.rb:180:in `each'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/relation.rb:180:in `exec_queries'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/relation.rb:160:in `block in to_a'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/explain.rb:40:in `logging_query_plan'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/relation.rb:159:in `to_a'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/activerecord/lib/active_record/relation/query_methods.rb:72:in `select'
/var/www/miq/vmdb/app/models/miq_alert.rb:155:in `block (2 levels) in evaluate_hourly_timer'
/var/www/miq/vmdb/app/models/miq_alert.rb:150:in `each'
/var/www/miq/vmdb/app/models/miq_alert.rb:150:in `block in evaluate_hourly_timer'
/var/www/miq/vmdb/app/models/miq_alert.rb:148:in `each'
/var/www/miq/vmdb/app/models/miq_alert.rb:148:in `evaluate_hourly_timer'
/var/www/miq/vmdb/app/models/miq_queue.rb:356:in `block in deliver'
/opt/rh/ruby200/root/usr/share/ruby/timeout.rb:66:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:352:in `deliver'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:107:in `deliver_queue_message'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:135:in `deliver_message'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:152:in `block in do_work'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:146:in `loop'
/var/www/miq/vmdb/lib/workers/queue_worker_base.rb:146:in `do_work'
/var/www/miq/vmdb/lib/workers/worker_base.rb:323:in `block in do_work_loop'
/var/www/miq/vmdb/lib/workers/worker_base.rb:320:in `loop'
/var/www/miq/vmdb/lib/workers/worker_base.rb:320:in `do_work_loop'
/var/www/miq/vmdb/lib/workers/worker_base.rb:141:in `run'
/var/www/miq/vmdb/lib/workers/worker_base.rb:122:in `start'
/var/www/miq/vmdb/lib/workers/worker_base.rb:23:in `start_worker'
/var/www/miq/vmdb/lib/workers/bin/worker.rb:3:in `<top (required)>'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/railties/lib/rails/commands/runner.rb:52:in `eval'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/railties/lib/rails/commands/runner.rb:52:in `<top (required)>'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/railties/lib/rails/commands.rb:64:in `require'
/opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/railties/lib/rails/commands.rb:64:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'



Version-Release number of selected component (if applicable):
==============================================================
5.3.0.15 to 5.4.0.1 upgrade


How reproducible:
===================
100% ???  The exception keeps happening


Steps to Reproduce:
==============================
1.  upgrade appliance from jhardy
2.  db migrate
3.  fix auth
4.  service evmserverd start


Actual results:
================
exception in the logs


Expected results:
================
no exception

Comment 5 Dave Johnson 2015-06-04 15:15:02 UTC
John and the eng team leads decided that we should get this one into 5.4.0 release

Comment 6 Greg McCullough 2015-06-04 21:27:05 UTC
https://github.com/ManageIQ/manageiq/pull/2979

Comment 7 CFME Bot 2015-06-04 21:51:09 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/787a7f08233b0741b039068996bbba4f16f40ae0

commit 787a7f08233b0741b039068996bbba4f16f40ae0
Author:     Bill Wei <bilwei>
AuthorDate: Fri May 22 09:00:07 2015 -0400
Commit:     Bill Wei <bilwei>
CommitDate: Thu Jun 4 15:58:13 2015 -0400

    Call Zone's accessor methods to get models' instances in current zone
    
    Add a set of {tablename}_without_a_zone methods to get instances that are not connected to the zone
    through ext_management_system association.
    
    Add spec tests for MiqAlert.evaluate_hourly_timer
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1223835

 vmdb/app/models/miq_alert.rb       | 15 +++++----
 vmdb/app/models/zone.rb            | 44 +++++++++++++++++++--------
 vmdb/spec/models/miq_alert_spec.rb | 62 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 100 insertions(+), 21 deletions(-)

Comment 8 CFME Bot 2015-06-04 22:00:53 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=4d6ea158cd61500ba601d53b84fee4894884f526

commit 4d6ea158cd61500ba601d53b84fee4894884f526
Author:     Bill Wei <bilwei>
AuthorDate: Fri May 22 09:00:07 2015 -0400
Commit:     Bill Wei <bilwei>
CommitDate: Thu Jun 4 17:40:41 2015 -0400

    Call Zone's accessor methods to get models' instances in current zone
    
    Add a set of {tablename}_without_a_zone methods to get instances that are not connected to the zone
    through ext_management_system association.
    
    Add spec tests for MiqAlert.evaluate_hourly_timer
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1223835

 vmdb/app/models/miq_alert.rb       | 15 +++++----
 vmdb/app/models/zone.rb            | 44 +++++++++++++++++++--------
 vmdb/spec/models/miq_alert_spec.rb | 62 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 100 insertions(+), 21 deletions(-)

Comment 9 CFME Bot 2015-06-04 22:00:57 UTC
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=a70bb059f55d69b4472ee2b3b6de7ce95ba4ed30

commit a70bb059f55d69b4472ee2b3b6de7ce95ba4ed30
Merge: f2d6c32 4d6ea15
Author:     Greg McCullough <gmccullo>
AuthorDate: Thu Jun 4 17:57:13 2015 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Thu Jun 4 17:57:13 2015 -0400

    Merge branch 'product_provider_alert' into '5.4.z'
    
    Call Zone's accessor methods to get models' instances in current zone
    
    Add a set of {tablename}_without_a_zone methods to get instances that are not connected to the zone
    through ext_management_system association.
    
    Add spec tests for MiqAlert.evaluate_hourly_timer
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1223835
    
    See merge request !104

 vmdb/app/models/miq_alert.rb       | 15 +++++----
 vmdb/app/models/zone.rb            | 44 +++++++++++++++++++--------
 vmdb/spec/models/miq_alert_spec.rb | 62 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 100 insertions(+), 21 deletions(-)

Comment 11 Bill Wei 2015-06-05 15:39:28 UTC
To reproduce and verify fix for this bug you need to create a user alert Based on Provider, driving by Hourly Timer, and do nothing; then add the alert to an alert profile.

Looking for log to see the exception thrown every hour. With the fix the error is gone from the log.

Comment 12 Milan Falešník 2015-06-08 08:39:20 UTC
Verified in 5.4.0.5 against 5.4.0.4. The error is not present in the log file.

Comment 14 errata-xmlrpc 2015-06-16 13:02:45 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-2015-1100.html

Comment 15 CFME Bot 2015-09-23 21:30:59 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=7d6463013088618014af9b733ef6e9e99ba0624a

commit 7d6463013088618014af9b733ef6e9e99ba0624a
Author:     Bill Wei <bilwei>
AuthorDate: Fri May 22 09:00:07 2015 -0400
Commit:     Bill Wei <bilwei>
CommitDate: Tue Sep 22 16:11:59 2015 -0400

    Call Zone's accessor methods to get models' instances in current zone
    
    Add a set of {tablename}_without_a_zone methods to get instances that are not connected to the zone
    through ext_management_system association.
    
    Add spec tests for MiqAlert.evaluate_hourly_timer
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1223835

 vmdb/app/models/miq_alert.rb       | 15 +++++----
 vmdb/app/models/zone.rb            | 44 +++++++++++++++++++--------
 vmdb/spec/models/miq_alert_spec.rb | 62 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 100 insertions(+), 21 deletions(-)

Comment 16 CFME Bot 2015-09-23 21:33:36 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=7d6463013088618014af9b733ef6e9e99ba0624a

commit 7d6463013088618014af9b733ef6e9e99ba0624a
Author:     Bill Wei <bilwei>
AuthorDate: Fri May 22 09:00:07 2015 -0400
Commit:     Bill Wei <bilwei>
CommitDate: Tue Sep 22 16:11:59 2015 -0400

    Call Zone's accessor methods to get models' instances in current zone
    
    Add a set of {tablename}_without_a_zone methods to get instances that are not connected to the zone
    through ext_management_system association.
    
    Add spec tests for MiqAlert.evaluate_hourly_timer
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1223835

 vmdb/app/models/miq_alert.rb       | 15 +++++----
 vmdb/app/models/zone.rb            | 44 +++++++++++++++++++--------
 vmdb/spec/models/miq_alert_spec.rb | 62 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 100 insertions(+), 21 deletions(-)

Comment 17 Chris Pelland 2015-09-29 14:04:33 UTC
*** Bug 1265325 has been marked as a duplicate of this bug. ***


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