Sunday, March 5, 2017

Failed to install OpenStack Dashboard



I'm trying to install a cloud following the OpenStack's official document. When I try to install dashboard on the cloud controller: http://docs.openstack.org/diablo/openstack-compute/install/content/configure-dashboard.html I had error when trying to sync database:



$ /usr/share/openstack-dashboard/dashboard/manage.py syncdb



ERROR:root:No module named local.local_settings
Traceback (most recent call last):
File "/usr/share/openstack-dashboard/dashboard/settings.py", line 117, in
from local.local_settings import *

ImportError: No module named local.local_settings
ERROR:root:No module named local.local_settings
Traceback (most recent call last):
File "/usr/share/openstack-dashboard/dashboard/../dashboard/settings.py", line 117, in
from local.local_settings import *
ImportError: No module named local.local_settings
Traceback (most recent call last):
File "./dashboard/manage.py", line 31, in
execute_manager(settings)
File "/usr/lib/pymodules/python2.7/django/core/management/__init__.py", line 438, in execute_manager

utility.execute()
File "/usr/lib/pymodules/python2.7/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/pymodules/python2.7/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/pymodules/python2.7/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/lib/pymodules/python2.7/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/usr/lib/pymodules/python2.7/django/core/management/commands/syncdb.py", line 56, in handle_noargs

cursor = connection.cursor()
File "/usr/lib/pymodules/python2.7/django/db/backends/dummy/base.py", line 15, in complain
raise ImproperlyConfigured("You haven't set the database ENGINE setting yet.")
django.core.exceptions.ImproperlyConfigured: You haven't set the database ENGINE setting yet.


My /usr/share/openstack-dashboard/local/local_settings.py is the same in the guide. I installed python-mysqldb, but I doesn't change.



Then I try to install Dashboard from git like in wiki: http://wiki.openstack.org/OpenStackDashboard
But I had the same error.




I use VirtualBox to install 2 servers, each one runs Ubuntu server 11.10 amd64. Everything fine, except for Dashboard!



How can I fix it?
Thank you!



It looks like python can't find local.local_settings.py, an this looks normal to me.



You are in:




/usr/share/openstack-dashboard/dashboard/


And your local_settings.py is in:



/usr/share/openstack-dashboard/local/local_settings.py


import local.local_settings.py is going to look for it in /usr/share/openstack-dashboard/dashboard/local/local_settings.py




In the git there is a small wrapper in openstack-dashboard that could help with this problem. Just create a new file in openstack-dashboard, call it manage.py, copy this code:



#!/usr/bin/env python
import os, sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dashboard.settings")

from django.core.management import execute_from_command_line


execute_from_command_line(sys.argv)


And now execute it.



What that code do is changing a global so that the default settings.py for django is now dashboard/settings.py (instead of ./settings.py), and call the default django manage.py.



This should solve the import error as now local/local_settings.py exists. Of course it could create another import problems, but it's worth trying.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...