3016: Search sometimes results in internal server error

christia*********@gmai***** (Google Code) (Is this you? Claim this profile.)
July 12, 2013
2544
What version are you running?
1.7.9

What's the URL of the page containing the problem?
Any search url which does not correspond to a review request id (e.g. http://reviewboard/r/search/?q=update)

What steps will reproduce the problem?
1. Type something in the search box which is not a review request id
2. Click on the search button or hit enter

What is the expected output? What do you see instead?
Expected is to get a list of review requests matching the search query. Get an Error 500 instead

What operating system are you using? What browser?
Linux, Ubuntu 12.04, Firefox 21, IE9, MySql backend

Please provide any additional information below.

This problem is a bit weird. I have set up the search according to the reviewboard documentation. If I type a review request id into the search box I will be taken directly to that review request as expected.

If I type a number into that box which does not correspond to a request id I get this stack trace:

Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.9-py2.7.egg/reviewboard/accounts/decorators.py", line 20, in _check
    return login_required(view_func)(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.7.15-py2.7.egg/djblets/auth/util.py", line 47, in _checklogin
    return view_func(request, *args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.9-py2.7.egg/reviewboard/reviews/views.py", line 1405, in search
    for hit in searcher.search(parser.parse(query))]

JavaError: java.lang.IndexOutOfBoundsException: Not a valid hit number: 0
    Java stacktrace:
java.lang.IndexOutOfBoundsException: Not a valid hit number: 0
	at org.apache.lucene.search.Hits.hitDoc(Hits.java:202)
	at org.apache.lucene.search.Hits.doc(Hits.java:155)



<WSGIRequest
path:/r/search/,
GET:<QueryDict: {u'q': [u'123456']}>,
POST:<QueryDict: {}>,


If I type a string into that search box, I get a slightly different stack trace:

Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.5-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.9-py2.7.egg/reviewboard/accounts/decorators.py", line 20, in _check
    return login_required(view_func)(*args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/Djblets-0.7.15-py2.7.egg/djblets/auth/util.py", line 47, in _checklogin
    return view_func(request, *args, **kwargs)

  File "/usr/local/lib/python2.7/dist-packages/ReviewBoard-1.7.9-py2.7.egg/reviewboard/reviews/views.py", line 1405, in search
    for hit in searcher.search(parser.parse(query))]

TypeError: Document<stored/uncompressed<id:6110>>


<WSGIRequest
path:/r/search/,
GET:<QueryDict: {u'q': [u'readme']}>,
POST:<QueryDict: {}>,


In any case if I type something into the search box and wait a little while then the drop down box will populate with a list of all requests  matching the search (with nice highlighting which part matched the search query)) and I can select a review request from this list.

So it's kind of partially working.
#1 subodh******@gmai***** (Google Code) (Is this you? Claim this profile.)
Refer https://code.google.com/p/reviewboard/issues/detail?id=2544 and you shall get your fix.
david
#2 david