"SyntaxError: invalid increment operand" when parsing JavaScript using Firefox

Bug #1130610 reported by Nerijus Bendziunas on 2013-02-20
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Undecided
David Lyle
horizon (Ubuntu)
High
James Page
Raring
High
James Page
python-django-compressor (Ubuntu)
High
James Page
Raring
High
James Page

Bug Description

OS: Ubuntu 12.04
Packages: Ubuntu grizzly testing
Browser: FireFox 19

When loading JavaScript code FireFox getting this error:
SyntaxError: invalid increment operand
https://X.Y.Z.W/static/dashboard/js/57c506ad41ce.js
Line 99
...ch(function(){this.id||(this.id="ui-id-"+++n)})},removeUniqueId:function(){retur...

Error apears after logging into dashboard. In Chrome 24 all works correct.

Little bit of investinagion:
horizon/static/horizon/lib/jquery/jquery-ui-1.9.2.custom.min.js has '(this.id="ui-id-"+ ++n)})' and after compression it becames '(this.id="ui-id-"+++n)})'

Related branches

Changed in horizon:
status: New → Incomplete

I'm using last DevStack version on Ubuntu 12.04 LTS and Firefox 19.0.

I tried to reproduce it in my local environment but I didn't that error.

How did you setted it up? Are you using Devstack or you downloaded the package from Ubuntu repos?

Thanks

Download full text (7.7 KiB)

I'm using thiese repos:
deb http://ppa.launchpad.net/openstack-ubuntu-testing/grizzly-build-depends/ubuntu precise main
deb-src http://ppa.launchpad.net/openstack-ubuntu-testing/grizzly-build-depends/ubuntu precise main
deb http://ppa.launchpad.net/openstack-ubuntu-testing/grizzly-trunk-testing/ubuntu precise main
deb-src http://ppa.launchpad.net/openstack-ubuntu-testing/grizzly-trunk-testing/ubuntu precise main

How to reproduce:
# apt-get update
# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
# apt-get install openstack-dashboard
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  openstack-dashboard-ubuntu-theme python-appconf python-cloudfiles python-compressor python-django python-django-horizon python-openstack-auth
Suggested packages:
  python-psycopg2 python-psycopg python-flup python-sqlite geoip-database-contrib
The following NEW packages will be installed:
  openstack-dashboard openstack-dashboard-ubuntu-theme python-appconf python-cloudfiles python-compressor python-django python-django-horizon python-openstack-auth
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.6 kB/6,567 kB of archives.
After this operation, 49.8 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main python-cloudfiles all 1.7.9.2-1 [20.6 kB]
Fetched 20.6 kB in 0s (49.6 kB/s)
Selecting previously unselected package python-cloudfiles.
(Reading database ... 388427 files and directories currently installed.)
Unpacking python-cloudfiles (from .../python-cloudfiles_1.7.9.2-1_all.deb) ...
Selecting previously unselected package python-django.
Unpacking python-django (from .../python-django_1.4.1-2~cloud0_all.deb) ...
Selecting previously unselected package python-appconf.
Unpacking python-appconf (from .../python-appconf_0.5-0ubuntu2~cloud0_all.deb) ...
Selecting previously unselected package python-compressor.
Unpacking python-compressor (from .../python-compressor_1.1.2-0ubuntu5~cloud0_all.deb) ...
Selecting previously unselected package python-openstack-auth.
Unpacking python-openstack-auth (from .../python-openstack-auth_1.0.1-0ubuntu6~precise_all.deb) ...
Selecting previously unselected package python-django-horizon.
Unpacking python-django-horizon (from .../python-django-horizon_2013.1.a113.g7d13abc+git201302200401~precise-0ubuntu1_all.deb) ...
Selecting previously unselected package openstack-dashboard.
Unpacking openstack-dashboard (from .../openstack-dashboard_2013.1.a113.g7d13abc+git201302200401~precise-0ubuntu1_all.deb) ...
Selecting previously unselected package openstack-dashboard-ubuntu-theme.
Unpacking openstack-dashboard-ubuntu-theme (from .../openstack-dashboard-ubuntu-theme_2013.1.a113.g7d13abc+git201302200401~precise-0ubuntu1_all.deb) ...
Processing triggers for man-db ...
Setting up python-cloudfiles (1.7.9.2-1) ...
Setting up python-django (1.4.1-2~cloud0) ...
Setting up python...

Read more...

David Lyle (david-lyle) wrote :

I have encountered the same error. I can not reproduce it in the .venv environment. Our install process creates and uses debian packages and this is where we encountered the error. By editing the horizon/static/horizon/lib/jquery/jquery-ui-1.9.2.custom.min.js to change '(this.id="ui-id-"+ ++n)})' to '(this.id="ui-id-"+ (++n))})' will post patch shortly

David Lyle (david-lyle) on 2013-03-01
Changed in horizon:
assignee: nobody → David Lyle (david-lyle)
David Lyle (david-lyle) on 2013-03-01
Changed in horizon:
status: Incomplete → Confirmed

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

Changed in horizon:
status: Confirmed → In Progress
David Lyle (david-lyle) wrote :

Ok, more digging... and the root cause of this error is the use of python-django-compressor-1.1.2 rather that python-django-compressor-1.2. There is a bug fix in version 1.2 that handles the '+ ++' syntax compression problem. The version posted to PyPi is 1.2 which is why this is not seen in development environment builds. There is no python-django-compressor default package for Precise and for Quantal and Raring the version is still 1.1.2. The nightly testing also only has 1.1.2 in the ppa: http://ppa.launchpad.net/openstack-ubuntu-testing/grizzly-trunk-testing/ubuntu/pool/main/p/python-django-compressor/

I can pull in a 1.2 package for a local mirror, but that doesn't solve the larger problem of installing on ubuntu of any flavor via .deb packages and no supported ppa to pull from.

So do we band-aid fix this in horizon? https://review.openstack.org/23305

Move the offending file out of the {% compress js %} tag

Upload a new .deb package to a supported ppa?

Changed in horizon:
milestone: none → grizzly-rc1
importance: Undecided → High
Gabriel Hurley (gabriel-hurley) wrote :

This bug is caused by an outdated version of django compressor in the ubuntu apt repo. It should not be fixed in Horizon master.

Changed in horizon:
importance: High → Undecided
milestone: grizzly-rc1 → none
status: In Progress → Invalid
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in horizon (Ubuntu):
status: New → Confirmed
James Page (james-page) on 2013-03-15
Changed in python-django-compressor (Ubuntu Raring):
assignee: nobody → James Page (james-page)
Changed in horizon (Ubuntu Raring):
assignee: nobody → James Page (james-page)
James Page (james-page) wrote :

OK _ I verified this is a distro issue with a new version of python-django-compressor; I'll get this uploaded to raring and backported to the trunk testing PPA and cloud archive for grizzly rc1.

Changed in horizon (Ubuntu Raring):
importance: Undecided → High
Changed in python-django-compressor (Ubuntu Raring):
importance: Undecided → High
status: New → In Progress
Changed in horizon (Ubuntu Raring):
status: Confirmed → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-django-compressor - 1.2-0ubuntu1

---------------
python-django-compressor (1.2-0ubuntu1) raring; urgency=low

  * New upstream release (LP: #1130610).
  * d/watch: Fix watch file inline with upstream project name.
 -- James Page <email address hidden> Fri, 15 Mar 2013 12:41:25 +0000

Changed in python-django-compressor (Ubuntu Raring):
status: In Progress → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package horizon - 1:2013.1~rc1-0ubuntu1

---------------
horizon (1:2013.1~rc1-0ubuntu1) raring; urgency=low

  [ James Page ]
  * New upstream release candidate for Grizzly:
    - Recompress static JS and CSS and generate new manifest.json for
      offline compression.
  * d/watch: Update uversionmangle to deal with upstream versioning
    changes, remove tarballs.openstack.org.
  * d/control: Version python-compressor >= 1.2 (LP: #1130610).

  [ Adam Gandelman ]
  * debian/patches/ubuntu_local_settings.py: Refresh, specify memcache
    location as part of CACHES, as per upstream changes to example config.
 -- James Page <email address hidden> Wed, 20 Mar 2013 11:20:17 +0000

Changed in horizon (Ubuntu Raring):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers