Bug 1275364 - ActiveRecord::AssociationNotFoundError in evm.log
ActiveRecord::AssociationNotFoundError in evm.log
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers (Show other bugs)
Unspecified Unspecified
medium Severity medium
: GA
: 5.5.0
Assigned To: Keenan Brock
Milan Falešník
: 1277300 1282932 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2015-10-26 12:48 EDT by Milan Falešník
Modified: 2015-12-08 08:40 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-08 08:40:01 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Excerpt from evm.log. (4.26 KB, text/plain)
2015-10-26 12:48 EDT, Milan Falešník
no flags Details

  None (edit)
Description Milan Falešník 2015-10-26 12:48:39 EDT
Created attachment 1086555 [details]
Excerpt from evm.log.

Description of problem:
I noticed this error happening in evm.log when I was looking for something else. I am not entirely sure what triggers this, but the appliance manages SCVMM SP1 (that was used to verify a bug), vSphere 5.5, RHOS5, RHOS6). I am including the excerpt from log as an attachment.

Version-Release number of selected component (if applicable):

How reproducible:
not sure

Additional information:
If you need, I can help with adding mentioned providers into your environment.
Comment 5 Greg Blomquist 2015-10-29 13:57:03 EDT
copying bits from the previous private comment to a public comment

From the stack trace, the last thing to be executed is:

> /var/www/miq/vmdb/app/models/mixins/aggregation_mixin.rb:107:in `aggregate_hardware'

Which can be seen here: 

And, after parsing the string interpolation, it's calling:

> region.all_host_ids

I just verified that the following fails on the

> # bundle exec rails c
> Loading production environment (Rails 4.2.4)
> irb(main):001:0> r = MiqRegion.first
>  MiqRegion Inst Including Associations (9.3ms - 1rows)
> => #<MiqRegion id: 1, region: 0, created_at: "2015-10-29 09:35:36", updated_at: "2015-10-29 09:35:36", description: "Region 0", guid: "6875e7aa-7e20-11e5-8eca-fa163ee7eed5">
> irb(main):002:0> r.all_host_ids
> ActiveRecord::AssociationNotFoundError: Association named 'hosts' was not found on MiqRegion; perhaps you misspelled it?
Comment 6 Greg Blomquist 2015-10-29 14:21:35 EDT

Already a PR open for this, luckily!
Comment 7 dmetzger 2015-11-02 08:22:09 EST
PR https://github.com/ManageIQ/manageiq/pull/5212 created.
Comment 8 Keenan Brock 2015-11-05 10:33:00 EST
marking as post.
Specific errors can be addressed with individual bugs
Comment 9 Keenan Brock 2015-11-05 11:21:53 EST
oops - wrong bug. reverting back to on_dev until merged into 5.5
Comment 10 Greg Blomquist 2015-11-16 11:24:15 EST
*** Bug 1277300 has been marked as a duplicate of this bug. ***
Comment 11 CFME Bot 2015-11-16 16:17:07 EST
New commit detected on cfme/5.5.z:

commit 0b19abef5bda8a0f53e068bffde26ed48a2635ba
Author:     Dennis Metzger <dmetzger@redhat.com>
AuthorDate: Mon Sep 28 09:41:24 2015 -0400
Commit:     Keenan Brock <kbrock@redhat.com>
CommitDate: Thu Nov 5 11:25:06 2015 -0500

    Added virtual association for *_ids

 app/models/metric/finders.rb           |  2 +-
 lib/extensions/ar_virtual.rb           |  4 ++++
 spec/lib/extensions/ar_virtual_spec.rb | 24 ++++++++++++++++++++++++
 3 files changed, 29 insertions(+), 1 deletion(-)
Comment 12 CFME Bot 2015-11-16 16:18:04 EST
New commit detected on cfme/5.5.z:

commit d76036d9472fd62dbba037defcc1700434c1628f
Merge: dab81d5 0b19abe
Author:     Greg McCullough <gmccullo@redhat.com>
AuthorDate: Fri Nov 13 13:55:17 2015 -0500
Commit:     Greg McCullough <gmccullo@redhat.com>
CommitDate: Fri Nov 13 13:55:17 2015 -0500

    Merge branch 'virtual_association_fix_mr' into '5.5.z'
    Added virtual association for *_ids
    cherry picked cleanly from https://github.com/ManageIQ/manageiq/pull/5212
    See merge request !367

 app/models/metric/finders.rb           |  2 +-
 lib/extensions/ar_virtual.rb           |  4 ++++
 spec/lib/extensions/ar_virtual_spec.rb | 24 ++++++++++++++++++++++++
 3 files changed, 29 insertions(+), 1 deletion(-)
Comment 13 Milan Zázrivec 2015-11-19 11:25:49 EST
*** Bug 1282932 has been marked as a duplicate of this bug. ***
Comment 14 Milan Falešník 2015-11-23 11:37:27 EST
This error is no longer present in the evm.log in, also verified using the console.
Comment 16 errata-xmlrpc 2015-12-08 08:40:01 EST
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.


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