Bug 1277632 - webUI returns HTTP 500 when job search whiteboard contains a hyphen
webUI returns HTTP 500 when job search whiteboard contains a hyphen
Status: CLOSED NOTABUG
Product: Beaker
Classification: Community
Component: web UI (Show other bugs)
21
Unspecified Unspecified
medium Severity medium (vote)
: ---
: ---
Assigned To: beaker-dev-list
tools-bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-03 12:05 EST by Jiri Jaburek
Modified: 2015-11-20 11:46 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-20 11:46:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
screenshot of job list page as seen in native Beaker (9.29 KB, image/png)
2015-11-20 11:44 EST, Jiri Jaburek
no flags Details
screenshot of job list page altered by a greasemonkey script (10.00 KB, image/png)
2015-11-20 11:44 EST, Jiri Jaburek
no flags Details

  None (edit)
Description Jiri Jaburek 2015-11-03 12:05:55 EST
Description of problem:

1. go to https://your-beaker-instance/jobs
2. switch the Owner/Email field to Whiteboard
3. type in the adjacent text field any string with a hyphen (`-')
4. observe 500 Internal Error after ~2 seconds


Version-Release number of selected component (if applicable):
Beaker 21.1 / CherryPy 2.3.0

How reproducible:
always

Actual results:
The webui (or its http server) returns HTTP error, code 500.

Expected results:
The search should return results with the string present in whiteboard.

Additional info:
Comment 2 Dan Callaghan 2015-11-03 18:22:10 EST
(In reply to Jiri Jaburek from comment #1)
> .../jobs/?sfield=Whiteboard&searchwb=a-b&jobsearch.quick_search=a-b&simplesearch=

Hmm something is a bit odd about this URL. You didn't construct any portions of it by hand? Where did the sfield and searchwb params come from? We don't have any references to those in our source.

The actual URL you should get, if you click "Show Search Options", then field Whiteboard, operations Contains, value a-b, is:

/jobs/?jobsearch-0.table=Whiteboard&jobsearch-0.operation=contains&jobsearch-0.value=a-b

which will work fine. But the URL you have ended up at is a quick search for a-b which is not a valid quick search. The quick search strings are supposed to be Status-is-Queued or similar, they are hardcoded in the "quick search" buttons.
Comment 3 Dan Callaghan 2015-11-03 18:23:12 EST
Certainly it is a bug that Beaker is giving a 500 in this case, should be 400 or empty results or something. But I am more concerned about how you ended up at that URL in the first place.
Comment 4 Jiri Jaburek 2015-11-04 08:13:29 EST
(In reply to Dan Callaghan from comment #3)
> Certainly it is a bug that Beaker is giving a 500 in this case, should be
> 400 or empty results or something. But I am more concerned about how you
> ended up at that URL in the first place.

No, I haven't modified it by hand - as mentioned in the first post, it was generated directly by https://beaker-instance/jobs , which is URL I guesstimated after being unable to find any job search via the UI menu.
Comment 5 Dan Callaghan 2015-11-05 18:31:12 EST
I followed the steps in comment 0 and I end up at the URL I gave in comment 2:

/jobs/?jobsearch-0.table=Whiteboard&jobsearch-0.operation=contains&jobsearch-0.value=a-b

which has the expected query params, and it works. I cannot find any possible way that Beaker could be sending the jobsearch.quick_search=a-b query param (which is the one causing the 500 error).

Do you have any Greasemonkey scripts or anything else which might be interfering with the search bar on the jobs grid?
Comment 6 Jiri Jaburek 2015-11-20 11:44 EST
Created attachment 1097263 [details]
screenshot of job list page as seen in native Beaker
Comment 7 Jiri Jaburek 2015-11-20 11:44 EST
Created attachment 1097265 [details]
screenshot of job list page altered by a greasemonkey script
Comment 8 Jiri Jaburek 2015-11-20 11:46:21 EST
(In reply to Dan Callaghan from comment #5)
> I followed the steps in comment 0 and I end up at the URL I gave in comment
> 2:
> 
> /jobs/?jobsearch-0.table=Whiteboard&jobsearch-0.operation=contains&jobsearch-
> 0.value=a-b
> 
> which has the expected query params, and it works. I cannot find any
> possible way that Beaker could be sending the jobsearch.quick_search=a-b
> query param (which is the one causing the 500 error).
> 
> Do you have any Greasemonkey scripts or anything else which might be
> interfering with the search bar on the jobs grid?

Yes, it was a Greasemonkey adding a brand new form that I thought was provided by Beaker natively (see localized screenshots), I'm sorry for the confusion.

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