Bug 1220070

Summary: horizon requires manage.py compress to be run
Product: [Community] RDO Reporter: Harm Weites <harm>
Component: openstack-horizonAssignee: Matthias Runge <mrunge>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: KiloCC: harm, justin.t.riley, mrunge
Target Milestone: ---   
Target Release: Kilo   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-10 07:34:47 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 Harm Weites 2015-05-09 19:10:22 UTC
Description of problem:
Whenever launching Horizon in a webbrowser it returns with a HTTP/500:

OfflineGenerationError: You have offline compression enabled but key "e5f9a607a797ba75cf310cc38c137e50" is missing from offline manifest. You may need to run "python manage.py compress".

Version-Release number of selected component (if applicable):
openstack-dashboard-2015.1-0rc2.el7.centos.noarch

How reproducible:
Always.

Steps to Reproduce:
1. Launch horizon
2. Access with webbrowser
3. Observe error on screen and in /var/log/httpd/error_log

Additional info:
Running manage.py compress succeeds and after that all is fine. There are no relevant config changes in local_settings, only the following have been changed: openstack_host, openstack_keystone_url, allowed_hosts

At first glance, I'd suspect a packaging error.

The chown step from https://bugzilla.redhat.com/show_bug.cgi?id=1219006 is executed before the first hit at /dashboard so that didn't help in regards to this issue.

Comment 1 Matthias Runge 2015-05-11 06:14:39 UTC
How are you installing horizon? plain packages, packstack?

Comment 2 Matthias Runge 2015-05-11 07:41:08 UTC
I would expect this to be fixed with latest package.
yum update && systemctl restart httpd

Comment 3 Harm Weites 2015-05-11 18:49:13 UTC
I'm installing using plain packages from delorean-kilo (specifically: this is with the Kolla project), I'll check if those were updated within the last days.

Is this a known and even fixed issue?

Comment 4 Matthias Runge 2015-05-12 07:38:49 UTC
I suspect this to be a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1219006

There was a systemd macro added some time ago, which runs ./manage.py collectstatic && ./manage.py compress during httpd start

Did you restart httpd after installing or updating the package?

Comment 5 Harm Weites 2015-05-12 19:33:21 UTC
Ah, well Kolla isn't using systemd for obvious reasons :) Shouldn't that step be in %post anyway or is there a reason to do it at launchtime?

Comment 6 Matthias Runge 2015-05-13 06:05:28 UTC
A httpd restart is required anyways, when adding horizon, it makes sense to couple that to httpd. This is run on each httpd restart. Updating javascript libs etc. would require manage.py collectstatic and manage.py compress to be executed manually, if we remove that systemd snippet. That's another pro to move that step from %post to external.

The question is more: do we want to add that collect and compress step to %post, too? It has never been there (it was executed at package build time).

Comment 7 Harm Weites 2015-05-13 20:42:19 UTC
If it used to be at %build, which is in the package, I'd +1 for moving it back into the package again and perhaps even put it in both places. Perhaps we can eval() the ExecPre from %post, to keep systemd happy? That way Kolla (which doesn't use systemd, since we're all-in Docker) can happily install this package with the same outcome as regular RDO users.

This is installed as /usr/lib/systemd/system/httpd.service.d/openstack-dashboard.conf:

[Service]
ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear
ExecStartPre=/usr/bin/python /usr/share/openstack-dashboard/manage.py compress --force

Comment 8 Matthias Runge 2015-09-10 07:34:47 UTC
Sorry for late feedback here. I put this back to packages

http://pkgs.fedoraproject.org/cgit/python-django-horizon.git/commit/?h=f23&
id=d3d389d40998768df971275a92b0b9ca5de6d92b

and it should be fixed in each package built after June 2015.