Cannot launch Dashboard due to Import error

Bug #1154391 reported by Senhua Huang
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Medium
Kieran Spear
devstack
Invalid
Undecided
Unassigned

Bug Description

After $stack.sh completes, I tried to launch Dashboard and got the following error at Horizon:

ImportError at /

cannot import name is_safe_url

Request Method: GET
Request URL: http://192.168.149.128/
Django Version: 1.4.2
Exception Type: ImportError
Exception Value:

cannot import name is_safe_url

Exception Location: /usr/local/lib/python2.7/dist-packages/openstack_auth/views.py in <module>, line 13
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:

['/opt/stack/horizon/openstack_dashboard/wsgi/../..',
 '/opt/stack/cinder',
 '/usr/local/lib/python2.7/dist-packages/setuptools_git-0.4.2-py2.7.egg',
 '/opt/stack/python-novaclient',
 '/opt/stack/python-openstackclient',
 '/opt/stack/keystone',
 '/opt/stack/glance',
 '/opt/stack/python-glanceclient',
 '/opt/stack/nova',
 '/opt/stack/horizon',
 '/opt/stack/python-keystoneclient',
 '/opt/stack/python-cinderclient',
 '/usr/local/lib/python2.7/dist-packages/oslo.config-1.1.0b1-py2.7.egg',
 '/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg',
 '/opt/stack/quantum',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/usr/lib/python2.7/dist-packages/gst-0.10',
 '/usr/lib/python2.7/dist-packages/gtk-2.0',
 '/usr/lib/pymodules/python2.7',
 '/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-client',
 '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel',
 '/usr/lib/python2.7/dist-packages/ubuntuone-couch',
 '/usr/lib/python2.7/dist-packages/ubuntuone-installer',
 '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol',
 '/opt/stack/horizon/openstack_dashboard']

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

I am going to try Django 1.4.3 (looks like is_safe_url was added there - https://www.djangoproject.com/weblog/2012/dec/10/security/)

"pip install django==1.4.3"

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

yep, that did the trick. needs specific versions as mentioned in the url

Revision history for this message
Senhua Huang (senhuang) wrote :

confirmed. Thank you, Davanum! By the way, if your pip install times out, try "pip --default-timeout=60 install django==1.4.3".

Changed in horizon:
status: New → Confirmed
Revision history for this message
Tihomir Trifonov (ttrifonov) wrote :

IMHO this is not a Devstack error. The problem is in tools/pip-requires in Horizon - it says

    Django>=1.4,<1.5

should be:

    Django>=1.4.3,<1.5

As pointed above - Horizon uses is_safe_url which is added in Django 1.4.3. Fixing the pip-requires line fixes the problem.

Revision history for this message
Tihomir Trifonov (ttrifonov) wrote :

Oops, my bad. Just saw the import is in openstack_auth. So openstack_auth should require >=1.4.3, not Horizon.

Kieran Spear (kspear)
Changed in horizon:
assignee: nobody → Kieran Spear (kspear)
Changed in horizon:
importance: Undecided → Medium
Revision history for this message
Kieran Spear (kspear) wrote :

Fix here:
https://github.com/gabrielhurley/django_openstack_auth/pull/27

I've tried to maintain compatibility with older django versions.

Kieran Spear (kspear)
Changed in devstack:
status: New → Invalid
Changed in horizon:
status: Confirmed → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote :

Fix is in django_openstack_auth, not in horizon... so marking horizon task invalid

Should we handle this library as an openstack project ?

Changed in horizon:
status: Fix Committed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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