First time here? Check out the FAQ!

Revision history  [back]

Server runs for some minutes and then 500 error

Hi,

I'm running apache2 with wsgi. I've put the website for production yesterday and It was running fine, but now it just sends a 500 error. Restarting apache doesn't seem to solve the issue. This is the error I'm receiving:

 [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
 mod_wsgi (pid=27861): Exception occurred processing WSGI script '/var/www/example/django.wsgi'.
 Traceback (most recent call last):
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 255, in __call__
     response = self.get_response(request)
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 178, in get_response
     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 224, in handle_uncaught_exception
     return callback(request, **param_dict)
   File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view
     response = view_func(request, *args, **kwargs)
   File "/usr/local/lib/python2.7/dist-packages/django/views/defaults.py", line 41, in server_error
     return http.HttpResponseServerError(template.render(Context({})))
   File "/usr/local/lib/python2.7/dist-packages/coffin/template/__init__.py", line 55, in render
     return super(Template, self).render(**context)
   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
     return self.environment.handle_exception(exc_info, True)
   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
     reraise(exc_type, exc_value, tb)
   File "/usr/local/lib/python2.7/dist-packages/askbot/templates/500.html", line 1, in top-level template code
     {% extends "two_column_body.html" %}
   File "/usr/local/lib/python2.7/dist-packages/askbot/templates/two_column_body.html", line 1, in top-level template code
     {% extends "base.html" %}
   File "/usr/local/lib/python2.7/dist-packages/askbot/templates/base.html", line 5, in top-level template code
     <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>
   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 397, in getattr
     return getattr(obj, attribute)
 UndefinedError: 'settings' is undefined

I'm running in production mode.

Thanks !

Edit: I discovered that the command touch django.wsgi solves the issue for some minutes. Then the error arises again.

Edit2: Sometimes, when a 500 error arises, reloading the page solves the issue. But visiting any other page will cause the 500 error again, until you reload the page again.

Server runs for some minutes and then 500 error

Hi,

I'm running apache2 with wsgi. I've put the website for production yesterday and It was running fine, but now it just sends a 500 error. Restarting apache doesn't seem to solve the issue. This is the error I'm receiving:

 [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
 mod_wsgi (pid=27861): Exception occurred processing WSGI script '/var/www/example/django.wsgi'.
 Traceback (most recent call last):
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 255, in __call__
     response = self.get_response(request)
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 178, in get_response
     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 224, in handle_uncaught_exception
     return callback(request, **param_dict)
   File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view
     response = view_func(request, *args, **kwargs)
   File "/usr/local/lib/python2.7/dist-packages/django/views/defaults.py", line 41, in server_error
     return http.HttpResponseServerError(template.render(Context({})))
   File "/usr/local/lib/python2.7/dist-packages/coffin/template/__init__.py", line 55, in render
     return super(Template, self).render(**context)
   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
     return self.environment.handle_exception(exc_info, True)
   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
     reraise(exc_type, exc_value, tb)
   File "/usr/local/lib/python2.7/dist-packages/askbot/templates/500.html", line 1, in top-level template code
     {% extends "two_column_body.html" %}
   File "/usr/local/lib/python2.7/dist-packages/askbot/templates/two_column_body.html", line 1, in top-level template code
     {% extends "base.html" %}
   File "/usr/local/lib/python2.7/dist-packages/askbot/templates/base.html", line 5, in top-level template code
     <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>
   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 397, in getattr
     return getattr(obj, attribute)
 UndefinedError: 'settings' is undefined

I'm running in production mode.

Thanks !

Edit: I discovered that the command touch django.wsgi solves the issue for some minutes. Then the error arises again.

Edit2: Sometimes, when a 500 error arises, reloading the page solves the issue. But visiting any other page will cause the 500 error again, until you reload the page again.

Server runs for some minutes and then 500 error

Hi,

my website is offline. I'm running apache2 with wsgi. I've put the website for production yesterday and It was running fine, but now it just sends a 500 error. fine. Restarting apache doesn't seem to solve the issue. This is the error I'm receiving:

 [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
 mod_wsgi (pid=27861): Exception occurred processing WSGI script '/var/www/example/django.wsgi'.
 Traceback (most recent call last):
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 255, in __call__
     response = self.get_response(request)
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 178, in get_response
     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 224, in handle_uncaught_exception
     return callback(request, **param_dict)
   File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view
     response = view_func(request, *args, **kwargs)
   File "/usr/local/lib/python2.7/dist-packages/django/views/defaults.py", line 41, in server_error
     return http.HttpResponseServerError(template.render(Context({})))
   File "/usr/local/lib/python2.7/dist-packages/coffin/template/__init__.py", line 55, in render
     return super(Template, self).render(**context)
   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
     return self.environment.handle_exception(exc_info, True)
   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
     reraise(exc_type, exc_value, tb)
   File "/usr/local/lib/python2.7/dist-packages/askbot/templates/500.html", line 1, in top-level template code
     {% extends "two_column_body.html" %}
   File "/usr/local/lib/python2.7/dist-packages/askbot/templates/two_column_body.html", line 1, in top-level template code
     {% extends "base.html" %}
   File "/usr/local/lib/python2.7/dist-packages/askbot/templates/base.html", line 5, in top-level template code
     <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>
   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 397, in getattr
     return getattr(obj, attribute)
 UndefinedError: 'settings' is undefined

I'm running in production mode.

Thanks !

Edit: I discovered that the command touch django.wsgi solves the issue for some minutes. Then the error arises again.