# Failed to upgrade - syntax error, unexpected \<\< js \<\< \<\<~JS

**URL:** https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630
**Category:** Bug
**Created:** [July 22, 2016, 6:50am UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630 "2016-07-22T06:50:29Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![naveedahmada036](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/naveedahmada036/32/122417_2.png) [@naveedahmada036](https://meta.discourse.org/u/naveedahmada036)
#### Post date: [July 22, 2016, 6:50am UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/1 "2016-07-22T06:50:29Z")

</div>

Trying to upgrade discourse to latest version, but before that I need to upgrade docker manager and  
getting following exception while upgrading:

```plaintext
Bundled gems are installed into ./vendor/bundle.
$ bundle exec rake multisite:migrate
rake aborted!
SyntaxError: /var/www/discourse/lib/plugin/instance.rb:273: syntax error, unexpected <<
      js << <<~JS
              ^
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:457:in `load'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:457:in `block in load_file'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:647:in `new_constants_in'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:456:in `load_file'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:354:in `require_or_load'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:317:in `depend_on'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:233:in `require_dependency'
/var/www/discourse/lib/discourse.rb:2:in `'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:274:in `require'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:274:in `block in require'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:240:in `load_dependency'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.7/lib/active_support/dependencies.rb:274:in `require'
/var/www/discourse/config/application.rb:31:in `'
/var/www/discourse/config/application.rb:19:in `'
/var/www/discourse/config/application.rb:18:in `'
/var/www/discourse/Rakefile:5:in `require'
/var/www/discourse/Rakefile:5:in `'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-11.2.2/exe/rake:27:in `'
(See full trace by running task with --trace)

```

Current versions:  
docker\_manager(9b59950)  
discourse (11e303e)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [July 22, 2016, 6:54am UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/2 "2016-07-22T06:54:48Z")

</div>

Are you 100% sure you are not running any plugins except for docker\_manager?

---

<div class="post-metadata">

### Author: ![naveedahmada036](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/naveedahmada036/32/122417_2.png) [@naveedahmada036](https://meta.discourse.org/u/naveedahmada036)
#### Post date: [July 22, 2016, 7:07am UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/3 "2016-07-22T07:07:47Z")

</div>

Sorry I should have included list of other plugins as well, using following plugins:

- [Audio Onebox](https://github.com/scossar/audio-onebox.git) (0cfe35f)
- [babble](https://github.com/gdpelican/babble.git) (ef1ecc5)
- [create-profile-note](https://github.com/sitepoint/discourse-create-profile-note.git) (8d64051)
- [discourse-plugin-composer-help-button](https://github.com/cpradio/discourse-plugin-composer-help-button.git) (e3e21cb)
- [discourse-plugin-poll-ui](https://github.com/cpradio/discourse-plugin-poll-ui.git) (0bcafa4)
- [discourse-solved](https://github.com/discourse/discourse-solved.git) (fe5a7d7)
- [garmin\_connect\_onebox](https://github.com/naveed-ahmad/garmin_connect_onebox.git) (1b0832d)
- lazyYT
- poll

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [July 22, 2016, 10:24am UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/4 "2016-07-22T10:24:29Z")

</div>

You are probably better off letting it upgrade all of them by logging into the server and running

```plaintext
./launcher rebuild app

```

Especially if you are following tests-pased, as a lot of those plugins have had changes due to recent Core changes.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [July 22, 2016, 5:04pm UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/5 "2016-07-22T17:04:53Z")

</div>

The problem here is the ruby 2.3 syntax - @tgxworld told it was safe to use, but perhaps it is not?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 22, 2016, 5:15pm UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/6 "2016-07-22T17:15:14Z")

</div>

The guy isn’t running the latest docker image, the latest enforce ruby 2.3.

---

<div class="post-metadata">

### Author: ![naveedahmada036](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/naveedahmada036/32/122417_2.png) [@naveedahmada036](https://meta.discourse.org/u/naveedahmada036)
#### Post date: [July 22, 2016, 5:42pm UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/7 "2016-07-22T17:42:05Z")

</div>

Yeah and I’m getting this exception while upgrading docker\_manager.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [July 22, 2016, 6:18pm UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/8 "2016-07-22T18:18:24Z")

</div>

> [@naveedahmada036](#):
>
> Yeah and I’m getting this exception while upgrading docker\_manager.

Doesn’t a simple:

```plaintext
cd/ var/discourse
git pull
./launcher rebuild app

```

works?

The docker manager isn’t used to update the launcher, and is need on the big transition upgrade (ruby, pg, nginx, etc update from earlier this month).

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [July 22, 2016, 6:20pm UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/9 "2016-07-22T18:20:13Z")

</div>

That was my questioning too. In theory, I would think that would solve his issue.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 22, 2016, 11:11pm UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/10 "2016-07-22T23:11:41Z")

</div>

Hmmm this is odd. I added a check to make docker manager raise an error and make the user rebuild if Ruby is not 2.3. Will have a look next week.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 25, 2016, 10:28am UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/11 "2016-07-25T10:28:31Z")

</div>

Hmm I can’t find a `<<~JS` ` heredoc anywhere (including your plugins).

Have you resolved the issue?

Otherwise, can you run the following commands and provide the output here?

```plaintext
./launcher enter app
ruby -v 
cat /VERSION

```

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [July 25, 2016, 1:01pm UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/12 "2016-07-25T13:01:33Z")

</div>

Ah I found it but the syntax we’re using is different and I’m not sure how to reproduce yet.

> <https://github.com/discourse/discourse/blob/main/lib/plugin/instance.rb#L249-L266>

---

<div class="post-metadata">

### Author: ![naveedahmada036](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/naveedahmada036/32/122417_2.png) [@naveedahmada036](https://meta.discourse.org/u/naveedahmada036)
#### Post date: [August 9, 2016, 8:12pm UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/13 "2016-08-09T20:12:51Z")

</div>

```
cd/ var/discourse
git pull
./launcher rebuild app

```

Did the trick. Thanks 🙂

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [August 9, 2016, 9:26pm UTC](https://meta.discourse.org/t/failed-to-upgrade-syntax-error-unexpected-js-js/47630/14 "2016-08-09T21:26:17Z")

</div>


