Bug 1277632 - webUI returns HTTP 500 when job search whiteboard contains a hyphen
Summary: webUI returns HTTP 500 when job search whiteboard contains a hyphen
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Beaker
Classification: Retired
Component: web UI
Version: 21
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: beaker-dev-list
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-03 17:05 UTC by Jiri Jaburek
Modified: 2015-11-20 16:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-20 16:46:21 UTC
Embargoed:


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

Description Jiri Jaburek 2015-11-03 17:05:55 UTC
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 23:22:10 UTC
(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 23:23:12 UTC
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 13:13:29 UTC
(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 23:31:12 UTC
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 16:44:03 UTC
Created attachment 1097263 [details]
screenshot of job list page as seen in native Beaker

Comment 7 Jiri Jaburek 2015-11-20 16:44:39 UTC
Created attachment 1097265 [details]
screenshot of job list page altered by a greasemonkey script

Comment 8 Jiri Jaburek 2015-11-20 16:46:21 UTC
(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.