Error while compressing files

Bug #1373430 reported by Derek Higgins
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Critical
Doug Fish
tripleo
Fix Released
Critical
Derek Higgins

Bug Description

All ci jobs failing

Earliest Failure : 2014-09-24 09:51:55 UTC
Example : http://logs.openstack.org/50/123150/3/check-tripleo/check-tripleo-ironic-undercloud-precise-nonha/3c60b32/console.html

Sep 24 11:51:43 overcloud-controller0-dxjfgv3agarr os-collect-config[724]: dib-run-parts Wed Sep 24 11:51:43 UTC 2014 Running /opt/stack/os-config-refresh/post-configure.d/14-horizon
Sep 24 11:51:53 overcloud-controller0-dxjfgv3agarr os-collect-config[724]: CommandError: An error occured during rendering /opt/stack/venvs/openstack/lib/python2.7/site-packages/horizon/templates/horizon/_scripts.html: 'horizon/lib/bootstrap_datepicker/locales/bootstrap-datepicker..js' could not be found in the COMPRESS_ROOT '/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/static' or with staticfiles.
Sep 24 11:51:53 overcloud-controller0-dxjfgv3agarr os-collect-config[724]: Found 'compress' tags in:
Sep 24 11:51:53 overcloud-controller0-dxjfgv3agarr os-collect-config[724]: /opt/stack/venvs/openstack/lib/python2.7/site-packages/horizon/templates/horizon/_scripts.html
Sep 24 11:51:53 overcloud-controller0-dxjfgv3agarr os-collect-config[724]: /opt/stack/venvs/openstack/lib/python2.7/site-packages/horizon/templates/horizon/_conf.html
Sep 24 11:51:53 overcloud-controller0-dxjfgv3agarr os-collect-config[724]: /opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/templates/_stylesheets.html
Sep 24 11:51:53 overcloud-controller0-dxjfgv3agarr os-collect-config[724]: Compressing... [2014-09-24 11:51:53,459] (os-refresh-config) [ERROR] during post-configure phase. [Command '['dib-run-parts', '/opt/stack/os-config-refresh/post-configure.d']' returned non-zero exit status 1]

Tags: ci
Revision history for this message
Derek Higgins (derekh) wrote :
Revision history for this message
Doug Fish (drfish) wrote :

The same static compression failure can be seen in Horizon.

(.venv)drf@drf-VirtualBox:~/horizon$ python manage.py compress --forceFound 'compress' tags in:
 /home/drf/horizon/horizon/templates/horizon/_scripts.html
 /home/drf/horizon/horizon/templates/horizon/_conf.html
 /home/drf/horizon/openstack_dashboard/templates/_stylesheets.html
CommandError: An error occured during rendering /home/drf/horizon/horizon/templates/horizon/_scripts.html: 'horizon/lib/bootstrap_datepicker/locales/bootstrap-datepicker..js' could not be found in the COMPRESS_ROOT '/home/drf/horizon/static' or with staticfiles.

problem is the the locale isn't set at all, so an unexpected (and non-existent) filename is created.

Additionally, the language file can't be selected at compression time anyway - this needs to be computed per-request so that different languages can be served to different users.

Changed in horizon:
importance: Undecided → Critical
status: New → Confirmed
assignee: nobody → Doug Fish (drfish)
milestone: none → juno-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/123779

Changed in horizon:
status: Confirmed → In Progress
Dan Prince (dan-prince)
Changed in tripleo:
assignee: nobody → Derek Higgins (derekh)
Revision history for this message
Doug Fish (drfish) wrote :

Some instructions for testing this out in Horizon
- download your horizon code
- copy in your usual local_settings file. Edit it so that COMPRESS_OFFLINE is True.
- run the tests (which will make sure your virtual env is created)
./run_tests.sh

- compress the files
source .venv/bin/activate
set DJANGO_SETTINGS_MODULE=openstack_dashboard.settings
python manage.py compress

*Boom* will fail without the patch

- now, download the patch, and try the compress again
python manage.py compress

- fire up the development server
./run_tests.sh --runserver 0.0.0.0:8081

- Point your browser at localhost:8081 and look at the calendar widget on Admin->Overview (click one of the dates).
- Now change your language using the user drop down at the top->Settings/Language. Save it.
- The calendar on Admin->Overview should change language as well.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/123779
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=a05857872083f4e97d86c2d658574b095dde123f
Submitter: Jenkins
Branch: master

commit a05857872083f4e97d86c2d658574b095dde123f
Author: Doug Fish <email address hidden>
Date: Wed Sep 24 11:11:12 2014 -0500

    Move datepicker language js inclusion outside compress

    The datapicker language support works by including a different
    js file based on the language of the user. This will not
    work if the js is included at compress time becuase only 1
    language can be included.

    Additionally cleaning up the logic in case the locale
    isn't set (as is the case at compression time) to prevent
    an improper path from being build.

    Change-Id: I953dde0e7ee4a876376faf28c6f0bb859a3dc6b6
    Closes-Bug: #1373430

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Changed in tripleo:
status: Triaged → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-rc1 → 2014.2
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.