Closed zamentur closed 1 year ago
The install fails during the precompile:assets steps.
Hardware: dedicated x86_64 server YunoHost version: 4.3
I think it happens if the global uglify-js version is under a specific version. On my side:
# uglifyjs --version 2.8.29
To not failed at this step
2021-12-17 15:42:29,967: DEBUG - 21920019.010518584 Compressing: vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js 2021-12-17 15:42:29,968: DEBUG - MaxMind IP database updates require a license 2021-12-17 15:42:29,969: DEBUG - Please set DISCOURSE_MAXMIND_LICENSE_KEY to one you generated at https://www.maxmind.com 2021-12-17 15:42:29,970: DEBUG - MaxMind IP database updates require a license 2021-12-17 15:42:29,971: DEBUG - Please set DISCOURSE_MAXMIND_LICENSE_KEY to one you generated at https://www.maxmind.com 2021-12-17 15:42:29,975: DEBUG - Downloading MaxMindDB... 2021-12-17 15:42:29,976: DEBUG - Compressing Javascript and Generating Source Maps 2021-12-17 15:42:29,980: DEBUG - uglifyjs '/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js' -m -c -o '/var/www/discourse/public/assets/vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js' --source-map "base='/var/www/discourse/public/assets',root='/assets',url='/assets/vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js.map'" 2021-12-17 15:42:46,186: DEBUG - WARN: Dropping side-effect-free statement [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:2420,2] 2021-12-17 15:42:49,466: DEBUG - WARN: Dropping unused variable val [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:8788,8] 2021-12-17 15:42:49,474: DEBUG - WARN: Non-strict equality against boolean: == true [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:8827,8] 2021-12-17 15:42:49,479: DEBUG - WARN: Non-strict equality against boolean: != true [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:8835,22] 2021-12-17 15:42:52,045: DEBUG - WARN: Side effects in initialization of unused variable wrapperAt [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:14537,6] 2021-12-17 15:42:52,433: DEBUG - WARN: Dropping unused variable RSVP [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:18392,6] 2021-12-17 15:42:52,478: DEBUG - WARN: Side effects in initialization of unused variable content [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:18779,10] 2021-12-17 15:42:53,143: DEBUG - WARN: Dropping side-effect-free statement [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:20160,8] 2021-12-17 15:42:53,485: DEBUG - WARN: Dropping unused variable define [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:19251,299] 2021-12-17 15:42:53,487: DEBUG - WARN: Dropping unused variable module [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:19251,306] 2021-12-17 15:42:53,531: DEBUG - WARN: Dropping unused variable exports [/var/www/discourse/public/assets/_vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js:19251,313] 2021-12-17 15:42:58,777: DEBUG - fs.js:114 2021-12-17 15:42:58,778: DEBUG - throw err; 2021-12-17 15:42:58,778: DEBUG - ^ 2021-12-17 15:42:58,779: DEBUG - 2021-12-17 15:42:58,780: DEBUG - Error: ENOENT: no such file or directory, open 'base='/var/www/discourse/public/assets',root='/assets',url='/assets/vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js.map'' 2021-12-17 15:42:58,781: DEBUG - at Object.openSync (fs.js:443:3) 2021-12-17 15:42:58,782: DEBUG - at Object.writeFileSync (fs.js:1194:35) 2021-12-17 15:42:58,782: DEBUG - at done (/usr/lib/nodejs/uglify-js/bin/uglifyjs:516:20) 2021-12-17 15:42:58,783: DEBUG - at cb (/usr/lib/nodejs/uglify-js/bin/uglifyjs:324:39) 2021-12-17 15:42:58,784: DEBUG - at /usr/lib/nodejs/uglify-js/bin/uglifyjs:391:9 2021-12-17 15:42:58,785: DEBUG - at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3) 2021-12-17 15:42:58,810: DEBUG - rake aborted! 2021-12-17 15:42:58,811: DEBUG - Errno::ENOENT: No such file or directory @ rb_file_s_size - /var/www/discourse/public/assets/vendor-dde8b5f2dd41adf78c88e7719455c3a5d4db146cb96d783a2dc1ed978892f200.js 2021-12-17 15:42:58,812: DEBUG - /var/www/discourse/lib/tasks/assets.rake:303:in `size' 2021-12-17 15:42:58,813: DEBUG - /var/www/discourse/lib/tasks/assets.rake:303:in `block (4 levels) in <main>' 2021-12-17 15:42:58,814: DEBUG - /var/www/discourse/lib/tasks/assets.rake:194:in `block in concurrent?' 2021-12-17 15:42:58,815: DEBUG - /var/www/discourse/lib/tasks/assets.rake:294:in `block (3 levels) in <main>' 2021-12-17 15:42:58,816: DEBUG - /var/www/discourse/lib/tasks/assets.rake:285:in `each' 2021-12-17 15:42:58,817: DEBUG - /var/www/discourse/lib/tasks/assets.rake:285:in `block (2 levels) in <main>' 2021-12-17 15:42:58,818: DEBUG - /var/www/discourse/lib/tasks/assets.rake:194:in `concurrent?' 2021-12-17 15:42:58,819: DEBUG - /var/www/discourse/lib/tasks/assets.rake:282:in `block in <main>' 2021-12-17 15:42:58,820: DEBUG - Tasks: TOP => assets:precompile 2021-12-17 15:42:58,821: DEBUG - (See full trace by running task with --trace) 2021-12-17 15:42:59,034: DEBUG - + ynh_exit_properly
To avoid that you can install terser (discourse will use it instead of uglify-js).
npm -g -i terser
it's now fixed in lasts versions
Describe the bug
The install fails during the precompile:assets steps.
Context
Hardware: dedicated x86_64 server YunoHost version: 4.3
Steps to reproduce
I think it happens if the global uglify-js version is under a specific version. On my side:
Expected behavior
To not failed at this step
Logs
I found a workaround
To avoid that you can install terser (discourse will use it instead of uglify-js).