This is a stock-standard, standalone Discourse install, trying to upgrade from v2.7.0.beta1 to v2.7.0.beta2
Failure is here:
uglifyjs '/var/www/discourse/public/assets/_vendor-b631d4ab0775fdbe453aa2158e18dc41826d0ba619e5f2731e5b9fa4c458af99.js' -m -c -o '/var/www/discourse/public/assets/vendor-b631d4ab0775fdbe453aa2158e18dc41826d0ba619e5f2731e5b9fa4c458af99.js' --source-map "base='/var/www/discourse/public/assets',root='/assets',url='/assets/vendor-b631d4ab0775fdbe453aa2158e18dc41826d0ba619e5f2731e5b9fa4c458af99.js.map'"
Parse error at _vendor-b631d4ab0775fdbe453aa2158e18dc41826d0ba619e5f2731e5b9fa4c458af99.js:1850,34
return Handlebars.compile(...arguments);
^
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:394:27)
at run (/usr/lib/node_modules/uglify-js/bin/uglifyjs:343:9)
at Object.<anonymous> (/usr/lib/node_modules/uglify-js/bin/uglifyjs:259: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/vendor-b631d4ab0775fdbe453aa2158e18dc41826d0ba619e5f2731e5b9fa4c458af99.js
/var/www/discourse/lib/tasks/assets.rake:287:in `size'
/var/www/discourse/lib/tasks/assets.rake:287:in `block (4 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:178:in `block in concurrent?'
/var/www/discourse/lib/tasks/assets.rake:278:in `block (3 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:269:in `each'
/var/www/discourse/lib/tasks/assets.rake:269:in `block (2 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:178:in `concurrent?'
/var/www/discourse/lib/tasks/assets.rake:266:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/2.6.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
Any ideas? The site is offline as a result. Thanks.
root@redmine:/var/discourse# ./launcher enter app
ls -al ls -al root@xxxxx-app:/var/www/discourse# ls -al /var/www/discourse/public/assets/vendor-b631d4ab0775fdbe453aa2158e18dc41826d0ba619e5f2731e5b9fa4c458af99.js
-rw-r--r-- 1 discourse www-data 659907 Jan 22 04:55 /var/www/discourse/public/assets/vendor-b631d4ab0775fdbe453aa2158e18dc41826d0ba619e5f2731e5b9fa4c458af99.js
Thanks⦠absolutely no plugins or heavy customizations⦠it was essentially a fresh install in late 2020, just minor tweaks to settings via the admin UI for things like moderator permissions etc. Very strange.
Regretfully I didnāt take a backup before I ran the upgrade, although I have some automated ones from a couple days ago. I guess thatās my only way out of this for now⦠not being Ruby-minded, Iāve no idea how to figure that error out
Ah, looks like running ./launcher restart app has at least got it back online despite the database schema updates that have run. Prior to that, it was throwing a 500 error. Phew
These are what are in the plugins dir, I am assuming they came with the core install, as I havenāt manually added any
root@redmine-app:/var/www/discourse# ls -al plugins/
total 12
drwxr-xr-x 22 discourse discourse 4096 Nov 4 04:54 .
drwxr-xr-x 56 discourse discourse 4096 Jan 22 04:55 ..
drwxr-xr-x 13 discourse discourse 43 Nov 4 04:54 discourse-details
drwxr-xr-x 16 discourse discourse 54 Nov 4 04:54 discourse-local-dates
drwxr-xr-x 20 discourse discourse 69 Jan 22 04:55 discourse-narrative-bot
drwxr-xr-x 11 discourse discourse 59 Nov 4 04:54 discourse-presence
drwxr-xr-x 19 discourse root 4096 Jan 22 04:43 docker_manager
drwxr-xr-x 4 discourse discourse 51 Sep 28 05:11 lazy-yt
drwxr-xr-x 25 discourse discourse 99 Nov 4 04:54 poll
drwxr-xr-x 8 discourse www-data 129 Nov 4 04:54 styleguide
the site themeās a bit bust following the restart, I guess because the assets werenāt finished compiling⦠wonder if thereās a way to get it over the line manuallyā¦
This is the section in the vendor js file itās complaining about:
// allow us to import this as a module
if (typeof define !== "undefined") {
define("handlebars", ["exports"], function (__exports__) {
// It might not be defined server side, which is OK for pretty-text
if (typeof Handlebars !== "undefined") {
// eslint-disable-next-line
__exports__.default = Handlebars;
__exports__.compile = function () {
// eslint-disable-next-line
return Handlebars.compile(...arguments);
};
}
});
define("handlebars-compiler", ["exports"], function (__exports__) {
// eslint-disable-next-line
__exports__.default = Handlebars.compile;
});
}
;
Line 1850 (what errors) is this bit:
return Handlebars.compile(...arguments);
Is there any temporary hack I could do here to get past it? Or is that file going to be generated each time I try the upgrade (P.S it thinks Iāve fully upgraded following the restart⦠but the theme is bust⦠wondering if I can somehow get through this step or if Iāll have to restore from backup, basicallyā¦)
OK - so I donāt know why, but I ran the manual upgrade process (git pull; ./launcher rebuild app) and it worked.
Lots of other activity like postgres upgrades etc came through as part of that manual upgrade.
My guess: something in that commit above, was not compatible with uglify-js or rails version or something, on the original container. It was basically an upgrade that required the āmanualā upgrade process.
Because the web admin interface let me upgrade docker_manager and then the discourse app itself, I assumed this would not be necessary (I know that sometimes it says an upgrade via the web admin cannot be done, and to do it manually⦠but that didnāt happen in this case, and probably should haveā¦)
Got also a problem when running this update (Web upgrage)
After executing these commands:
cd /var/discourse
git pull
./launcher rebuild app
the discourse is working, but it is not possible to enter the admin panel (/admin)
Funnily enough I was just trying to use that functionality in dev and itās not working for me ⦠Handlebars object only has create(), not compile()though I might be barking up the wrong tree ⦠have raised here: Adding a bespoke raw template