'dashboard/scss/horizon.scss' could not be found in the COMPRESS_ROOT '/usr/share/openstack-dashboard/static' after installation

Bug #1470143 reported by Vasyl Saienko
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
High
MOS Packaging Team

Bug Description

After installing horizon package from http://172.18.160.74/osci//mos/7.0/cluster/base//trusty/pool/main/h/horizon/python-django-horizon_2015.1.0-1~u14.04%2bmos4229_all.deb
failed to execute compression:

/usr/share/openstack-dashboard/manage.py collectstatic --noinput --clear && /usr/share/openstack-dashboard/manage.py compress --force

Found 'compress' tags in:
      /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html
      /usr/lib/python2.7/dist-packages/horizon/templates/horizon/_conf.html
      /usr/lib/python2.7/dist-packages/horizon/templates/horizon/_scripts.html
CommandError: An error occured during rendering /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html: 'dashboard/scss/horizon.scss' could not be found in the COMPRESS_ROOT '/usr/share/openstack-dashboard/static' or with staticfiles.

It also can be reproduced on: http://mc0n1-msk.msk.mirantis.net/fuelweb-iso/fuel-gerrit-7.0-119-2015-06-29_16-39-43.iso.torrent

Vasyl Saienko (vsaienko)
description: updated
Changed in mos:
importance: Critical → High
status: New → Confirmed
Revision history for this message
Thomas Goirand (thomas-goirand) wrote :

I'd like to point out that I had to fight this a lot in the Debian horizon package before the release of Kilo, with a similar issue. On my case, this was due to a terrible mistake in the naming of the xstatic-lrdragndrop python module, where upstream did the mistake of replacing the lower case l by a i (as in, Irdragndrop instead of lrdragndrop). Horizon couldn't find the corresponding js and offline compress crashed.

So, this type of issue is the consequence of having a javascript file not accessible in the defined path, which is itself maybe the symptom of a wrong python-xstatic package. In this case, however, it seems it can't find /usr/share/openstack-dashboard/static/dashboard/scss/horizon.scss which it is trying to compress, which doesn't involve any xstatic package.

I have just checked the differences between the Debian horizon package and the MOS one, and one I have found is this: in Debian, the package has, in debian/openstack-dashboard.links, the below 3 lines which the MOS package doesn't have:

/var/lib/openstack-dashboard/static/scss /usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/scss
/var/lib/openstack-dashboard/static/js /usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/js
/usr/share/fonts-font-awesome/fonts /usr/share/pyshared/horizon/static/horizon/lib/font-awesome/fonts

So the fix looks like adding these lines.

tags: added: 70-kilo-blocker
Revision history for this message
Marek Zawadzki (mzawadzki-f) wrote :

Thomas Goirand is working on a fix:
https://review.fuel-infra.org/#/c/8945/

Revision history for this message
Vasyl Saienko (vsaienko) wrote :

Hello Gents,

Not sure if it is possible to fix it in a package itself. Ubuntu package has the same issue.
I did a proposal [0] to puppet-horizon upstream module, it can be fixed there. More information is available at [1]

[0] https://review.openstack.org/#/c/198119/
[1] https://bugs.launchpad.net/fuel/+bug/1470993

Changed in mos:
status: Confirmed → In Progress
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack-build/horizon-build (openstack-ci/fuel-7.0/2015.1.0)

Reviewed: https://review.fuel-infra.org/8945
Submitter: Ivan Udovichenko <email address hidden>
Branch: openstack-ci/fuel-7.0/2015.1.0

Commit: b66c8946d35a15ca5d7b5e4e97ac90423ff037ab
Author: Thomas Goirand <email address hidden>
Date: Tue Jul 7 19:30:18 2015

Fix numerous issues in the Horizon package

The Horizon package comming from Ubuntu has numerous issues, and this
patch attemps to fix some of them. There's some less important things
which could be fixed later on.

  * Adds missing symlinks to horizon to fix broken offline compress, which
    made the package uninstallable (LP: #1470143).
  * Ran wrap-and-sort -t -a to make dependencies readable.
  * Run compile-messages at build time, not in postinst.
  * Activates off-line compress.
  * Fix path of secret-key to be in /var (as /usr should be considered to be a
    read-only filesystem, as per Debian policy).
  * Copy the missing angular folder.
  * debian/openstack-dashboard.postinst
    - Re-wrapped the file which was really unreadable in its current state.
    - Redefines --home as /var/lib/horizon, and not /usr/share/horizon, which
      really is not policy compliant (in openstack-dashboard.postinst).
    - Completely remove the collecstatic which should *never* be done in this
      package: we're not using a virtualenv!
    - Completely remove chown of files in /usr. By policy of the FSHS, this
      should *never* happen.
    - Removed chown of /etc/openstack-dashboard. This is useless and
      dangerous in therms of security.
    - Avoids hacks with the secret-key folder in postinst (since we've set
      that by default to be /var in the default config file).
    - Add off-line compress if triggered.
  * Add trigger if the some javascripts are updated.
  * Fixes /horizon/static Alias directives (thanks to I. Yozhikov).
  * Fixes in _variables.scss for /horizon/ webroot
  * Activating OFFLINE_COMPRESS=True, which speeds up a lot Horizon.
  * Fix the way /var/lib/openstack-dashboard/secret_key is handled
    (previously a copy of /etc/openstack-dashboard, now an alias to it).
  * Fix tests to not try to overwrite the package apache config.

Closes-Bug: #1470143
Change-Id: I7de1968ff9c1ddd03a9965aa66fb9407d3f8d1dd

Changed in mos:
status: In Progress → Fix Committed
Vasyl Saienko (vsaienko)
Changed in mos:
status: Fix Committed → Triaged
Revision history for this message
Vasyl Saienko (vsaienko) wrote :
Download full text (5.0 KiB)

proposed fix breaks package:

failed job: http://jenkins-product.srt.mirantis.net:8080/job/7.0.system_test.ubuntu.huge_ha_neutron/20/

node-4.test.domain.local/var/log/puppet.log:2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache] (err): Failed to call refresh: /usr/share/openstack-dashboard/manage.py collectstatic --noinput && /usr/share/openstack-dashboard/manage.py compress --force returned 1 instead of one of [0]
...
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): Traceback (most recent call last):
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): File "/usr/share/openstack-dashboard/manage.py", line 25, in <module>
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): execute_from_command_line(sys.argv)
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): utility.execute()
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): self.fetch_command(subcommand).run_from_argv(self.argv)
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): self.execute(*args, **options.__dict__)
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 285, in execute
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): output = self.handle(*args, **options)
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 415, in handle
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): return self.handle_noargs(**options)
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): File "/usr/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 167, in handle_noargs
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): collected = self.collect()
2015-07-10 03:39:17 +0000 /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns (notice): File "/usr/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 111, ...

Read more...

Revision history for this message
Thomas Goirand (thomas-goirand) wrote :

Hi,

Why exactly are you trying to call manage.py collecstatic? You should *not* do that. There's no issue in the package, and collectstatic should never be done, end of the story, IMO.

Changed in mos:
status: Triaged → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Related fix proposed to openstack-build/horizon-build (openstack-ci/fuel-7.0/2015.1.0)

Related fix proposed to branch: openstack-ci/fuel-7.0/2015.1.0
Change author: Ivan Udovichenko <email address hidden>
Review: https://review.fuel-infra.org/9305

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack-build/horizon-build (openstack-ci/fuel-7.0/2015.1.0)

Reviewed: https://review.fuel-infra.org/9170
Submitter: Igor Yozhikov <email address hidden>
Branch: openstack-ci/fuel-7.0/2015.1.0

Commit: c339b629fcdeabdf84213f384da7680a330c8824
Author: Ivan Udovichenko <email address hidden>
Date: Fri Jul 10 14:19:35 2015

Update Horizon package

Fix some issues with Horizon package

Closes-Bug: #1470143

Change-Id: I6095cca7607328238b0f2d67f8c14acc5d933a0b

Revision history for this message
Igor Yozhikov (iyozhikov) wrote :
Changed in mos:
status: In Progress → Fix Committed
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack-build/horizon-build (openstack-ci/fuel-7.0/2015.1.0)

Change abandoned by Ivan Udovichenko <email address hidden> on branch: openstack-ci/fuel-7.0/2015.1.0
Review: https://review.fuel-infra.org/9305
Reason: Changes were already merged.

Changed in mos:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.