Ask Your Question

Unable to access Horizon

asked 2012-01-03 16:09:30 -0500

fredric-m gravatar image


I am trying to set up a script which allows me to restart all Openstack related services (all located on a single machine) after a reboot. The aim is to have everything up like after has finished executing, but to log output to files instead of to the screen instances. Also, all mysql db contents shall be preserved between restarts. It is a variant of what Yun Mao does with his upstart script ( ( )

The problem is I cannot get Horizon to work properly after a restart and after executing my startup script. I get the following error in the apache2 error log:

[Tue Jan 03 16:48:12 2012] [error] INFO:root:Running in debug mode without debug_toolbar. [Tue Jan 03 16:48:13 2012] [error] [client] mod_wsgi (pid=3223): Exception occurred processing WSGI script '/opt/stack/horizon/openstack-dashboard/dashboard/wsgi/django.wsgi'. [Tue Jan 03 16:48:13 2012] [error] [client] Traceback (most recent call last): [Tue Jan 03 16:48:13 2012] [error] [client] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/", line 250, in __call__ [Tue Jan 03 16:48:13 2012] [error] [client] self.load_middleware() [Tue Jan 03 16:48:13 2012] [error] [client] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/", line 47, in load_middleware [Tue Jan 03 16:48:13 2012] [error] [client] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) [Tue Jan 03 16:48:13 2012] [error] [client] ImproperlyConfigured: Error importing middleware django_openstack.middleware.keystone: "No module named openstack"

The last line I assume is the most interesting above.

This is the script I put together for the startup. I have taken and removed what I though was not needed, and added logging to file for the services:

#!/usr/bin/env bash

Specify which services to launch. These generally correspond to screen tabs


Destination path for installation DEST


Set the destination directories for openstack projects


#Common log dir for all services LOG_DIR=$DEST/logs

#Create dir if not exists if [ ! -d $LOG_DIR ]; then mkdir -m 755 $LOG_DIR fi

Service startup timeout


#Host IP set to localhost for this installation. Comment out to use std detect HOST_IP=

Launch Services


Host IP is needed by Glance

Use the eth0 IP unless an explicit is set by HOST_IP environment variable

if [ ! -n "$HOST_IP" ]; then HOST_IP=LC_ALL=C /sbin/ifconfig eth0 | grep -m 1 ...

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-01-05 12:10:31 -0500

fredric-m gravatar image

Hello again,

after having looked into this further, the openstack module referred to in the apache error log above is from this project: (

, which is referred to in the stable/diablo branch of DevStack, but not in the master branch. In stable/diablo, it is installed into the DevStack dir structure rather than into /opt/stack and is not in the python path when restarting the services and apache.

I simply solved the problem by moving to the master branch of DevStack, rather than sticking with stable/diablo.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2012-01-03 16:09:30 -0500

Seen: 141 times

Last updated: Jan 05 '12