Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbol lookup error undefined symbol: _ZN4node19GetCurrentEventLoopEPN2v87IsolateE #656

Closed
morgan92333 opened this issue Sep 28, 2018 · 19 comments

Comments

@morgan92333
Copy link

morgan92333 commented Sep 28, 2018

I installed [email protected] version for my project. It worked for a while, but now when I start with node command, the program exit with this error:

node app.js
node: symbol lookup error: /var/www/myproject/node_modules/bcrypt/lib/binding/bcrypt_lib.node: undefined symbol: _ZN4node19GetCurrentEventLoopEPN2v87IsolateE

This is the case if I use with nodemon:

nodemon app.js
[nodemon] 1.15.0 [nodemon] to restart at any time, enter rs[nodemon] watching: *.* [nodemon] startingnode app.js /usr/local/bin/node: symbol lookup error: /var/www/myproject/node_modules/bcrypt/lib/binding/bcrypt_lib.node: undefined symbol: _ZN4node19GetCurrentEventLoopEPN2v87IsolateE [nodemon] failed to start process, "node" exec not found [nodemon] Error

If I use

nodejs app.js

Its works

My node version: v8.4.0
My nodejs version v8.11.3

@chandru89new
Copy link

chandru89new commented Sep 30, 2018

+1 on this.

To replicate this:
Node version: 8.9.3 (LTS, stable)
Bcrypt version: 3.0.1

Run any file on node with a bcrypt function (like bcrypt.hash())

Getting this:
node: symbol lookup error: //node_modules/bcrypt/lib/binding/bcrypt_lib.node: undefined symbol: _ZN4node19GetCurrentEventLoopEPN2v87IsolateE

I was able to fix this by downgrading bcrypt to 2.0.0 (but that has a vulnerability so I cant use that on production).

Edit: Running Ubuntu 16.04 (Thanks @agathver)

@recrsn
Copy link
Collaborator

recrsn commented Sep 30, 2018

Please mention the OS

@jvt
Copy link

jvt commented Sep 30, 2018

I'm also seeing this issue on macOS 10.14.

My terminal is outputting:

[1] dyld: lazy symbol binding failed: Symbol not found: __ZN4node19GetCurrentEventLoopEPN2v87IsolateE
[1]   Referenced from: /Users/jt/Documents/Projects/Brainy-Kidz/node_modules/bcrypt/lib/binding/bcrypt_lib.node
[1]   Expected in: flat namespace
[1]
[1] dyld: Symbol not found: __ZN4node19GetCurrentEventLoopEPN2v87IsolateE
[1]   Referenced from: /Users/jt/Documents/Projects/Brainy-Kidz/node_modules/bcrypt/lib/binding/bcrypt_lib.node
[1]   Expected in: flat namespace

@matthieu994
Copy link

matthieu994 commented Oct 1, 2018

Same error with Heroku, but not on local.

2018-10-01T03:59:18.027347+00:00 app[web.1]: node: symbol lookup error: /app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: undefined symbol: _ZN4node19GetCurrentEventLoopEPN2v87IsolateE
2018-10-01T03:59:18.046547+00:00 app[web.1]: npm ERR! file sh
2018-10-01T03:59:18.046983+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-01T03:59:18.047195+00:00 app[web.1]: npm ERR! errno ENOENT
2018-10-01T03:59:18.047395+00:00 app[web.1]: npm ERR! syscall spawn
2018-10-01T03:59:18.048720+00:00 app[web.1]: npm ERR! [email protected] start: `node server`
2018-10-01T03:59:18.048890+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-10-01T03:59:18.049135+00:00 app[web.1]: npm ERR! 

@kirkins
Copy link

kirkins commented Oct 2, 2018

I'm also seeing this on Ubuntu 18.04

@kirkins
Copy link

kirkins commented Oct 2, 2018

Rolling back to 3.0.0 from 3.0.1 fixed it for me.

@yiliang114
Copy link

@kirkins thx npm i -D [email protected] is in effect

@rvpanoz
Copy link

rvpanoz commented Oct 10, 2018

same issue - rolling back to 3.0.0 as @kirkins said fixes the issue.

@recrsn
Copy link
Collaborator

recrsn commented Oct 10, 2018

It's unfortunate that the NodeJS folks broke API in between releases. There is nothing much we can do in this regard.
You can force a recompile using npm rebuild bcrypt --build-from-source

@zelongc
Copy link

zelongc commented Oct 11, 2018

Upgrading my Node engine from 8.9.0 to 8.12.0 solved the problem.

@recrsn recrsn closed this as completed Oct 18, 2018
smolijar added a commit to AckeeCZ/desmond that referenced this issue Oct 19, 2018
apporx > 8 && < 8.12 has issues with bcrypt
see: kelektiv/node.bcrypt.js#656
noahsw added a commit to winsleague/winsleague that referenced this issue Oct 29, 2018
noahsw added a commit to winsleague/winsleague that referenced this issue Oct 29, 2018
@thom-nic
Copy link
Contributor

thom-nic commented Nov 1, 2018

I'm concerned this issue is closed while the problem persists. It may be "NodeJS's fault" however the end result is an unusable build and a breaking change between 3.0.0 and 3.0.1 for certain users.

So, I understand it is w/r/t prebuilt bcrypt, which is built against a specific N-API and something in the API changed (somewhere between 8.9 and 8.12) without node revving the API version (v57.)

I can reproduce with bcrypt 3.0.2 and nodejs 8.9.4, on both MacOS and Linux.

I actually wonder if rolling back to v3.0.0 works for folks because there is no prebuilt package for v3.0.0-node-v57-darwin-x64-unknown (there are prebuilt darwin packages for bcrypt 3.0.1 and 3.0.2.) Or if v3.0.0 was just coincidentally built against an earlier version of node, before the breaking API change.

Adding npm rebuild bcrypt --build-from-source is problematic for folks who then need to update CI scripts to workaround this.

I could suggest, un-publishing the node-v57 prebuilt binaries - it would force the "build-from-source" fallback to always occur when no prebuilt binary is found.

@bpehlert
Copy link

I was having the same issue with my production build through Heroku. Updating my node and npm engines on my package.json file to be the latest versions fixed the problem. Running bcrypt 3.0.4.

@fortunee
Copy link

fortunee commented Apr 6, 2019

I was having the same issue with my production build through Heroku. Updating my node and npm engines on my package.json file to be the latest versions fixed the problem. Running bcrypt 3.0.4.

What versions did you bump them up to? @bpehlert

@bpehlert
Copy link

bpehlert commented Apr 10, 2019 via email

@aslam7
Copy link

aslam7 commented Aug 14, 2019

You can use bcryptjs

@KyrosDigital
Copy link

I think the docker container abernix/meteord:node-8.4.0-base may be using a version of node that causes this issue with bcrypt upon deployment.

I think when we are able to use a version of node that is 12.14.0 or above, we can then start using bcrypt 3.0.7, without the need to downgrade the package version to 3.0.0 when you want to deploy.

This would be ideal.

@ilan-schemoul
Copy link

I'm concerned this issue is closed while the problem persists. It may be "NodeJS's fault" however the end result is an unusable build and a breaking change between 3.0.0 and 3.0.1 for certain users.

So, I understand it is w/r/t prebuilt bcrypt, which is built against a specific N-API and something in the API changed (somewhere between 8.9 and 8.12) without node revving the API version (v57.)

I can reproduce with bcrypt 3.0.2 and nodejs 8.9.4, on both MacOS and Linux.

I actually wonder if rolling back to v3.0.0 works for folks because there is no prebuilt package for v3.0.0-node-v57-darwin-x64-unknown (there are prebuilt darwin packages for bcrypt 3.0.1 and 3.0.2.) Or if v3.0.0 was just coincidentally built against an earlier version of node, before the breaking API change.

Adding npm rebuild bcrypt --build-from-source is problematic for folks who then need to update CI scripts to workaround this.

I could suggest, un-publishing the node-v57 prebuilt binaries - it would force the "build-from-source" fallback to always occur when no prebuilt binary is found.

My production app has crashed because of this. This is especially sneaky that until one user signed in everything worked so I did not see that the app had a bug despite testing after deployment and during my sleep the entire app crashed causing very big troubles to my business.
So if the above suggestion is easy to apply on bcrypt's maintainers'end it would save a lot of unexpected crashing and at very very least update the table in the Readme.md to warn users that they should use bcrypt 3.0.0 with 8.9

@Imran-cse
Copy link

Imran-cse commented Jul 30, 2020

The issue still persists with node v10.16.3 and bcrypt v3.0.8

@kodie
Copy link

kodie commented May 7, 2021

I think the docker container abernix/meteord:node-8.4.0-base may be using a version of node that causes this issue with bcrypt upon deployment.

I think when we are able to use a version of node that is 12.14.0 or above, we can then start using bcrypt 3.0.7, without the need to downgrade the package version to 3.0.0 when you want to deploy.

This would be ideal.

Upgrading my Node engine from 8.9.0 to 8.12.0 solved the problem.

We were using abernix/meteord:node-8.9.0-base in our Meteor.js project, changing that to abernix/meteord:node-8.12.0-base fixed our issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests