Closed Bug 560703 Opened 14 years ago Closed 14 years ago

[k] /k/fr/search?q=Rechercher returns a 500 Internal Server Error

Categories

(support.mozilla.org :: Search, defect)

defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stephend, Assigned: jsocol)

References

()

Details

(Whiteboard: [k])

Summary: k/fr/search?q=Rechercher returns a 500 Internal Server Error → /k/fr/search?q=Rechercher returns a 500 Internal Server Error
I have a theory that this is caused by spelling suggestions, which are proving to be a huge pain to debug. My vote right now is to back out suggestions. It's not a crucial feature, and is easy to come back to in the future.
Assignee: nobody → james
Summary: /k/fr/search?q=Rechercher returns a 500 Internal Server Error → [k] /k/fr/search?q=Rechercher returns a 500 Internal Server Error
I'm ok with backing out. However, locally, I'm not getting suggestions for "Rechercher" so I'm suspicious about the cause. Perhaps just the internals of the suggestions functionality are throwing the error somehow, then?
Looks like we've set the socket timeout too low to pull excerpts from Sphinx. We'll try just upping that.

Stack trace (thanks bug 560752) from both this and bug 560731.

Traceback (most recent call last):

  File "/data/virtualenvs/kitsune/src/django/django/core/handlers/base.py", line 101, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/search/views.py", line 312, in search
    excerpt = wc.excerpt(wiki_page.data, cleaned['q'])

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/search/clients.py", line 121, in excerpt
    * settings.SEARCH_SUMMARY_LENGTH_MULTIPLIER})[0]

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/search/sphinxapi.py", line 807, in BuildExcerpts
    response = self._GetResponse(sock, VER_COMMAND_EXCERPT )

  File "/data/www/support-stage-new.mozilla.com/kitsune/apps/search/sphinxapi.py", line 223, in _GetResponse
    (status, ver, length) = unpack('>2HL', sock.recv(8))

timeout: timed out
Well, I'll up it, and also make sure we're handling it better.
Paul: r? http://github.com/jsocol/kitsune/commit/c7d6dc50e259a979227e0eee00b8ace0f56e64bb

Fixes:
 * Ups the K_TIMEOUT limit to 2 seconds.
 * Wraps BuildExcerpts in a try: block and if it catches a
   socket.timeout exception, uses an empty excerpt. (It seemed
   better than crashing and burning.)
 * Replaces some unnecessary double-quotes with single quotes.
http://github.com/jsocol/kitsune/commit/29d2134f6d0d5ca22e0bbdcf6832c21aea9ee00a

Merged and pushed.

Let's keep our eyes open for missing excerpts.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Verified FIXED on https://support-stage-new.mozilla.com/k/fr/search?q=Rechercher.

(I see missing excerpts; separate spin-off bug?)
Status: RESOLVED → VERIFIED
File a separate bug, but put it in 2.1.
(In reply to comment #10)
> File a separate bug, but put it in 2.1.

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