Bug 1303074
Summary: | Error while executing a report | |||
---|---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | Nikhil Gupta <ngupta> | |
Component: | Reporting | Assignee: | Joe Rafaniello <jrafanie> | |
Status: | CLOSED ERRATA | QA Contact: | Shveta <sshveta> | |
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 5.4.0 | CC: | cpelland, dajohnso, jhardy, jprause, jrafanie, mfeifer, obarenbo, psavage | |
Target Milestone: | GA | Keywords: | ZStream | |
Target Release: | 5.6.0 | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | 5.6.0.0 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1304003 1304006 (view as bug list) | Environment: | ||
Last Closed: | 2016-06-29 15:35:08 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | Bug | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1304003, 1304006 |
Description
Nikhil Gupta
2016-01-29 13:19:20 UTC
Assigning to add test case New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/43ced0fbc46b0b801f7b108e8f3bea982d392ed7 commit 43ced0fbc46b0b801f7b108e8f3bea982d392ed7 Author: Joe Rafaniello <jrafanie> AuthorDate: Fri Feb 12 15:02:45 2016 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Fri Feb 12 15:26:00 2016 -0500 Specify the has_many through source using the belongs_to, not an alias. Also, specify the source_type as rails requests. Note, we specify VmOrTemplate here because VmOrTemplate is where this has_many is located. It seems like this has_many may belong in MiqTemplate. Fixes the following error: ``` ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source association(s) :vm in model MiqProvision. Try 'has_many :miq_provision_vms, :through => :miq_provisions_from_template, :source => <name>'. Is it one of miq_request, source, destination, miq_request_tasks, miq_request_task, or tenant? ``` This resolves the model bug reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1303074 We still need to see if we can generate reports based on this now fixed has_many :through. app/models/vm_or_template.rb | 2 +- spec/models/vm_or_template_spec.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/be75310804b9deb1544da61a382f0aaa342e2d78 commit be75310804b9deb1544da61a382f0aaa342e2d78 Author: Joe Rafaniello <jrafanie> AuthorDate: Tue Feb 16 09:00:51 2016 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Feb 16 09:07:48 2016 -0500 Add a test for MiqReport#generate_table with a has_many through. Remove unused common test setup. Follow up to #6650 https://bugzilla.redhat.com/show_bug.cgi?id=1303074 spec/models/miq_report_spec.rb | 52 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/fbac6c0c4026c31809e25706ec2537664449be1b commit fbac6c0c4026c31809e25706ec2537664449be1b Author: Joe Rafaniello <jrafanie> AuthorDate: Tue Feb 23 15:27:20 2016 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Feb 23 15:30:18 2016 -0500 Refine the has_many through test based on a reported issue. The first cut of this test was a first attempt to recreate the problem by simplifying the report. This commit implements the exact reported issue and verifies the backend code does the correct thing. https://bugzilla.redhat.com/show_bug.cgi?id=1303074 Followup to #6650 and #6690 spec/models/miq_report_spec.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) We have fixed a bug in our code but there's also a change required in your report definition. In the recreation steps there are a few changes to the report you wanted to do: 1. Navigate to Cloud Intelligence ==> Reports ==> Reports. 2. Configuration ==> Add a new Report 3. In Columns tab, enter Name and Title ==? In Base the report on select "Virtual Machines" 4. In Editing report, select "Name" 5. In Consolidation, Column 1 ==> Name 6. In Filter, set following condition: FIND Virtual Machine.Provisioned VMs : Thin Provisioned = "true" CHECK ALL Thin Provisioned = "true" 7. In Summary, Sort report by ==> Name 8. Save 9. Now Queue it. [CHANGES] Step 3: Base the report on "Template", because you're looking for thin provisioned vms based on a template. Step 4/5: you'll need select miq_provision_vms.name because you want to see the name of the thin provisioned vm, not the template's name (from step 3 change above). Step 6: create a filter based on the template change from step 3: FIND Template.Provisioned VMs : Thin Provisioned = "true" CHECK ALL Thin Provisioned = "true" New commit detected on cfme/5.4.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=9decefad3cbac3121438cf5cc30ef2acdf2131ef commit 9decefad3cbac3121438cf5cc30ef2acdf2131ef Author: Joe Rafaniello <jrafanie> AuthorDate: Fri Feb 12 15:02:45 2016 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Mar 1 15:43:07 2016 -0500 Specify the has_many through source using the belongs_to, not an alias. Also, specify the source_type as rails requests. Note, we specify VmOrTemplate here because VmOrTemplate is where this has_many is located. It seems like this has_many may belong in MiqTemplate. Fixes the following error: ``` ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source association(s) :vm in model MiqProvision. Try 'has_many :miq_provision_vms, :through => :miq_provisions_from_template, :source => <name>'. Is it one of miq_request, source, destination, miq_request_tasks, miq_request_task, or tenant? ``` This resolves the model bug reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1303074 We still need to see if we can generate reports based on this now fixed has_many :through. vmdb/app/models/vm_or_template.rb | 2 +- vmdb/spec/models/vm_or_template_spec.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) New commit detected on cfme/5.4.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=e3d5ac5b864b67204d06fe6ff58ce967de9a1df6 commit e3d5ac5b864b67204d06fe6ff58ce967de9a1df6 Author: Joe Rafaniello <jrafanie> AuthorDate: Tue Feb 16 09:00:51 2016 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Mar 1 15:43:07 2016 -0500 Add a test for MiqReport#generate_table with a has_many through. Remove unused common test setup. Follow up to #6650 https://bugzilla.redhat.com/show_bug.cgi?id=1303074 vmdb/spec/models/miq_report_spec.rb | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) New commit detected on cfme/5.4.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=578ebf27f62f98a92ce7e1188d2191fc8805f419 commit 578ebf27f62f98a92ce7e1188d2191fc8805f419 Author: Joe Rafaniello <jrafanie> AuthorDate: Tue Feb 23 15:27:20 2016 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Mar 1 15:46:41 2016 -0500 Refine the has_many through test based on a reported issue. The first cut of this test was a first attempt to recreate the problem by simplifying the report. This commit implements the exact reported issue and verifies the backend code does the correct thing. https://bugzilla.redhat.com/show_bug.cgi?id=1303074 Followup to #6650 and #6690 vmdb/spec/models/miq_report_spec.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=d0d46372d98d6da02f6ce094ffcdb3838e47e6d7 commit d0d46372d98d6da02f6ce094ffcdb3838e47e6d7 Author: Joe Rafaniello <jrafanie> AuthorDate: Tue Feb 16 09:00:51 2016 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Mar 1 14:43:09 2016 -0500 Add a test for MiqReport#generate_table with a has_many through. Remove unused common test setup. Follow up to #6650 https://bugzilla.redhat.com/show_bug.cgi?id=1303074 spec/models/miq_report_spec.rb | 52 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=c719e038d5e518a078a92057d725a3f265cbb842 commit c719e038d5e518a078a92057d725a3f265cbb842 Author: Joe Rafaniello <jrafanie> AuthorDate: Tue Feb 23 15:27:20 2016 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Mar 1 14:43:28 2016 -0500 Refine the has_many through test based on a reported issue. The first cut of this test was a first attempt to recreate the problem by simplifying the report. This commit implements the exact reported issue and verifies the backend code does the correct thing. https://bugzilla.redhat.com/show_bug.cgi?id=1303074 Followup to #6650 and #6690 spec/models/miq_report_spec.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=24fd1825b0b4cb2dfa066e608fe3b70358d8a05e commit 24fd1825b0b4cb2dfa066e608fe3b70358d8a05e Author: Joe Rafaniello <jrafanie> AuthorDate: Fri Feb 12 15:02:45 2016 -0500 Commit: Joe Rafaniello <jrafanie> CommitDate: Tue Mar 1 14:32:30 2016 -0500 Specify the has_many through source using the belongs_to, not an alias. Also, specify the source_type as rails requests. Note, we specify VmOrTemplate here because VmOrTemplate is where this has_many is located. It seems like this has_many may belong in MiqTemplate. Fixes the following error: ``` ActiveRecord::HasManyThroughSourceAssociationNotFoundError: Could not find the source association(s) :vm in model MiqProvision. Try 'has_many :miq_provision_vms, :through => :miq_provisions_from_template, :source => <name>'. Is it one of miq_request, source, destination, miq_request_tasks, miq_request_task, or tenant? ``` This resolves the model bug reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1303074 We still need to see if we can generate reports based on this now fixed has_many :through. app/models/vm_or_template.rb | 2 +- spec/models/vm_or_template_spec.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) Verified in 5.6.0.1-beta2.20160413141124_e25ac0e 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-2016:1348 |