ERROR: Unexpected token: punc «)» from qunit helper during a rebuild

FYI: I am having a upgrade of discourse currently running, I believe it is stuck as there is no progress anymore and a stacktrace is printed.

Done compressing google-tag-manager-207e4e7db708ead224f0e2ee6d92492abfe9a29e717480b6f6f2614fa7873019.js : 0.92 secs

8000037.063928327 Compressing: discourse/tests/theme_qunit_helper-db34688652a3fe6992c7a007ef9754196ce9b6897556f2690c93410e88955814.js
uglifyjs '/var/www/discourse/public/assets/discourse/tests/_theme_qunit_helper-db34688652a3fe6992c7a007ef9754196ce9b6897556f2690c93410e88955814.js' -m -c -o '/var/www/discourse/public/assets/discourse/tests/theme_qunit_helper-db34688652a3fe6992c7a007ef9754196ce9b6897556f2690c93410e88955814.js' --source-map "base='/var/www/discourse/public/assets/discourse/tests',root='/assets/discourse/tests',url='/assets/discourse/tests/theme_qunit_helper-db34688652a3fe6992c7a007ef9754196ce9b6897556f2690c93410e88955814.js.map'"
Parse error at _theme_qunit_helper-db34688652a3fe6992c7a007ef9754196ce9b6897556f2690c93410e88955814.js:27884,17
define("sinon", () => {
                 ^
ERROR: Unexpected token: punc «)»
    at JS_Parse_Error.get (eval at <anonymous> (/usr/lib/node_modules/uglify-js/tools/node.js:18:1), <anonymous>:71:23)
    at fatal (/usr/lib/node_modules/uglify-js/bin/uglifyjs:409:27)
    at run (/usr/lib/node_modules/uglify-js/bin/uglifyjs:347:9)
    at Object.<anonymous> (/usr/lib/node_modules/uglify-js/bin/uglifyjs:261:5)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
rake aborted!
Errno::ENOENT: No such file or directory @ rb_file_s_size - /var/www/discourse/public/assets/discourse/tests/theme_qunit_helper-db34688652a3fe6992c7a007ef9754196ce9b6897556f2690c93410e88955814.js
/var/www/discourse/lib/tasks/assets.rake:290:in `size'
/var/www/discourse/lib/tasks/assets.rake:290:in `block (4 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:181:in `block in concurrent?'
/var/www/discourse/lib/tasks/assets.rake:281:in `block (3 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:272:in `each'
/var/www/discourse/lib/tasks/assets.rake:272:in `block (2 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:181:in `concurrent?'
/var/www/discourse/lib/tasks/assets.rake:269:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
Docker Manager: FAILED TO UPGRADE
#<RuntimeError: RuntimeError>
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:196:in `run'
/var/www/discourse/plugins/docker_manager/lib/docker_manager/upgrader.rb:104:in `upgrade'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:19:in `block in <main>'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `fork'
/var/www/discourse/plugins/docker_manager/scripts/docker_manager_upgrade.rb:6:in `<main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:59:in `load'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.3/lib/rails/commands/runner/runner_command.rb:42:in `perform'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.3/lib/rails/command/base.rb:69:in `perform'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.3/lib/rails/command.rb:46:in `invoke'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-6.0.3.3/lib/rails/commands.rb:18:in `<main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
bin/rails:17:in `<main>'
Spinning up 3 Unicorn worker(s) that were stopped initially

I can’t tell if it’s an error in a theme component that’s causing this (and should be?) or if there’s another problem around the qunit theme testing stuff. I changed to title in hopes that someone who knows about that qunit stuff will notice.

We are not using uglify anymore. During a rebuild you should be prompted to update the base image, which will fix this problem.

Can you please re-try with a

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

?

3 Likes

upgrading via CLI worked.
This thread is just meant as bug report. I am fine now and have a working discourse again. Thanks.
In the future I won’t upgrade via the web interface anymore.

2 Likes

Just to note - I ran into this same issue on my self-hosted site (running two containers).

./launcher rebuild app automatically runs a git pull, but running ./launcher bootstrap web_only does not. Just wanted to confirm running git pull under /var/discourse works as expected.

1 Like