Bug 1039727 - openstack-status reports openstack-dashboard as in status "500" instead of "active"
Summary: openstack-status reports openstack-dashboard as in status "500" instead of "a...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-packstack
Version: 4.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 4.0
Assignee: Julie Pichon
QA Contact: Nir Magnezi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-09 21:07 UTC by Rami Vaknin
Modified: 2015-02-15 22:02 UTC (History)
11 users (show)

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".
Clone Of:
Environment:
Last Closed: 2013-12-20 00:43:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 60898 0 None None None Never
Red Hat Product Errata RHEA-2013:1859 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Enhancement Advisory 2013-12-21 00:01:48 UTC

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


Note You need to log in before you can comment on or make changes to this bug.