Closed Bug 565146 Opened 14 years ago Closed 14 years ago

KeyError: result['total found']

Categories

(addons.mozilla.org Graveyard :: Search, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: clouserw, Assigned: davedash)

References

()

Details

(Whiteboard: [r=clouserw])

Traceback (most recent call last):

 File "/data/virtualenvs/zamboni/lib/python2.6/site-packages/django/core/handlers/base.py", line 101, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/data/amo_python/www/services.prod/zamboni/apps/api/urls.py", line 13, in <lambda>
   inner = lambda *args, **kw: cls()(*args, **kw)

 File "/data/amo_python/www/services.prod/zamboni/apps/api/views.py", line 94, in __call__
   return self.process_request(*args, **kwargs)

 File "/data/amo_python/www/services.prod/zamboni/apps/api/views.py", line 179, in process_request
   results = sc.query(query, limit=limit, **opts)

 File "/data/amo_python/www/services.prod/zamboni/apps/search/client.py", line 491, in query
   self.total_found = result['total_found'] if result else 0

KeyError: 'total_found'
Aw, sorry.  I was distracted by fligtar:  /en-US/firefox/api/1.2/search/%7C%7Cfacebook.com%5E%24third-party/all/10/WINNT/3.5.9
Priority: -- → P2
Blocks: 562669
Summary: YAKE (Yet another key error) → KeyError: result['total found']
http://github.com/davedash/zamboni/compare/master...keyerror-565146

and now we catch a lot more errors and log them, but make the user think there are zero results.
Status: NEW → ASSIGNED
Whiteboard: [r?clouserw]
http://github.com/jbalogh/zamboni/commits/8ac7823
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [r?clouserw] → [r=clouserw]
I oscillate between "Search service is not available" and "0 results" (expecting the latter).  Any ideas on the service message?  I don't know if there's a traceback for it.
(In reply to comment #5)
> I oscillate between "Search service is not available" and "0 results"
> (expecting the latter).  Any ideas on the service message?  I don't know if
> there's a traceback for it.

That will happen if zeus can't connect to the webserver (which happens when it's being restarted).  If it's still a problem open an IT bug and CC us.
Looks fine now, Wil; thanks.  Seeing:

<searchresults total_results="0">
  </searchresults>

which is expected.

Verified FIXED.
Status: RESOLVED → VERIFIED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.