Bug 1540699

Summary: Selecting filter with "expression Service: Aggregate All Vm Cpus" results in exception
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: APIAssignee: Nick LaMuro <nlamuro>
Status: CLOSED ERRATA QA Contact: Matouš Mojžíš <mmojzis>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, hkataria, lavenel, mmojzis, mpovolny, nlamuro, obarenbo, simaishi
Target Milestone: GAKeywords: ZStream
Target Release: 5.8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ui:filter
Fixed In Version: 5.8.3.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1539710 Environment:
Last Closed: 2018-02-28 13:13:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On: 1539710    
Bug Blocks:    

Comment 2 CFME Bot 2018-02-01 15:02:15 UTC
New commit detected on ManageIQ/manageiq/fine:
https://github.com/ManageIQ/manageiq/commit/a6d06865680a9741aa22ee35d21227d86c01077e

commit a6d06865680a9741aa22ee35d21227d86c01077e
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Wed Jan 31 10:24:37 2018 -0500
Commit:     Satoe Imaishi <simaishi>
CommitDate: Thu Feb 1 09:45:35 2018 -0500

    Merge pull request #16915 from NickLaMuro/bz-1539710-quick-fix-avoid-service-agg-col-with-miq-exp
    
    Exclude Service::AGGREGATE_ALL_VM_ATTRS from MiqExp.to_sql
    (cherry picked from commit 57095386dfb0fe1d799a1ad7bfc6fef6278dac98)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1540699

 lib/miq_expression.rb | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Comment 3 Matouš Mojžíš 2018-02-21 10:26:57 UTC
Nick,
how can I verify this in 5.8 when there are no filters in My Services?
Thanks

Comment 4 Nick LaMuro 2018-02-21 16:51:43 UTC
Matouš,

Here is how I was able to reproduce the error pre patch (and with the patch, it no longer is reproducible):


1. Login and got to the Services -> My Services page:
2. Select the Advanced Search button (the double 'v' down arrow, to the right of the searchbox and magnifying glass button)
3. Select the following from the dropdowns in order:
  - "Field"
  - "Service:  Aggrigate All Vm Cpus
  - ">" (any operator would work, but I choose this)
  - "100" (again, any value would work here)
4. Click the checkmark above the search filter to apply it to the search
5. Click "Apply"

From here, you should get an error if the patch is not applied, otherwise you will get the updated search results.

Comment 5 Matouš Mojžíš 2018-02-22 15:54:36 UTC
Verified in 5.8.3.3.I ran in rails console command 'MiqExpression.new("=" => {"field" => "Service-aggregate_all_vm_cpus", "value" => "454"}).to_sql' without errors.

Comment 8 errata-xmlrpc 2018-02-28 13:13:50 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://access.redhat.com/errata/RHSA-2018:0374