Content
You are here:
Can not build frontend after update
Added by Roman A over 5 years ago
After upgrading to v 8.3.0, I am no longer able to compile the frontend using RAILS_ENV="production" bundle exec rake assets:precompile
I haven't found any posts with exactly the same issue.. Can anybody point me into the right direction what I need to do to solve this?
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm@6.9.0
3 info using node@v10.13.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle openproject-frontend@0.1.0~prebuild: openproject-frontend@0.1.0
6 verbose lifecycle openproject-frontend@0.1.0~prebuild: unsafe-perm in lifecycle true
7 verbose lifecycle openproject-frontend@0.1.0~prebuild: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/openproject/frontend/node_modules/.bin:/opt/openproject/vendor/bundle/ruby/2.6.0/bin:/opt/openproject/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/root/.local/bin:/root/bin:/root/.rbenv/bin:/root/.nodenv/bin
8 verbose lifecycle openproject-frontend@0.1.0~prebuild: CWD: /opt/openproject/frontend
9 silly lifecycle openproject-frontend@0.1.0~prebuild: Args: [ '-c', './scripts/link_plugin_placeholder.js' ]
10 silly lifecycle openproject-frontend@0.1.0~prebuild: Returned: code: 0 signal: null
11 info lifecycle openproject-frontend@0.1.0~build: openproject-frontend@0.1.0
12 verbose lifecycle openproject-frontend@0.1.0~build: unsafe-perm in lifecycle true
13 verbose lifecycle openproject-frontend@0.1.0~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/openproject/frontend/node_modules/.bin:/opt/openproject/vendor/bundle/ruby/2.6.0/bin:/opt/openproject/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/root/.local/bin:/root/bin:/root/.rbenv/bin:/root/.nodenv/bin
14 verbose lifecycle openproject-frontend@0.1.0~build: CWD: /opt/openproject/frontend
15 silly lifecycle openproject-frontend@0.1.0~build: Args: [ '-c', 'ng build --prod && npm run legacy-webpack' ]
16 info lifecycle openproject-frontend@0.1.0~build: Failed to exec build script
17 verbose stack Error: openproject-frontend@0.1.0 build: `ng build --prod && npm run legacy-webpack`
17 verbose stack spawn ENOENT
17 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
17 verbose stack at ChildProcess.emit (events.js:182:13)
17 verbose stack at maybeClose (internal/child_process.js:962:16)
17 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
18 verbose pkgid openproject-frontend@0.1.0
19 verbose cwd /opt/openproject/frontend
20 verbose Linux 4.4.0-042stab134.8
21 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
22 verbose node v10.13.0
23 verbose npm v6.9.0
24 error file sh
25 error code ELIFECYCLE
26 error errno ENOENT
27 error syscall spawn
28 error openproject-frontend@0.1.0 build: `ng build --prod && npm run legacy-webpack`
28 error spawn ENOENT
29 error Failed at the openproject-frontend@0.1.0 build script.
29 error This is probably not a problem with npm. There is likely additional logging output above.
30 verbose exit [ 1, true ]
Replies (4)
Hi Roman,
the error `26 error errno ENOENT` typically hints at the process being killed due to being out of memory. Node has a default process RAM limit of 1.9G and may be getting killed by your system. Either try setting
--max-old-size
option, reduce your OOM killer setting or add a swap file.Best,
Oliver
Hi Oliver
Thank you for your reply. I am running openproject on a virtual server with 2GB of memory. If I check memory usage after a fresh reboot I get:
However, I don't think that OOM killed the process as Im not getting anything with
grep -i 'killed process' /var/log/syslog
. Also, I can not enlarge my swap file because I am not superuser... Further, I am unsure how to set --max-old-space-sizeI realized that I also got the error
sh: 1: ng: not found
, so after googling and doingnpm link
, I'm now getting a different error:And with some more tinkering, I realized that the /frontend/node_modules folder was empty... So I ran npm install within /frontend/ but Im again stuck with some silly error:
Hope anyone can make some sense out of this mess :(
Roman
Hi Roman,
Thanks for the additional debug output, it is now clear it is not being killed but rather the npm subcommand failed which also triggers a ELIFCECYLCE error. I assume you are on a manual installation? Please ensure you have the frontend dependencies installed with
cd <Your OpenProject root> && npm install
Best,
Oliver
Hi all
Yes the frondend dependencies were installed...
Regardless, I have now reverted back to an old installation of Openproject (8.2.1) which still supports MySQL databases. For anyone experiencing the same issue, this is what I've done:
mysql -u openproject -p openproject < openproject_v7.sql
dpkg -i openproject_8.2.1-1550429392.328d0cc4.xenial_amd64.deb
openproject configure
gem install bundler:1.17.3
I find it frankly quite crappy that the new version (8.3.0) does not really support the old mysql databases anymore. At no point have we been informed that upgrading will make Openproject defunct. And no, migration to PostgreSQL did NOT work (at least not for wikis and work packages).