horizon does not work with django 1.6

Bug #1257885 reported by Sean Dague
52
This bug affects 9 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Matthias Runge

Bug Description

In the gate we see the following on the dashboard scenario:

2013-12-04 19:17:45.569 | ======================================================================
2013-12-04 19:17:45.569 | FAIL: tempest.scenario.test_dashboard_basic_ops.TestDashboardBasicOps.test_basic_scenario[dashboard]
2013-12-04 19:17:45.570 | tempest.scenario.test_dashboard_basic_ops.TestDashboardBasicOps.test_basic_scenario[dashboard]
2013-12-04 19:17:45.570 | ----------------------------------------------------------------------
2013-12-04 19:17:45.570 | _StringException: Empty attachments:
2013-12-04 19:17:45.571 | pythonlogging:''
2013-12-04 19:17:45.571 | stderr
2013-12-04 19:17:45.571 | stdout
2013-12-04 19:17:45.572 |
2013-12-04 19:17:45.572 | Traceback (most recent call last):
2013-12-04 19:17:45.572 | File "tempest/scenario/test_dashboard_basic_ops.py", line 72, in test_basic_scenario
2013-12-04 19:17:45.573 | self.check_login_page()
2013-12-04 19:17:45.573 | File "tempest/scenario/test_dashboard_basic_ops.py", line 43, in check_login_page
2013-12-04 19:17:45.573 | response = urllib2.urlopen(self.config.dashboard.dashboard_url)
2013-12-04 19:17:45.574 | File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
2013-12-04 19:17:45.574 | return _opener.open(url, data, timeout)
2013-12-04 19:17:45.574 | File "/usr/lib/python2.7/urllib2.py", line 406, in open
2013-12-04 19:17:45.575 | response = meth(req, response)
2013-12-04 19:17:45.575 | File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
2013-12-04 19:17:45.575 | 'http', request, response, code, msg, hdrs)
2013-12-04 19:17:45.576 | File "/usr/lib/python2.7/urllib2.py", line 444, in error
2013-12-04 19:17:45.576 | return self._call_chain(*args)
2013-12-04 19:17:45.576 | File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
2013-12-04 19:17:45.577 | result = func(*args)
2013-12-04 19:17:45.578 | File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
2013-12-04 19:17:45.578 | raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
2013-12-04 19:17:45.578 | HTTPError: HTTP Error 500: Internal Server Error

This is triggered by the following error in the horizon startup:

+ ln -sf /opt/stack/new/screen-logs/screen-horizon.2013-12-04-185513.log /opt/stack/new/screen-logs/screen-horizon.log
+ export PYTHONUNBUFFERED=1
+ PYTHONUNBUFFERED=1
+ exec /bin/bash -c 'cd /opt/stack/new/horizon && sudo tail -f /var/log/apache2/horizon_error.log'
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] mod_wsgi (pid=24323): Target WSGI script '/opt/stack/new/horizon/openstack_dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] mod_wsgi (pid=24323): Exception occurred processing WSGI script '/opt/stack/new/horizon/openstack_dashboard/wsgi/django.wsgi'.
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] Traceback (most recent call last):
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] File "/opt/stack/new/horizon/openstack_dashboard/wsgi/django.wsgi", line 4, in <module>
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] import django.core.handlers.wsgi
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 11, in <module>
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] from django.core.handlers import base
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 12, in <module>
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] from django.db import connections, transaction
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 83, in <module>
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] signals.request_started.connect(reset_queries)
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 88, in connect
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] if settings.DEBUG:
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] self._setup(name)
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 47, in _setup
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] % (desc, ENVIRONMENT_VARIABLE))
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] ImproperlyConfigured: Requested setting DEBUG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

David Lyle (david-lyle)
Changed in horizon:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Jeremy Stanley (fungi) wrote :

Related to bug 1257809.

Revision history for this message
David Lyle (david-lyle) wrote :

I'm not sure what the reason for moving to Django 1.6 in the global requirements was, usually Horizon pushes for the update once we have solved the integration problems that each new release of Django inevitably brings. We currently are working toward 1.6 compatibility https://blueprints.launchpad.net/horizon/+spec/django-1point6, but there is more work to be completed.

Revision history for this message
Sean Dague (sdague) wrote :

Agreed, I think folks jumped the gun on the 1.6 gr bump. But this provides us with a bug to recheck on, and know when things are good.

Revision history for this message
Matthias Runge (mrunge) wrote :

a fix is already proposed: https://review.openstack.org/#/c/58947/

Matthias Runge (mrunge)
Changed in horizon:
milestone: none → icehouse-2
status: Triaged → In Progress
assignee: nobody → Matthias Runge (mrunge)
Matthias Runge (mrunge)
Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Revision history for this message
Doug Fish (drfish) wrote :

I know this bug has been marked closed for a few months, but some extra background info:

I believe this bug is actually a bug in django 1.6.0: https://code.djangoproject.com/ticket/21502

It can still be created with the icehouse-rc2 code. The defect history here implies that we fixed this exception in horizon, but I don't think that's true. If you see the subject stack trace - particularly this line
[Wed Dec 04 19:08:13 2013] [error] [client 127.0.0.1] File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 88, in connect
the solution is to upgrade django to 1.6.1+.

Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-2 → 2014.1
Revision history for this message
Jian Wen (wenjianhn) wrote :

Doug, you are correct.
After upgrading Django to 1.6.11, the bug is gone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.