First time here? Check out the FAQ!

Revision history  [back]

Why askbot works with runserver, but fails with production server?

I'm trying to run askbot 0.7.44 under gunicorn. When I startup askbot using manage.py, it works:

$ python askbotsite/manage.py runserver
Validating models...

WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

0 errors found
Django version 1.4.2, using settings 'askbotsite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

But if I try to start it up using gunicorn_django, it fails (this worked in 0.7.43):

$ gunicorn_django 
2012-11-29 19:58:21 [25585] [INFO] Starting gunicorn 0.16.1
2012-11-29 19:58:21 [25585] [INFO] Listening at: http://127.0.0.1:8000 (25585)
2012-11-29 19:58:21 [25585] [INFO] Using worker: sync
2012-11-29 19:58:21 [25589] [INFO] Booting worker with pid: 25589
2012-11-29 19:58:22 [25589] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 469, in spawn_worker
    worker.init_process()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 99, in wsgi
    self.callable = self.load()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 101, in load
    return mod.make_wsgi_application()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 36, in make_wsgi_application
    if get_validation_errors(s):
  File "/opt/askbot/local/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 76, in load_app
    app_module = import_module(app_name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 6, in <module>
    from django.contrib.admin.sites import AdminSite, site
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 3, in <module>
    from django.contrib.admin import ModelAdmin, actions
ImportError: cannot import name actions
Traceback (most recent call last):
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 469, in spawn_worker
    worker.init_process()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 99, in wsgi
    self.callable = self.load()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 101, in load
    return mod.make_wsgi_application()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 36, in make_wsgi_application
    if get_validation_errors(s):
  File "/opt/askbot/local/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 76, in load_app
    app_module = import_module(app_name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 6, in <module>
    from django.contrib.admin.sites import AdminSite, site
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 3, in <module>
    from django.contrib.admin import ModelAdmin, actions
ImportError: cannot import name actions
2012-11-29 19:58:22 [25589] [INFO] Worker exiting (pid: 25589)
2012-11-29 19:58:22 [25585] [INFO] Shutting down: Master
2012-11-29 19:58:22 [25585] [INFO] Reason: Worker failed to boot.

Why askbot works with runserver, but fails with production server?ImportError: cannot import name actions

I'm trying to run askbot 0.7.44 under gunicorn. When I startup askbot using manage.py, it works:

$ python askbotsite/manage.py runserver
Validating models...

WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

0 errors found
Django version 1.4.2, using settings 'askbotsite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

But if I try to start it up using gunicorn_django, it fails (this worked in 0.7.43):

$ gunicorn_django 
2012-11-29 19:58:21 [25585] [INFO] Starting gunicorn 0.16.1
2012-11-29 19:58:21 [25585] [INFO] Listening at: http://127.0.0.1:8000 (25585)
2012-11-29 19:58:21 [25585] [INFO] Using worker: sync
2012-11-29 19:58:21 [25589] [INFO] Booting worker with pid: 25589
2012-11-29 19:58:22 [25589] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 469, in spawn_worker
    worker.init_process()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 99, in wsgi
    self.callable = self.load()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 101, in load
    return mod.make_wsgi_application()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 36, in make_wsgi_application
    if get_validation_errors(s):
  File "/opt/askbot/local/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 76, in load_app
    app_module = import_module(app_name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 6, in <module>
    from django.contrib.admin.sites import AdminSite, site
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 3, in <module>
    from django.contrib.admin import ModelAdmin, actions
ImportError: cannot import name actions
Traceback (most recent call last):
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 469, in spawn_worker
    worker.init_process()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 99, in wsgi
    self.callable = self.load()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 101, in load
    return mod.make_wsgi_application()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 36, in make_wsgi_application
    if get_validation_errors(s):
  File "/opt/askbot/local/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 76, in load_app
    app_module = import_module(app_name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 6, in <module>
    from django.contrib.admin.sites import AdminSite, site
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 3, in <module>
    from django.contrib.admin import ModelAdmin, actions
ImportError: cannot import name actions
2012-11-29 19:58:22 [25589] [INFO] Worker exiting (pid: 25589)
2012-11-29 19:58:22 [25585] [INFO] Shutting down: Master
2012-11-29 19:58:22 [25585] [INFO] Reason: Worker failed to boot.

ImportError: cannot import name actions

I'm trying to run askbot 0.7.44 under gunicorn. When I startup askbot using manage.py, it works:

$ python askbotsite/manage.py runserver
Validating models...

WARNING!!! You are using a 'locmem' (local memory) caching backend,
which is OK for a low volume site running on a single-process server.
For a multi-process configuration it is neccessary to have a production
cache system, such as redis or memcached.

With local memory caching and multi-process setup you might intermittently
see outdated content on your site.

0 errors found
Django version 1.4.2, using settings 'askbotsite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

But if I try to start it up using gunicorn_django, it fails (this worked in 0.7.43):

$ gunicorn_django 
2012-11-29 19:58:21 [25585] [INFO] Starting gunicorn 0.16.1
2012-11-29 19:58:21 [25585] [INFO] Listening at: http://127.0.0.1:8000 (25585)
2012-11-29 19:58:21 [25585] [INFO] Using worker: sync
2012-11-29 19:58:21 [25589] [INFO] Booting worker with pid: 25589
2012-11-29 19:58:22 [25589] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 469, in spawn_worker
    worker.init_process()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 99, in wsgi
    self.callable = self.load()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 101, in load
    return mod.make_wsgi_application()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 36, in make_wsgi_application
    if get_validation_errors(s):
  File "/opt/askbot/local/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 76, in load_app
    app_module = import_module(app_name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 6, in <module>
    from django.contrib.admin.sites import AdminSite, site
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 3, in <module>
    from django.contrib.admin import ModelAdmin, actions
ImportError: cannot import name actions
Traceback (most recent call last):
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 469, in spawn_worker
    worker.init_process()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 99, in wsgi
    self.callable = self.load()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 101, in load
    return mod.make_wsgi_application()
  File "/opt/askbot/local/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 36, in make_wsgi_application
    if get_validation_errors(s):
  File "/opt/askbot/local/lib/python2.7/site-packages/django/core/management/validation.py", line 35, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 61, in _populate
    self.load_app(app_name, True)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/db/models/loading.py", line 76, in load_app
    app_module = import_module(app_name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 6, in <module>
    from django.contrib.admin.sites import AdminSite, site
  File "/opt/askbot/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 3, in <module>
    from django.contrib.admin import ModelAdmin, actions
ImportError: cannot import name actions
2012-11-29 19:58:22 [25589] [INFO] Worker exiting (pid: 25589)
2012-11-29 19:58:22 [25585] [INFO] Shutting down: Master
2012-11-29 19:58:22 [25585] [INFO] Reason: Worker failed to boot.