Bug 1122192

Summary: openstack-dashboard config file gets removed and replaced.
Product: Red Hat OpenStack Reporter: Luigi Toscano <ltoscano>
Component: openstack-puppet-modulesAssignee: Martin Magr <mmagr>
Status: CLOSED ERRATA QA Contact: Ami Jeain <ajeain>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.0 (RHEL 7)CC: aberezin, adahms, aortega, derekh, dnavale, jpichon, ltoscano, mmagr, mrunge, sclewis, trusnak, yeylon
Target Milestone: rcKeywords: Regression
Target Release: 5.0 (RHEL 7)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-puppet-modules-2014.1-19.3.el7ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1122892 (view as bug list) Environment:
Last Closed: 2014-07-24 17:25:15 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:
Bug Depends On:    
Bug Blocks: 1122892    

Description Luigi Toscano 2014-07-22 18:10:14 UTC
Description of problem:

When dashboard packages are upgraded, httpd WSGI* configuration are repeated twice, and httpd refuses to start.
After packstack installation, WSGI configuration is shipped into 15-horizon_vhost.conf. 
Apparently it should be also in /etc/httpd/conf.d/openstack-dashboard.conf, shipped with openstack-dashboard, but this file seems to be removed during the installation (?):

# rpm -Va openstack-dashboard
missing   c /etc/httpd/conf.d/openstack-dashboard.conf
SM5....T.  c /etc/openstack-dashboard/local_settings
S.5....T.    /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.pyc
.......T.    /usr/share/openstack-dashboard/static/dashboard/css/79750394898d.css
.......T.    /usr/share/openstack-dashboard/static/dashboard/css/b321bb0b3ce5.css
.......T.    /usr/share/openstack-dashboard/static/dashboard/js/0272dc9e5c21.js
.......T.    /usr/share/openstack-dashboard/static/dashboard/js/b28ee7422312.js
..5....T.    /usr/share/openstack-dashboard/static/dashboard/manifest.json
.M.......    /var/log/horizon

Packages installed though packstack --allinone:
openstack-dashboard-2014.1-7.el7ost.noarch
python-django-horizon-2014.1-7.el7ost.noarch


=> When the packages are upgraded to the latest version, the removed file (openstack-dashboard.conf) appears again, the WSGI configuration is repeated and httpd does not start anymore.

Upgrade steps:

# yum install python-django-horizon openstack-dashboard-theme openstack-dashboard
Loaded plugins: priorities, product-id, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package openstack-dashboard.noarch 0:2014.1-7.el7ost will be updated
---> Package openstack-dashboard.noarch 0:2014.1.1-2.el7ost will be an update
---> Package openstack-dashboard-theme.noarch 0:2014.1-7.el7ost will be updated
---> Package openstack-dashboard-theme.noarch 0:2014.1.1-2.el7ost will be an update
---> Package python-django-horizon.noarch 0:2014.1-7.el7ost will be updated
---> Package python-django-horizon.noarch 0:2014.1.1-2.el7ost will be an update
[...]

# systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: failed (Result: exit-code) since Tue 2014-07-22 20:00:38 CEST; 3s ago
  Process: 15483 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 15481 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 15481 (code=exited, status=1/FAILURE)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"

Jul 22 20:00:38 <hostname> httpd[15481]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf/ports.conf:7
Jul 22 20:00:38 <hostname> httpd[15481]: AH00526: Syntax error on line 1 of /etc/httpd/conf.d/openstack-dashboard.conf:
Jul 22 20:00:38 <hostname> httpd[15481]: Name duplicates previous WSGI daemon definition.
Jul 22 20:00:38 <hostname> systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 22 20:00:38 <hostname> systemd[1]: Failed to start The Apache HTTP Server.
Jul 22 20:00:38 <hostname> systemd[1]: Unit httpd.service entered failed state.

# grep -r WSGI /etc/httpd/conf.d/*
/etc/httpd/conf.d/15-horizon_vhost.conf:  WSGIDaemonProcess dashboard group=apache processes=3 threads=10 user=apache
/etc/httpd/conf.d/15-horizon_vhost.conf:  WSGIProcessGroup dashboard
/etc/httpd/conf.d/15-horizon_vhost.conf:  WSGIScriptAlias /dashboard "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi"
/etc/httpd/conf.d/openstack-dashboard.conf:WSGIDaemonProcess dashboard
/etc/httpd/conf.d/openstack-dashboard.conf:WSGIProcessGroup dashboard
/etc/httpd/conf.d/openstack-dashboard.conf:WSGISocketPrefix run/wsgi
/etc/httpd/conf.d/openstack-dashboard.conf:WSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
/etc/httpd/conf.d/wsgi.conf:# The WSGI Apache module configuration file is being
/etc/httpd/conf.d/wsgi.conf:  WSGISocketPrefix /var/run/wsgi


Tested on RHEL7 as host, it is likely not distro-dependent.

Comment 2 Matthias Runge 2014-07-22 18:51:54 UTC
How was your system installed?

Packstack? openstack-dashboard installed since ever /etc/httpd/conf.d/openstack-dashboard.conf.

If that file is removed, it's clear that's being recreated on each package update (and upgrade).
Removing such config files is a really bad idea.

Comment 3 Matthias Runge 2014-07-23 06:48:49 UTC
I just verified the behaviour on rhel6 rhos5:

Packstack removes the default provided file from openstack-dashboard:
rpm -ql openstack-dashboard | grep /etc
/etc/httpd/conf.d/openstack-dashboard.conf

and replaces that file by its own configuration files:
-rw-r--r--. 1 root root  758 Jul 18 10:43 15-default.conf
-rw-r--r--. 1 root root 1471 Jul 18 10:43 15-horizon_ssl_vhost.conf
-rw-r--r--. 1 root root 1203 Jul 18 10:43 15-horizon_vhost.conf

*This will break on EACH openstack-dashboard update*.

openstack-dashboard will re-install that file, when it doesn't exist on package updates and upgrades.

The file /etc/httpd/conf.d/openstack-dashboard.conf
has been there since RHOS2.1, when updating from earlier versions, packstack is not run, so that file will not get removed.

Comment 5 Ami Jeain 2014-07-23 15:00:03 UTC
verified in the latest build.

Comment 6 Luigi Toscano 2014-07-23 21:31:30 UTC
If I understand it correctly, the fix is for packstack. This ensures that during installation the configuration file is cleaned with a message, so that it's changed and not replaced with the new version upon upgrade. But this is for the future installation; current installations are going to break. Is it worth mentioning somewhere in the release notes?

Comment 8 Matthias Runge 2014-07-24 05:49:03 UTC
(In reply to Luigi Toscano from comment #6)
> If I understand it correctly, the fix is for packstack. This ensures that
> during installation the configuration file is cleaned with a message, so
> that it's changed and not replaced with the new version upon upgrade. But
> this is for the future installation; current installations are going to
> break. Is it worth mentioning somewhere in the release notes?

So what happened at your installation:
# you installed via packstack
# openstack-dashboard got installed by packstack
# packstack removes openstack-dashboards config file /etc/httpd/conf.d/openstack-dashboard.conf
# packstack writes (about the same config) to /etc/httpd/conf.d/15-horizon_vhost.conf
# if you install or upgrade openstack-dashboard, you'll get packages version in /etc/httpd/conf.d/openstack-dashboard.conf installed as well.
# The regression was, that packstack changed config files location, there are several now (when installed via packstack) and they have their separate purpose.

Comment 11 errata-xmlrpc 2014-07-24 17:25:15 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/RHBA-2014-0930.html

Comment 12 Andrew Dahms 2015-03-12 05:08:27 UTC
Hi Martin,

My name is Andrew, and I am following up on this bug after closing BZ#1122892, which called for a release note for this bug to be included in the documentation.

I am following up on outstanding bugs that require documentation. Please let me know if you still require a release note for this issue, and we can add a description of this as a known issue in the RHEL-OSP 5.0 release notes for you.

Kind regards,

Andrew