Bug 1503804

Summary: OSP11 -> OSP12 upgrade: Horizon doesn't show downstream customization
Product: Red Hat OpenStack Reporter: Marius Cornea <mcornea>
Component: openstack-tripleo-heat-templatesAssignee: Beth White <beth.white>
Status: CLOSED ERRATA QA Contact: Ola Pavlenko <opavlenk>
Severity: urgent Docs Contact:
Priority: high    
Version: 12.0 (Pike)CC: apannu, beth.white, dbecker, jpichon, jrist, jschluet, mburns, morazi, pchavva, rdopiera, rhel-osp-director-maint
Target Milestone: rcKeywords: Triaged
Target Release: 12.0 (Pike)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-7.0.3-7.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-13 22:17:19 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: 1516324    
Attachments:
Description Flags
horizon dashboard none

Description Marius Cornea 2017-10-18 19:27:47 UTC
Created attachment 1340366 [details]
horizon dashboard

Description of problem:
OSP11 -> OSP12 upgrade: After upgrade has finished Horizon doesn't show downstream customizations. 

Version-Release number of selected component (if applicable):
[root@controller-0 stack]# docker ps | grep horizon
7173e9266e88        192.168.0.1:8787/rhosp12/openstack-horizon-docker:20171017.1                   "kolla_start"            3 hours ago         Up 3 hours                                   horizon

How reproducible:
100%

Steps to Reproduce:
1. Deploy an OSP11 split stack environment with 3 controller, 3 messaging, 3 db, 2 networker, 2 compute, 3 ceph nodes
 
2. Upgrade to OSP12
3. Open in the browser the Horizon public URL

Actual results:
Attaching screenshot.

Expected results:
Downstream theme is loaded.

Additional info:

[root@controller-0 stack]# docker exec -it horizon rpm -qa | grep horizon
python-django-horizon-12.0.1-0.20171009150957.79a5295.el7ost.noarch
[root@controller-0 stack]# docker exec -it horizon rpm -qa | grep dashboard
openstack-dashboard-theme-12.0.0-3.el7ost.noarch
openstack-dashboard-12.0.1-0.20171009150957.79a5295.el7ost.noarch

Comment 1 Radomir Dopieralski 2017-10-26 17:26:43 UTC
The theme package is not installed inside the docker image.

Comment 3 Radomir Dopieralski 2017-11-06 13:54:41 UTC
It seems that in the latest puddle the theme is installed, but since "manage.py compress" hasn't been run, Horizon throws OfflineGenerationError.

Comment 4 Radomir Dopieralski 2017-11-07 17:11:34 UTC
Fact I know so far:

1. running "manage.py compress" doesn't solve the issue
2. disabling offline compression does make Horizon work, and shows the downstream theme correctly,
3. running horizon as root doesn't sidestep the error, so it's not a file permission problem

It seems like for some reason the content hashes for the css files are different when run by manage.py compress than when run by manage.py runserver, but I have no idea why that may be.

Comment 5 Radomir Dopieralski 2017-11-07 17:20:48 UTC
Running horizon once with offline compression disabled fixed the problem somehow and now it also works with the offline compression enabled. I'm trying to figure out what changed.

Comment 6 Radomir Dopieralski 2017-11-07 19:13:09 UTC
I found it.

The directory /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.d/ is not accessible to the apache user that runs Horizon. Since it contains the file that sets our downstream theme, and since compress is ran as root, the offline compression happens including our theme, but the running horizon doesn't see that file and expects css files without our theme, and fails to find them.

Adding the a+rX rights to that directory solves the problem.

Comment 7 Radomir Dopieralski 2017-11-07 19:24:47 UTC
Made a patch fixing the issue: https://review.openstack.org/518384

Comment 8 Radomir Dopieralski 2017-11-08 21:08:00 UTC
The patch merged upstream, backported it to pike.

Comment 15 errata-xmlrpc 2017-12-13 22:17:19 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.

https://access.redhat.com/errata/RHEA-2017:3462