Error running manage.py compress after https://review.openstack.org/#/c/399771/

Bug #1643689 reported by Alfredo Moralejo
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Won't Fix
Undecided
Unassigned

Bug Description

After https://review.openstack.org/#/c/399771/, we are getting following error when running "python manage.py compress":

CommandError: An error occurred during rendering /tmp/horizon/openstack_dashboard/templates/_stylesheets.html: Couldn't find anything to import: ../../mixins
Extensions: <NamespaceAdapterExtension>, <DjangoExtension>, <CompassExtension>
Search path:

on line 21 of horizon/lib/roboto_fontface/css/roboto/sass/roboto-fontface-regular.scss
imported from line 21 of horizon/lib/roboto_fontface/css/roboto/sass/roboto-fontface.scss
imported from line 16 of themes/material/bootstrap/_styles.scss
imported from line 16 of themes/material/_styles.scss
imported from line 1 of u'string:c61b5d22d54bf56c:\n // My Themes\n@import "/themes/material/variables";\n\n// Horizon\n@import "/dashboard/scss/horizon'

and exits.

Note that this issue is making horizon packaging to fail.

description: updated
Revision history for this message
Alfredo Moralejo (amoralej) wrote :

I was missing running collectstatic before compress. After doing it, it worked fine.

Changed in horizon:
status: New → Invalid
Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

I'm sorry but I confirm this on stable/newton :

(.venv)yves@paradox ~/openstack/pure_horizon/horizon $ python manage.py collectstatic --noinput && python manage.py compress --force

0 static files copied to '/home/yves/openstack/pure_horizon/horizon/static', 1746 unmodified.
Found 'compress' tags in:
 /home/yves/openstack/pure_horizon/horizon/openstack_dashboard/templates/horizon/_scripts.html
 /home/yves/openstack/pure_horizon/horizon/openstack_dashboard/templates/_stylesheets.html
 /home/yves/openstack/pure_horizon/horizon/openstack_dashboard/templates/horizon/_conf.html
Compressing... CommandError: An error occurred during rendering /home/yves/openstack/pure_horizon/horizon/openstack_dashboard/templates/_stylesheets.html: Couldn't find anything to import: /horizon/lib/roboto_fontface/css/roboto-fontface.scss
Extensions: <NamespaceAdapterExtension>, <DjangoExtension>, <CompassExtension>
Search path:

on line 16 of themes/material/bootstrap/_styles.scss
imported from line 16 of themes/material/_styles.scss
imported from line 1 of u'string:c61b5d22d54bf56c:\n // My Themes\n@import "/themes/material/variables";\n\n// Horizon\n@import "/dashboard/scss/horizon'

Changed in horizon:
status: Invalid → Confirmed
Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

You need a clean install (no static folder) to reproduce the issue.

Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

You can (and should) use manage.py collactstatic -c to clear the folder first before collecting again. This might be broken because of a new version of roboto which changed paths; you should use the version listed in upper-constraints.

Changed in horizon:
status: Confirmed → Incomplete
Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

collectstatic*

Changed in horizon:
status: Incomplete → Confirmed
Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

The error does not occur on the master branch. Only stable/newton is affected

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

Commands tu reproduce:

    git checkout stable/newton
    git pull
    rm -rf .venv
    rm -rf static # PLEASE DO THIS TO REPRODUCE If you don't you do not reproduce the issue.
    find . -iname '*.pyc' -delete
    virtualenv .venv
    . .venv/bin/activate
    easy_install -U pip # required on ubuntu 14.04
   pip install -Ur test-requirements.txt && pip install -Ur requirements.txt
   ./run_tests.sh --compilemessages
   python manage.py collectstatic --noinput # <- SEE here I DO run the command
   python manage.py compress --force

Traceback :

Found 'compress' tags in:
 /home/yves/openstack/pure_horizon/horizon/openstack_dashboard/templates/horizon/_scripts.html
 /home/yves/openstack/pure_horizon/horizon/openstack_dashboard/templates/_stylesheets.html
 /home/yves/openstack/pure_horizon/horizon/openstack_dashboard/templates/horizon/_conf.html
Compressing... CommandError: An error occurred during rendering /home/yves/openstack/pure_horizon/horizon/openstack_dashboard/templates/_stylesheets.html: Couldn't find anything to import: /horizon/lib/roboto_fontface/css/roboto-fontface.scss
Extensions: <NamespaceAdapterExtension>, <DjangoExtension>, <CompassExtension>
Search path:

on line 16 of themes/material/bootstrap/_styles.scss
imported from line 16 of themes/material/_styles.scss
imported from line 1 of u'string:c61b5d22d54bf56c:\n // My Themes\n@import "/themes/material/variables";\n\n// Horizon\n@import "/dashboard/scss/horizon'

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

On my first post: https://bugs.launchpad.net/horizon/+bug/1643689/comments/2 you can clearly see that I did run collectstatic before.

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

Some patch from master needs to be backported to newton because master is not affected

Revision history for this message
Alfredo Moralejo (amoralej) wrote :

What version of XStatic-roboto-fontface are you getting in your env?

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

Hi Alfredo.

On stable/newton and master I both get : XStatic-roboto-fontface==0.5.0.0

Note : I did a "pip install -Ur test-requirements.txt && pip install -Ur requirements.txt" after switching branch and before looking at the XStatic-roboto-fontface version.
The requirements of master and stable/newton seem to pull the same version.

But I have the error only on newton. Weird...
My pip installed pip packages are in attachment and the only difference between newton and master is:

(.venv)yves@paradox ~/openstack/pure_horizon/horizon $ diff requirements_newton.txt requirements_master.txt
120c120
< Sphinx==1.2.3
---
> Sphinx==1.3.6

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :
Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :
Revision history for this message
Alfredo Moralejo (amoralej) wrote :

Note that the newest supported version for newton is 0.4.3.2 as defined in upper-constraints for stable/newton: https://github.com/openstack/requirements/blob/stable/newton/upper-constraints.txt#L58

I think using that version will fix the issue.

Version 0.5.0.0 is only compatible with recent version in master.

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

Thanks Alfredo, so it's well a bug from newton in requirments.txt in stable newton:

https://github.com/openstack/horizon/blob/stable/newton/requirements.txt#L62

^ this pulls the latest Version (Currently 0.5.0.0) since XStatic-roboto-fontface version 0.5.0.0 satisfies the XStatic-roboto-fontface>=0.4.3.2 condition.

Revision history for this message
Yves-Gwenael Bourhis (yves-gwenael-bourhis) wrote :

I checked and confirm thant on stable/newton after a "pip install -U "XStatic-roboto-fontface===0.4.3.2" the issue is solved.

Revision history for this message
fengchaoyang (fengchaoyang) wrote :

Hello Yves-Gwenael Bourhis:
   My environment XStatic-roboto-fontface version is 0.4.3.2, but there are still this bug, my environment is Ubuntu 16.04 when run devstack when install Horizon, I had to comment out these lines of code(https://github.com/openstack/horizon/blob/master/openstack_dashboard/settings.py#L292-L295).

Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

This doesn't appear with the constrained version of our requirements, so marking Wont Fix.

Changed in horizon:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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