wikipendium/wikipendium.no

Search some times crashes

Opened this issue · 0 comments

VariableDoesNotExist: Failed lookup for key [object] in u'None'

According to stack overflow, it might be caused by an outdated index.
http://stackoverflow.com/questions/10333773/django-haystack-errors-on-certain-keywords

As far as I can tell, we rebuild the search index every 15 minutes.

The stack trace is as follows:

Internal Server Error: /search/partial/
Traceback (most recent call last):
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
   response = wrapped_callback(request, *callback_args, **callback_kwargs)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/newrelic-2.54.0.41/newrelic/hooks/framework_django.py", line 499, in wrapper
   return wrapped(*args, **kwargs)
 File "./wikipendium/cache/decorators.py", line 52, in inner
   result = fn(*args, **kwargs)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/haystack/views.py", line 53, in __call__
   return self.create_response()
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/haystack/views.py", line 147, in create_response
   return render_to_response(self.template, context, context_instance=self.context_class(self.request))
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/shortcuts.py", line 45, in render_to_response
   using=using)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/loader.py", line 115, in render_to_string
   template_name, context, context_instance, dirs, dictionary)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/engine.py", line 221, in render_to_string
   return t.render(context_instance)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/base.py", line 209, in render
   return self._render(context)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/newrelic-2.54.0.41/newrelic/api/function_trace.py", line 98, in dynamic_wrapper
   return wrapped(*args, **kwargs)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/base.py", line 201, in _render
   return self.nodelist.render(context)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/base.py", line 903, in render
   bit = self.render_node(node, context)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/base.py", line 917, in render_node
   return node.render(context)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 329, in render
   return nodelist.render(context)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/base.py", line 903, in render
   bit = self.render_node(node, context)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/base.py", line 917, in render_node
   return node.render(context)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/defaulttags.py", line 224, in render
   nodelist.append(node.render(context))
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/haystack/templatetags/highlight.py", line 34, in render
   text_block = self.text_block.resolve(context)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/base.py", line 787, in resolve
   value = self._resolve_lookup(context)
 File "/home/wikipendium-web/wikipendium.no/venv/local/lib/python2.7/site-packages/django/template/base.py", line 839, in _resolve_lookup
   (bit, current))  # missing attribute
VariableDoesNotExist: Failed lookup for key [object] in u'None'

Request repr(): 
<WSGIRequest
path:/search/partial/,
GET:<QueryDict: {u'q': [u'vi']}>,
POST:<QueryDict: {}>,
COOKIES:{},
META:{'CONTENT_LENGTH': '',
'CONTENT_TYPE': '',
'DOCUMENT_ROOT': '/etc/nginx/html',
'HTTPS': 'on',
'HTTP_ACCEPT': '*/*',
'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
'HTTP_ACCEPT_LANGUAGE': 'ro-ro',
'HTTP_CONNECTION': 'keep-alive',
'HTTP_HOST': 'www.wikipendium.no',
'HTTP_REFERER': 'https://www.wikipendium.no/search/?q=vi',
'HTTP_USER_AGENT': 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13C75 Safari/601.1',
'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
'PATH_INFO': u'/search/partial/',
'QUERY_STRING': 'q=vi',
'REQUEST_METHOD': 'GET',
'REQUEST_URI': '/search/partial/?q=vi',