Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

module sc-uws: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system #2897

Closed
Nerigal opened this issue Feb 16, 2019 · 6 comments

Comments

@Nerigal
Copy link

Nerigal commented Feb 16, 2019

Expected behavior

no WebSockets error i guess

Actual behavior

[ERR] 2019-02-16 05:23:17 | WSEngineInitError: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system. Please install a supported C++11 compiler and reinstall the module 'sc-uws'
at native (/opt/lisk/client/node_modules/sc-uws/uws.js:40:21)
at Object. (/opt/lisk/client/node_modules/sc-uws/uws.js:46:3)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at new SCServer (/opt/lisk/client/node_modules/socketcluster-server/scserver.js:106:54)
at Object.module.exports.attach (/opt/lisk/client/node_modules/socketcluster-server/index.js:65:29)
at /opt/lisk/client/node_modules/socketcluster/scworker.js:202:41
at
at process._tickCallback (internal/process/next_tick.js:189:7)
at Function.Module.runMain (module.js:696:11)
at startup (bootstrap_node.js:204:16)
[ERR] 2019-02-16 05:23:17 | If you are not able to install sc-uws, you can try setting the wsEngine property in config.json to "ws" before starting the node

Steps to reproduce

start lisk using the Linux Binary package

Which version(s) does this affect? (Environment, OS, etc...)

CentOS 7.6
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) ( Default Version )

@Nerigal
Copy link
Author

Nerigal commented Feb 16, 2019

related to this issue but 'sc-uws' insteaed of 'uws'

#1835

@jondubois
Copy link
Contributor

jondubois commented Feb 18, 2019

@Nerigal The uws server was removed from npm by its author a while ago :(

I was maintaining sc-uws for a while but it was a lot of hassle because I had to do a fresh build for all available OSes every time a new major Node.js version was released. So SC and Lisk switched to the ws server by default.

If you change the wsEngine field in your default config file (config/default/config.json) to ws, it should fix the issue. Alternatively, you can try installing the latest C++ compiler on your machine and reinstall your uws/sc-uws from scratch (also you may need to clear the npm cache).

@Nerigal
Copy link
Author

Nerigal commented Feb 18, 2019

@jondubois I know that usw is deprecated but sc-uws which is de the default used in lisk package, as the same issue

If you read the error message carfully, it says If you are not able to install sc-uws, you can try setting the wsEngine property in config.json to "ws" before starting the node

This to me sound like ws is the fallback option, not the good one and related to this,
another Lisk HQ member told me that ws is the old method and does not provide all the performance that sc-uws is capable of

Alternatively, you can try installing the latest C++ compiler on your machine and reinstall your uws/sc-uws from scratch (also you may need to clear the npm cache).

Actually like i said, C++11 ( the version requested by the package sc-uws ) is the default compiler version of CentOS 7 from the default glibc package, even that, i tried up to C++14 from glibc 7 and still had the problem which tell me the compiler is not the real problem

So this is why i liked the issue from uws because the fix is there and look like there is a bug in the 'sc-uws' itself that should be updated upfront before compiling the lisk binary package...

The actual workaround, ( Not a Fix ) is :

yum install zlib-dev
rm -fr <lisk_install_Path>/client/node_modules/sc-uws 
<lisk_install_Path>/client/bin/node <lisk_install_Path>/client/bin/npm install sc-uws

This means there is a new requirement to lisk zlib-dev but the fact that we still need to remove and reinstall sc-uws make me think that there is still an issue from sc-uws package and
if the issue com from sc-uws, The problem will continue to be widespread from lisk packaging.
so that's why i think the sc-uws should be reviewed up front.

@jondubois
Copy link
Contributor

@Nerigal sc-uws was the default at one point but this is no longer the case. See https://github.com/LiskHQ/lisk/blob/development/config/default/config.json#L69 so this issue shouldn't affect new users.

ws is compatible with most systems out of the box so it's a more sensible default.
The issue with the missing zlib-dev dependency is a problem in the uws/sc-uws module. I haven't looked into this problem yet but I'll have a look if get some spare time.

@Nerigal
Copy link
Author

Nerigal commented Feb 19, 2019

Then why the default config is set to sc-uws instead of ws ?

"wsEngine": "sc-uws"

@shuse2
Copy link
Collaborator

shuse2 commented Aug 16, 2019

This is no longer in our package-lock.json and requirements

@shuse2 shuse2 closed this as completed Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants