Bug 1591422

Summary: Proxy Error when performing advanced search
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ApplianceAssignee: Nick LaMuro <nlamuro>
Status: CLOSED ERRATA QA Contact: Matouš Mojžíš <mmojzis>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: abellott, jrafanie, nlamuro, obarenbo, rovalent, rspagnol, smallamp
Target Milestone: GAKeywords: ZStream
Target Release: 5.9.3   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.9.3.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1588082 Environment:
Last Closed: 2018-07-12 13:16:01 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: 1588082    
Bug Blocks:    

Comment 2 CFME Bot 2018-06-14 17:06:26 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:

https://github.com/ManageIQ/manageiq/commit/8db5dcede0158678e71f80489e95e3d46860aa66
commit 8db5dcede0158678e71f80489e95e3d46860aa66
Author:     Joe Rafaniello <jrafanie.github.com>
AuthorDate: Tue Jun 12 16:39:47 2018 -0400
Commit:     Joe Rafaniello <jrafanie.github.com>
CommitDate: Tue Jun 12 16:39:47 2018 -0400

    Merge pull request #17562 from NickLaMuro/miq_expression_extra_includes_exp_sql_support

    Allow models to include methods for MiqExpression sql evaluation
    (cherry picked from commit 52176a7565126734cd960b9d3ed349e683ddb263)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1591422

 app/models/hardware.rb | 6 +-
 app/models/vm_or_template.rb | 33 +
 lib/miq_expression.rb | 14 +
 spec/lib/miq_expression_spec.rb | 31 +
 spec/models/vm_or_template_spec.rb | 24 +
 5 files changed, 107 insertions(+), 1 deletion(-)

Comment 4 Nick LaMuro 2018-06-21 20:15:13 UTC
To replicate this bug, you can run the following script to populate a fresh database with data to replicate the issue:

    https://gist.github.com/NickLaMuro/1795ac3a02b7db76f770aa1699d3e1ab

To run script, you can do the following in the project dir on an appliance:

    $ bin/rails r bz_1588082_db_replication_script.rb


* * *

To replicate the issue, the easiest way is through the UI:


1. Go to `Compute` > `Infrastructure` > `VirtualMachines` 
  
2. Select "All VMs" from the tree on the left
  
3. Click the down arrow to the right of the search box
  
4. Create the following query (replace "XXX.XXX.XXX" with something that makes sense for your environment)
  
    Virtual Machine : IP Addresses INCLUDES ANY ['XXX.XXX.XXX']


The script will create random IPs resulting between the 10.XXX.XXX.XXX and 11.XXX.XXX.XXX, with around 25% not having any IP at all.

You can start with just "10." in the search criteria and should end up with around 35% of your records in the totals.

Comment 5 Matouš Mojžíš 2018-06-25 17:22:30 UTC
Verified in 5.9.3.2. In older versions performing advanced search for filtering IP addresses in big environments take too long and also returns no results.
In 5.9.3.2 it returns all the VMs containing the pattern and also rendering the view is fast.

Comment 7 errata-xmlrpc 2018-07-12 13:16:01 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:2184