First time here? Check out the FAQ!

Revision history  [back]

Internal server error (jinja error?)

Hi community!

I had askbot running for months, but now I started getting 500 internal error. I'm stuck with the issues for days now. Please suggest if I'm missing anything (In case you recommend a re-installation, could you point me to some link which helps reinstalling askbot - keeping all my data/settings intact)

The full track-back is here,

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] mod_wsgi (pid=8580): Exception occurred processing WSGI script '/home/probaho/webapps/askbot/answers.wsgi'.

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] Traceback (most recent call last):

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/core/handlers/wsgi.py", line 272, in __call__

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] response = self.get_response(request)

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/core/handlers/base.py", line 153, in get_response

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/core/handlers/base.py", line 218, in handle_uncaught_exception

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] return callback(request, **param_dict)

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/utils/decorators.py", line 93, in _wrapped_view

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] response = view_func(request, args, *kwargs)

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/views/defaults.py", line 31, in server_error

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] return http.HttpResponseServerError(t.render(Context({})))

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/template/base.py", line 123, in render

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] return self._render(context)

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/template/base.py", line 117, in _render

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] return self.nodelist.render(context)

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/template/base.py", line 744, in render

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] bits.append(self.render_node(node, context))

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/template/base.py", line 757, in render_node

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] return node.render(context)

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/askbot-0.7.36-py2.6.egg/askbot/templatetags/extra_tags.py", line 142, in render

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] request = self.request_var.resolve(context)

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/template/base.py", line 653, in resolve

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] value = self._resolve_lookup(context)

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/Django-1.3.1-py2.6.egg/django/template/base.py", line 692, in _resolve_lookup

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bit, current)) # missing attribute

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] VariableDoesNotExist: Failed lookup for key [request] in u'[{}]'

One important line in the trace is this one,

[Wed Jul 11 16:04:07 2012] [error] [client 127.0.0.1] File "/home/probaho/lib/python2.6/askbot-0.7.36-py2.6.egg/askbot/templatetags/extra_tags.py", line 142, in render

Those lines read this,

   136  class IncludeJinja(template.Node):
   137      """http://www.mellowmorning.com/2010/08/24/"""
   138      def __init__(self, filename, request_var):
   139          self.filename = filename
   140          self.request_var = template.Variable(request_var)
   141      def render(self, context):
   142          request = self.request_var.resolve(context)
   143          jinja_template = get_template(self.filename, request)
   144          return jinja_template.render(context)