iesgn / openstack-debian-ansible

Ansible playbooks for installing OpenStack on Debian
GNU General Public License v3.0
17 stars 16 forks source link

Django 1.7 -> 500 Internal Server Error #11

Closed albertomolina closed 9 years ago

albertomolina commented 9 years ago

Django has been upgraded to 1.7 (related to Debian Bug 755656 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755656) and now is showing a weird 500 server error.

Apache error logs shows: [Wed Oct 15 09:09:50.745464 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] mod_wsgi (pid=22423): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'. [Wed Oct 15 09:09:50.745494 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] Traceback (most recent call last): [Wed Oct 15 09:09:50.745512 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 168, in call [Wed Oct 15 09:09:50.745536 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] self.load_middleware() [Wed Oct 15 09:09:50.745548 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 46, in load_middleware [Wed Oct 15 09:09:50.745568 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] mw_instance = mw_class() [Wed Oct 15 09:09:50.745580 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/middleware/locale.py", line 23, in init [Wed Oct 15 09:09:50.745598 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] for url_pattern in get_resolver(None).url_patterns: [Wed Oct 15 09:09:50.745610 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 367, in url_patterns [Wed Oct 15 09:09:50.745632 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) [Wed Oct 15 09:09:50.745644 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 361, in urlconf_module [Wed Oct 15 09:09:50.745673 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] self._urlconf_module = import_module(self.urlconf_name) [Wed Oct 15 09:09:50.745685 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module [Wed Oct 15 09:09:50.745704 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] import(name) [Wed Oct 15 09:09:50.745715 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/urls.py", line 38, in [Wed Oct 15 09:09:50.745734 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] url(r'', include(horizon.urls)) [Wed Oct 15 09:09:50.745745 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/conf/urls/init.py", line 29, in include [Wed Oct 15 09:09:50.745764 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] patterns = getattr(urlconf_module, 'urlpatterns', urlconf_module) [Wed Oct 15 09:09:50.745775 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 224, in inner [Wed Oct 15 09:09:50.745793 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] self._setup() [Wed Oct 15 09:09:50.745804 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 357, in _setup [Wed Oct 15 09:09:50.745822 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] self._wrapped = self._setupfunc() [Wed Oct 15 09:09:50.745833 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/horizon/base.py", line 733, in url_patterns [Wed Oct 15 09:09:50.745852 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] return self._urls()[0] [Wed Oct 15 09:09:50.745863 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/horizon/base.py", line 767, in _urls [Wed Oct 15 09:09:50.745881 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] url(r'^%s/' % dash.slug, include(dash._decorated_urls))) [Wed Oct 15 09:09:50.745893 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/horizon/base.py", line 464, in _decorated_urls [Wed Oct 15 09:09:50.745911 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] url(r'^%s/' % url_slug, include(panel._decorated_urls))) [Wed Oct 15 09:09:50.745922 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/horizon/base.py", line 234, in _decorated_urls [Wed Oct 15 09:09:50.745940 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] urlpatterns = self._get_default_urlpatterns() [Wed Oct 15 09:09:50.745952 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/horizon/base.py", line 87, in _get_default_urlpatterns [Wed Oct 15 09:09:50.745970 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] urls_mod = import_module('.urls', package_string) [Wed Oct 15 09:09:50.745981 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 46, in import_module [Wed Oct 15 09:09:50.745999 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] import(name) [Wed Oct 15 09:09:50.746011 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/admin/flavors/urls.py", line 25, in [Wed Oct 15 09:09:50.746037 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] from openstack_dashboard.dashboards.admin.flavors.extras \ [Wed Oct 15 09:09:50.746049 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/admin/flavors/extras/urls.py", line 24, in [Wed Oct 15 09:09:50.746069 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] from openstack_dashboard.dashboards.admin.flavors.extras import views [Wed Oct 15 09:09:50.746081 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/admin/flavors/extras/views.py", line 33, in [Wed Oct 15 09:09:50.746101 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] from openstack_dashboard.dashboards.admin.flavors.extras \ [Wed Oct 15 09:09:50.746112 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/admin/flavors/extras/tables.py", line 55, in [Wed Oct 15 09:09:50.746132 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] class ExtraSpecsTable(tables.DataTable): [Wed Oct 15 09:09:50.746143 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/horizon/tables/base.py", line 955, in new [Wed Oct 15 09:09:50.746162 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] attrs["_meta"] = opts = DataTableOptions(attrs.get("Meta", None)) [Wed Oct 15 09:09:50.746174 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/horizon/tables/base.py", line 879, in init [Wed Oct 15 09:09:50.746192 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] verbose_name = getattr(options, 'verbose_name', None) \ [Wed Oct 15 09:09:50.746204 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line 132, in wrapper [Wed Oct 15 09:09:50.746222 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] res = func(_self.__args, *_self.kw) [Wed Oct 15 09:09:50.746233 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/utils/translation/__init.py", line 83, in ugettext [Wed Oct 15 09:09:50.746251 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] return _trans.ugettext(message) [Wed Oct 15 09:09:50.746262 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 325, in ugettext [Wed Oct 15 09:09:50.746280 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] return do_translate(message, 'ugettext') [Wed Oct 15 09:09:50.746291 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 306, in do_translate [Wed Oct 15 09:09:50.746309 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] _default = translation(settings.LANGUAGE_CODE) [Wed Oct 15 09:09:50.746321 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 209, in translation [Wed Oct 15 09:09:50.746339 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] default_translation = _fetch(settings.LANGUAGE_CODE) [Wed Oct 15 09:09:50.746356 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] File "/usr/lib/python2.7/dist-packages/django/utils/translation/trans_real.py", line 189, in _fetch [Wed Oct 15 09:09:50.746375 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] "The translation infrastructure cannot be initialized before the " [Wed Oct 15 09:09:50.746393 2014] [wsgi:error] [pid 22423:tid 139766372157184] [client 172.22.7.152:43318] AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.

It seems to work fine with Python Django to 1.4.5 (downgrading needed)

albertomolina commented 9 years ago

Asking to openstack-devel debian list: http://lists.alioth.debian.org/pipermail/openstack-devel/2014-October/007488.html

albertomolina commented 9 years ago

Solved! :-)

Thomas Goirand posted a patch replying to the message and it solves the issue!