Bug 1039727

Summary: openstack-status reports openstack-dashboard as in status "500" instead of "active"
Product: Red Hat OpenStack Reporter: Rami Vaknin <rvaknin>
Component: openstack-packstackAssignee: Julie Pichon <jpichon>
Status: CLOSED ERRATA QA Contact: Nir Magnezi <nmagnezi>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0CC: aortega, athomas, bperkins, breeler, derekh, hateya, jpichon, mmagr, mrunge, oblaut, yeylon
Target Milestone: rc   
Target Release: 4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-packstack-2013.2.1-0.16.dev925.el6ost Doc Type: Known Issue
Doc Text:
The OpenStack Dashboard, Horizon, is built on top of Django, which offers the ALLOWED_HOSTS setting as a security measure (mandatory from 1.5 onwards). By default in PackStack, the Horizon host IP and its hostname are included. As a result, for hostnames that are not specified in the ALLOWED_HOSTS list, the Horizon Dashboard will return an "error 500". This can cause issues for local scripts such as openstack-status which assume the Dashboard should be available at http://localhost. This causes openstack-status to report "status 500" for openstack-dashboard when it is actually working fine. Workaround: Add 'localhost' to the ALLOWED_HOSTS list in /etc/openstack-dashboard/local_settings, then restart httpd. This will make the Dashboard accessible when using localhost and openstack-status will indicate the Dashboard's status as "active".
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-20 00:43:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rami Vaknin 2013-12-09 21:07:19 UTC
Version
=======
rhos 4.0 on rhel 6.5 with 2013-12-06.3 puddle, openstack-packstack-2013.2.1-0.13.dev876.el6ost.


Description
===========
# openstack-status | grep dashboard
openstack-dashboard:                    500

From /usr/bin/openstack-status:

if test "$dashboard"; then
  printf "== Horizon service ==\n"
  horizon_status="$(curl -s -w '%{http_code}\n' http://localhost/dashboard -o /dev/null)"
  [ "$horizon_status" = 200 ] && horizon_status=active
  printf '%-40s%s\n' "openstack-dashboard:" "$horizon_status"


It looks like the ALLOWED_HOSTS param should also contain "localhost".

Comment 2 Matthias Runge 2013-12-09 21:28:59 UTC
Agreed. In the package, localhost is included, the config gets overwritten by packstack.

Comment 3 Julie Pichon 2013-12-10 09:08:42 UTC
As mentioned in bug 1028678, the path of least resistance is probably to also add localhost to the ALLOWED_HOSTS list. Patch proposed at https://review.openstack.org/#/c/60898/ . Not sure if it's a blocker though.

Comment 4 Julie Pichon 2013-12-10 11:39:27 UTC
Merged upstream. The patch seems self-contained and low-risk and may be worthwhile including in the rc. On the other hand, there is an obvious and easy workaround as 'localhost' can be added to ALLOWED_HOSTS in the local_settings manually.

Comment 6 Julie Pichon 2013-12-12 17:17:04 UTC
Because this is similar to bug 1028678, I think it isn't necessary to include doc text also for this (the workaround is the same).

Comment 7 Rami Vaknin 2013-12-15 10:01:55 UTC
Verified on rhos 4.0 running on rhel 6.5, 2013-12-12.1 puddle, openstack-packstack-2013.2.1-0.19.dev935.el6ost

# openstack-status | grep -i -A 1 horizon
== Horizon service ==
openstack-dashboard:                    active
#

Comment 9 errata-xmlrpc 2013-12-20 00:43:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2013-1859.html