Bug 1377841

Summary: In "Advanced Search", if search result contain more than 500 entries then downloaded CSV does not include all entries retrurned by search
Product: [Community] Spacewalk Reporter: Eric Herget <eherget>
Component: ServerAssignee: Eric Herget <eherget>
Status: CLOSED CURRENTRELEASE QA Contact: Radovan Drazny <rdrazny>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.5CC: ahumbe, eherget, galtukho, pandujar, rdrazny, satqe-list, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: spacewalk-java-2.6.40-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1098141
: 1395870 (view as bug list) Environment:
Last Closed: 2017-09-27 19:19:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1098141    
Bug Blocks: 1395870, 1484117    

Description Eric Herget 2016-09-20 18:22:24 UTC
+++ This bug was initially created as a clone of Bug #1098141 +++

Description of problem:

If more than 500 entries are returned by the search engine (Advanced Search) then downloaded CSV does not include all of them. Very few entries are listed in the CSV file.

Some observations provided by customer: 

In the case of 1065 results on WebUI: Only 65 are returned in the csv.  
In the case of 1032 results on WebUI: Only 32 are returned in the csv.  
In the case of 1025 results on WebUI: Only 25 are returned in the csv.  
In the case of 999 results on WebUI: Only 499 are returned in the csv.  


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

How reproducible:
Always when search results are more than 500.

Steps to Reproduce:
1. Systems -> Advanced Search  
2. Put the search string​in "Search For:" and select appropriate "Field to Search:" Eg: Search for: dhcp   Field to Search: Name/Description
3. If search results are more than 500, click on "Download CSV" 

Actual results:

On above reproducer where search result have 3261 entries, ​the downloaded CSV contain list of only 261 entries. 

Expected results:

All entries from search result should be available in the CSV file 

Additional info:

In the case of 1065 results on WebUI: Only 65 are returned in the csv.  
In the case of 1032 results on WebUI: Only 32 are returned in the csv.  
In the case of 1025 results on WebUI: Only 25 are returned in the csv.  
In the case of 999 results on WebUI: Only 499 are returned in the csv.  
In the case of 2624 results on WebUI: Only 124 are returned in the csv.

Comment 1 Eric Herget 2016-09-20 18:52:35 UTC
In spacewalk.github, I submitted pull request # 459 so people have a chance to look at the changes before its committed to master branch.

Comment 2 Eric Herget 2016-10-03 16:11:34 UTC
spacewalk.github:
7b2183163dc8a8bc926517e3efd17c3b097441a0

Comment 3 Eric Herget 2016-10-05 14:22:16 UTC
Found and fixed an issue where new code did not behave like previous code.  When a query contains an "in clause" by an empty array is passed in as inClause, old code would return an empty DataResult object.  The new code was attempting to run the query without substituting for the inClause.  This fix causes an empty DataResult object to be returned, just as the old code did.

2 commits now (this one and one in comment 2)
spacewalk.github:
8808ba74f63014c37e630ee021192faec8af1327

Comment 4 Radovan Drazny 2016-11-11 11:11:15 UTC
Verified on spacewalk-java-2.6.47-1 using the reproducer from initial report using the reproducer from Bug #1098141. After performing an advanced search, returning more than 500 items, and downloading the cvs file, the file contains correct number of items.

Comment 5 Eric Herget 2017-09-27 19:19:40 UTC
This looks like it was fixed in previous release, but I'm closing it in this one.

Spacewalk 2.7 has been released.

https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes27

Comment 6 Grant Gainey 2017-10-03 20:02:27 UTC
*** Bug 1236625 has been marked as a duplicate of this bug. ***