Nextcloud Onlyoffice Nodejs and npm version

@all Happy holiday season.

@mrmarkuz,

It seems that NS does not completely meet the requirements for Onlyoffice document server. Onlyoffice Document server requires Nodejs version 8 where NS comes Nodejs version 6 (nodejs-6.14.3-1.el7.x86_64) by default.

This results in too high CPU usage, a massive ammount of worker restarts and very large log files. (see /var/log/onlyoffice/documentserver/spellchecker). Please also see top to identify the processes.

The remidy seems to be to use Nodejs version 8, which is available via Software Collections (rh-nodejs8-nodejs).

Any chance you are willing to take a look at this please?

Reference:
https://dev.onlyoffice.org/viewtopic.php?f=4&t=11632&p=18901&hilit=cpu+usage#p18901

Although not the exact same error, my log huge log files have and endless:

Error: Module version mismatch. Expected 48, got 57.
at Error (native)
at Object.Module._extensionsā€¦node (module.js:604:18)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/var/www/onlyoffice/documentserver/server/SpellChecker/sources/spellCheck.js:13:17)
at Module._compile (module.js:577:32)
at Object.Module._extensionsā€¦js (module.js:586:10)
module.js:604
return process.dlopen(module, path._makeLong(filename));
^

Which suggests that there is an issue regarding the Nodejs version used.

Edit: And while weā€™re at it, it seems the requirements must include an NPM update too according the changelog:
https://helpcenter.onlyoffice.com/server/document/changelog.aspx

2 Likes

For sure, thanks for testing and sharing.
Actually I couldnā€™t reproduce it on a fresh installed vm but on an older server. Thanks for the pointers about nodejs, Iā€™ll have a look and reportā€¦

Meanwhile I wanted to install the scl version of nodejs8 to do some testing. Unfortunately I came across this error:

Transaction check error:
file /usr/lib/rpm/nodejs_native.req from install of rh-nodejs8-nodejs-8.11.4-1.el7.x86_64 conflicts with file from package nodejs-1:6.14.3-1.el7.x86_64

I could use --force, but I do not want to mess up the RPM db and logic.

The original onlyoffice-documentserver rpm requires the nodejs package from epel which conflicts with rh-nodejs8.

Here it seems nodejs 6.9 is required and 6.14 is provided by epel:

Yes, nodejs 6.9 is listed, but that document is over 2 years old :frowning:

Is this solvable?

If itā€™s really a nodejs version problem it should be posted at the onlyoffice side so they could change their package.
I am going to check if itā€™s solvable without changing nodejsā€¦

EDIT:

You may add the nodejs repo

curl -sL https://rpm.nodesource.com/setup_8.x | sudo bash -

https://helpcenter.onlyoffice.com/server/linux/document/linux-installation-centos.aspx

EDIT2:

For me itā€™s working now without high CPU load of the node processā€¦

Also interesting, the SCL version of Nodejs version 8 is Nodejs 8.11:
Installing:
rh-nodejs8 x86_64 3.0-3.el7 centos-sclo-rh 6.6 k
Installing for dependencies:
rh-nodejs8-nodejs x86_64 8.11.4-1.el7 centos-sclo-rh 7.1 M
rh-nodejs8-npm x86_64 5.6.0-8.11.4.1.el7 centos-sclo-rh 4.4 M
rh-nodejs8-runtime x86_64 3.0-3.el7 centos-sclo-rh 1.1 M

Whilse the minimum version required by Onlyoffice is version 8.12 (and I believe that is a LTS version)

So using nodejs from SCL is not a an option

Please try this, it works for me without high CPU load:

curl -sL https://rpm.nodesource.com/setup_8.x | sudo bash -
yum install nodejs

Result:

[root@srv01 ~]# curl -sL https://rpm.nodesource.com/setup_8.x | sudo bash -

Installing the NodeSource Node.js 8.x LTS Carbon repoā€¦

Inspecting systemā€¦

  • rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
  • uname -m

Confirming ā€œel7-x86_64ā€ is supportedā€¦

Downloading release setup RPMā€¦

Installing release setup RPMā€¦

  • rpm -i --nosignature --force ā€˜/tmp/tmp.dsWo2XM5lhā€™

Cleaning upā€¦

  • rm -f ā€˜/tmp/tmp.dsWo2XM5lhā€™

Checking for existing installationsā€¦

  • rpm -qa ā€˜node|npmā€™ | grep -v nodesource

Your system appears to already have Node.js installed from an alternative source.

Run sudo yum remove -y nodejs npm to remove these first.

Run sudo yum install -y nodejs to install Node.js 8.x LTS Carbon and npm.

You may also need development tools to build native addons:

 sudo yum install gcc-c++ make

To install the Yarn package manager, run:

 curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
 sudo yum install yarn

These are instructions howto use the script, you may just run

yum install nodejs.

If it does not work remove nodejs first with yum remove nodejs.

[root@srv01 ~]# yum install nodejs
Loaded plugins: changelog, fastestmirror, nethserver_events
Loading mirror speeds from cached hostfile

  • ce-base: mi.mirror.garr.it
  • ce-extras: mi.mirror.garr.it
  • ce-updates: mi.mirror.garr.it
    Excluding mirror: mirror.de.leaseweb.net
    Excluding mirror: mirror.nl.leaseweb.net
  • epel: ftp.uni-stuttgart.de
  • nethforge: nethserver.interlin.nl
  • nethserver-base: nethserver.interlin.nl
  • nethserver-updates: nethserver.interlin.nl
    nodesource | 2.5 kB 00:00:00
    nodesource/x86_64/primary_db | 43 kB 00:00:00
    Resolving Dependencies
    ā†’ Running transaction check
    ā€”> Package nodejs.x86_64 1:6.14.3-1.el7 will be updated
    ā†’ Processing Dependency: nodejs = 1:6.14.3-1.el7 for package: 1:npm-3.10.10-1.6.14.3.1.el7.x86_64
    ā€”> Package nodejs.x86_64 2:8.14.1-1nodesource will be an update
    ā†’ Finished Dependency Resolution
    Error: Package: 1:npm-3.10.10-1.6.14.3.1.el7.x86_64 (@epel)
    Requires: nodejs = 1:6.14.3-1.el7
    Removing: 1:nodejs-6.14.3-1.el7.x86_64 (@epel)
    nodejs = 1:6.14.3-1.el7
    Updated By: 2:nodejs-8.14.1-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.14.1-1nodesource
    Available: 2:nodejs-8.0.0-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.0.0-1nodesource.el7.centos
    Available: 2:nodejs-8.1.0-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.1.0-1nodesource.el7.centos
    Available: 2:nodejs-8.1.1-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.1.1-1nodesource.el7.centos
    Available: 2:nodejs-8.1.2-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.1.2-1nodesource.el7.centos
    Available: 2:nodejs-8.1.3-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.1.3-1nodesource.el7.centos
    Available: 2:nodejs-8.1.4-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.1.4-1nodesource.el7.centos
    Available: 2:nodejs-8.2.0-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.2.0-1nodesource.el7.centos
    Available: 2:nodejs-8.2.1-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.2.1-1nodesource.el7.centos
    Available: 2:nodejs-8.3.0-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.3.0-1nodesource.el7.centos
    Available: 2:nodejs-8.4.0-1nodesource.el7.centos.x86_64 (nodesource)
    nodejs = 2:8.4.0-1nodesource.el7.centos
    Available: 2:nodejs-8.5.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.5.0-1nodesource
    Available: 2:nodejs-8.6.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.6.0-1nodesource
    Available: 2:nodejs-8.7.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.7.0-1nodesource
    Available: 2:nodejs-8.8.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.8.0-1nodesource
    Available: 2:nodejs-8.8.1-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.8.1-1nodesource
    Available: 2:nodejs-8.9.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.9.0-1nodesource
    Available: 2:nodejs-8.9.1-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.9.1-1nodesource
    Available: 2:nodejs-8.9.2-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.9.2-1nodesource
    Available: 2:nodejs-8.9.3-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.9.3-1nodesource
    Available: 2:nodejs-8.9.4-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.9.4-1nodesource
    Available: 2:nodejs-8.10.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.10.0-1nodesource
    Available: 2:nodejs-8.11.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.11.0-1nodesource
    Available: 2:nodejs-8.11.1-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.11.1-1nodesource
    Available: 2:nodejs-8.11.2-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.11.2-1nodesource
    Available: 2:nodejs-8.11.3-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.11.3-1nodesource
    Available: 2:nodejs-8.11.4-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.11.4-1nodesource
    Available: 2:nodejs-8.12.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.12.0-1nodesource
    Available: 2:nodejs-8.13.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.13.0-1nodesource
    Available: 2:nodejs-8.14.0-1nodesource.x86_64 (nodesource)
    nodejs = 2:8.14.0-1nodesource
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

You have to do

yum remove nodejs

first. I am afraid it will remove documentserver tooā€¦you have to reinstall.

Yup, was trying to avoid thatā€¦

[root@srv01 ~]# yum remove nodejs
Loaded plugins: changelog, fastestmirror, nethserver_events
Resolving Dependencies
ā†’ Running transaction check
ā€”> Package nodejs.x86_64 1:6.14.3-1.el7 will be erased
ā†’ Processing Dependency: nodejs >= 8.0.0 for package: onlyoffice-documentserver-5.2.3-64.x86_64
ā†’ Processing Dependency: nodejs = 1:6.14.3-1.el7 for package: 1:npm-3.10.10-1.6.14.3.1.el7.x86_64
ā†’ Running transaction check
ā€”> Package npm.x86_64 1:3.10.10-1.6.14.3.1.el7 will be erased
ā€”> Package onlyoffice-documentserver.x86_64 0:5.2.3-64 will be erased
ā†’ Processing Dependency: onlyoffice-documentserver for package: nethserver-onlyoffice-0.0.1-4.ns7.noarch
ā†’ Running transaction check
ā€”> Package nethserver-onlyoffice.noarch 0:0.0.1-4.ns7 will be erased
ā†’ Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================
Package Arch Version Repository Size

Removing:
nodejs x86_64 1:6.14.3-1.el7 @epel 16 M
Removing for dependencies:
nethserver-onlyoffice noarch 0.0.1-4.ns7 @mrmarkuz 8.2 k
npm x86_64 1:3.10.10-1.6.14.3.1.el7 @epel 9.8 M
onlyoffice-documentserver x86_64 5.2.3-64 installed 759 M

Transaction Summary

Remove 1 Package (+3 Dependent packages)

Actually doing the same procedure on another serverā€¦

Iā€™ll leave you to it for now. Let it sink in :wink:

Thanks!

1 Like

For me it works with nodejs 8 without high CPU load. Thanks for pointing that out.

I updated the module and the wiki entry to support installation of nodejs 8:

https://wiki.nethserver.org/doku.php?id=onlyoffice#install_nodejs_repo

If you still have an high load, just disable the systemd unit which spawn the dictionary module :wink:
Iā€™ve already done it on a test machine, but I donā€™t remember the unit name.

1 Like

I can confirm. CPU load dropped drastically and no more nodejs errors in the log files. And as a bonus, the spellchecker is now functional :wink:

Many thanks.

1 Like