Bug 504012 - ISE when searching for systems yields no results
ISE when searching for systems yields no results
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Jay Dobies
wes hayutin
Depends On:
Blocks: 457073
  Show dependency treegraph
Reported: 2009-06-03 15:13 EDT by Jay Dobies
Modified: 2009-09-10 15:32 EDT (History)
2 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-10 15:32:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jay Dobies 2009-06-03 15:13:55 EDT
Description of problem:
See summary.

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

How reproducible:

Steps to Reproduce:
1. I added a number of systems through the QA API tests, all of whose names begin with "api-test"
2. Navigate to Systems > Advanced Search
3. Enter a search to produce nothing (I used "qwertyqwerty".
Actual results:
ISE (stack trace below)

Expected results:
Indication of no results

Additional info:
Selecting "Invert search results" successfully displayed the results (since there were results returned). The "No results found" message added as part of the previous attempt that produced the ISE also appeared on the top.

Stack trace snippet:
2009-06-03 15:06:23,970 [TP-Processor3] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/rhn].[action] - Servlet.service() for servlet action threw exception
	at com.redhat.rhn.frontend.action.systems.SystemSearchSetupAction.execute(SystemSearchSetupAction.java:171)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
	at com.redhat.rhn.frontend.struts.RhnRequestProcessor.process(RhnRequestProcessor.java:82)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)

It looks like it's just an error in the logging logic:
  log.info("SystemSearch results.size() = " + results.size());
  if ((results != null) && (results.size() == 1)) {

The null check is *after* the log message which attempts to call size() on the results.

@Triage Team:
This is a quick fix to get rid of the NPE. But searching with no results seems like a reasonably common use case, so I'm filing it as a separate BZ so it gets QA'd. I will address this as I fix 495594.
Comment 1 Jay Dobies 2009-06-03 16:01:54 EDT
commit	81a911525f938b5599fcd7f38017d7ecae1b5d6b
tree	8cc9a00af5430a9b4977b56d85a0cbfd94f9b04a

commit	2707ef1ba06708257ac78eb3d5bc51a6a31e3a57
tree	f986eacdd1d02b8ace77b9bbf9f42c28077afaaf

Fixed issue where invert flag disappeared on pagination; fixed ISE when search produces no results.

Also general clean up of the class.
Comment 2 wes hayutin 2009-06-08 12:07:44 EDT
verified.. 6/5 build
Comment 3 John Matthews 2009-08-20 09:35:49 EDT
tested on sun-x4200-01 

Did a system search on a name that returned no results.
Comment 4 Miroslav Suchý 2009-08-20 09:44:57 EDT
no ise. instead it display no matches found.
verified in stage.
Comment 5 Brandon Perkins 2009-09-10 15:32:38 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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