Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/

Bug 1148167

Summary: CommandError: An error occured during rendering /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html: Error parsing block:
Product: [Community] RDO Reporter: wes hayutin <whayutin>
Component: openstack-horizonAssignee: Matthias Runge <mrunge>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: apevec, mrbriancollins, mrunge, whayutin
Target Milestone: Milestone3   
Target Release: Juno   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-01 15:21:11 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:
Attachments:
Description Flags
install and config logs none

Description wes hayutin 2014-09-30 20:04:04 UTC
Created attachment 942835 [details]
install and config logs

Description of problem:

Juno Packstack install fails on f20 

/Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: CommandError: An error occured during rendering /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html: Error parsing block:

[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: [0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: From <string u'// bootstrap overrides:\n$icon-font-path: "../../bo'...>:0[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: Traceback:[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:   File "/usr/lib64/python2.7/site-packages/scss/__init__.py", line 497, in manage_children[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:     self._manage_children_impl(rule, scope)[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:   File "/usr/lib64/python2.7/site-packages/scss/__init__.py", line 547, in _manage_children_impl[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:     self._do_import(rule, scope, block)[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:   File "/usr/lib/python2.7/site-packages/django_pyscss/scss.py", line 118, in _do_import[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:     source_file = self._find_source_file(name, relative_to)[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:   File "/usr/lib/python2.7/site-packages/django_pyscss/scss.py", line 89, in _find_source_file[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:     with storage.open(full_filename) as f:[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:   File "/usr/lib/python2.7/site-packages/django/core/files/storage.py", line 33, in open[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:     return self._open(name, mode)[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:   File "/usr/lib/python2.7/site-packages/django/core/files/storage.py", line 159, in _open[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns:     return File(open(self.path(name), mode))[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: IOError: [Errno 21] Is a directory: u'/usr/share/openstack-dashboard/static/bootstrap/scss/bootstrap'[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: Found 'compress' tags in:[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: 	/usr/lib/python2.7/site-packages/horizon/templates/horizon/_conf.html[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: 	/usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: 	/usr/lib/python2.7/site-packages/horizon/templates/horizon/_scripts.html[0m
[mNotice: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]/returns: Compressing... [0m
[1;31mError: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]: Failed to call refresh: /usr/share/openstack-dashboard/manage.py compress returned 1 instead of one of [0][0m
[1;31mError: /Stage[main]/Horizon/Exec[refresh_horizon_django_cache]: /usr/share/openstack-dashboard/manage.py compress returned 1 instead of one of [0][0m


See logs for clear details..

Comment 1 Alan Pevec 2014-09-30 22:58:02 UTC
AFAICT [refresh_horizon_django_cache] shouldn't run if we have, as I'd expect, compressed css included in RPM, but looks like with_compress was turned off in recent builds, Matthias?

Comment 2 Matthias Runge 2014-10-01 06:06:09 UTC
Uhm, it's turned off currently, as it helps debugging.

wes, which version of django-pyscss are you using?

Comment 3 Alan Pevec 2014-10-01 06:43:22 UTC
python-django-pyscss-1.0.1-2.fc20 from Fedora 20, do we need newer version in RDO for f20?

Comment 4 Alan Pevec 2014-10-01 06:50:56 UTC
BTW, post Juno3 new XStatic dep was added:
xstatic-bootstrap-datepicker>=1.3.1.0

Comment 5 Alan Pevec 2014-10-01 07:01:24 UTC
Trying manually on F20 with python-django-pyscss-1.0.2-1.fc21 from Koji, in https://github.com/redhat-openstack/horizon/commits/master-patches checkout:
$ cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
$ echo COMPRESS_OFFLINE=True >> openstack_dashboard/local/local_settings.py
$ python ./manage.py compress
Found 'compress' tags in:
	/home/alan/src/openstack/horizon/horizon/templates/horizon/_conf.html
	/home/alan/src/openstack/horizon/openstack_dashboard/templates/_stylesheets.html
	/home/alan/src/openstack/horizon/horizon/templates/horizon/_scripts.html
	/home/alan/src/openstack/horizon/openstack_dashboard/dashboards/theme/templates/_stylesheets.html
Compressing... CommandError: An error occured during rendering /home/alan/src/openstack/horizon/openstack_dashboard/templates/_stylesheets.html: 'horizon/lib/font-awesome/scss/font-awesome.scss' could not be found in the COMPRESS_ROOT '/home/alan/src/openstack/horizon/static' or with staticfiles.

Comment 6 Matthias Runge 2014-10-01 07:14:52 UTC
sigh, it looks like we're bitten by

    self._manage_children_impl(rule, scope)
  File "/usr/lib64/python2.7/site-packages/scss/__init__.py", line 547, in _manage_children_impl
    self._do_import(rule, scope, block)
  File "/usr/lib/python2.7/site-packages/django_pyscss/scss.py", line 118, in _do_import
    source_file = self._find_source_file(name, relative_to)
  File "/usr/lib/python2.7/site-packages/django_pyscss/scss.py", line 89, in _find_source_file
    with storage.open(full_filename) as f:
  File "/usr/lib/python2.7/site-packages/django/core/files/storage.py", line 35, in open
    return self._open(name, mode)
  File "/usr/lib/python2.7/site-packages/django/core/files/storage.py", line 172, in _open
    return File(open(self.path(name), mode))
IOError: [Errno 21] Is a directory: u'/usr/share/openstack-dashboard/static/bootstrap/scss/bootstrap'


and we'd also need fontawesome-fonts from f21
the same applies to python-django-pyscss

Comment 7 Alan Pevec 2014-10-01 07:50:29 UTC
After installing python-django-pyscss-1.0.3-1.fc21 and fontawesome-fonts-4.1.0-1.fc21 master-patches works on F20:
$ python ./manage.py collectstatic
...
$ python ./manage.py compress
...
Compressing... done
Compressed 5 block(s) from 4 template(s).

Comment 10 Alan Pevec 2014-10-01 10:42:50 UTC
Updating deps fixed Fedora CI job.
Wes, please check other stage jobs and give me ACK to push stage live.
Matthias, we obviously need to add explicit versioned deps in horizon spec.

Comment 12 Alan Pevec 2014-10-01 15:21:11 UTC
fedora RDO Juno updates pushed live

Comment 13 Brian Collins 2015-01-11 07:48:50 UTC
I got this error by running packstack in debug.
Workaround was to change:

COMPRESS_OFFLINE = False
to
COMPRESS_OFFLINE = True