Ask Your Question
0

Unable to access Horizon

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

fredric-m gravatar image

Hello,

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 stack.sh 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 ( https://answers.launchpad.net/devstack/+question/179590 (https://answers.launchpad.net/devstac...) )

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 127.0.0.1] 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 127.0.0.1] Traceback (most recent call last): [Tue Jan 03 16:48:13 2012] [error] [client 127.0.0.1] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 250, in __call__ [Tue Jan 03 16:48:13 2012] [error] [client 127.0.0.1] self.load_middleware() [Tue Jan 03 16:48:13 2012] [error] [client 127.0.0.1] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 47, in load_middleware [Tue Jan 03 16:48:13 2012] [error] [client 127.0.0.1] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) [Tue Jan 03 16:48:13 2012] [error] [client 127.0.0.1] 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 stack.sh 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

ENABLED_SERVICES=${ENABLED_SERVICES:-g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,horizon,mysql,rabbit,openstackx}

Destination path for installation DEST

DEST=${DEST:-/opt/stack}

Set the destination directories for openstack projects

NOVA_DIR=$DEST/nova HORIZON_DIR=$DEST/horizon GLANCE_DIR=$DEST/glance KEYSTONE_DIR=$DEST/keystone NOVACLIENT_DIR=$DEST/python-novaclient OPENSTACKX_DIR=$DEST/openstackx NOVNC_DIR=$DEST/noVNC SWIFT_DIR=$DEST/swift SWIFT_KEYSTONE_DIR=$DEST/swift-keystone2 QUANTUM_DIR=$DEST/quantum

#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

SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-60}

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

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 ...

(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

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:

https://github.com/jacobian/openstack.compute (https://github.com/jacobian/openstack...)

, 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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 106 times

Last updated: Jan 05 '12