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

alpine-node docker image and google-cloud equals error loading ld-linux-x86-64.so.2 #8528

Closed
stephenplusplus opened this issue Oct 26, 2016 · 8 comments
Assignees

Comments

@stephenplusplus
Copy link
Member

From @Rich-amoebaWare on October 26, 2016 22:39

  • OS:
    Linux 4.4.20-moby (a docker image from mhart/alpine-node:6.9.1
  • Node.js version:
    6.9.1 (and back to at least 6.7.0)
  • npm version:
    3.10.8
  • google-cloud-node version:
    0.43.0

I started using the google-cloud sdk a few weeks ago and was using the mhart/alpine-node image for its "slenderness". When I introduced google-cloud into my code I went to build my docker file using alpine-node to discover the following error:

module.js:597
return process.dlopen(module, path._makeLong(filename));
^

Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/src/node_modules/google-cloud/node_modules/grpc/src/node/extension_binary/grpc_node.node)
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/src/node_modules/google-cloud/node_modules/grpc/src/node/src/grpc_extension.js:38:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)

npm ERR! Linux 4.4.20-moby
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "test-env"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! enabled@0.4.0 test-env: export NODE_ENV=test&&node index.js
npm ERR! Exit status 1

I switched to using the normal node docker image based on debian and of course I don't get the error and everything works well.

However, I would like to switch back to alpine-node to get rid of all the weight...

How can I fix this error?

Thanks

Copied from original issue: googleapis/google-cloud-node#1754

@murgatroid99
Copy link
Member

The line that's failing, process.dlopen, is the mechanism that Node uses to load native extensions. It looks like your system doesn't support that, and without it, gRPC on Node simply will not work.

@Rich-amoebaWare
Copy link

I did some more investigating...and googling....and got it working. Sorry to have polluted your board. But for posterity...

I found this: http://blog.kontena.io/docker-for-mac-glibc-issues/ which pointed out that Alpine Linux uses musl libraries and by default doesn't have the glibc libraries installed or something like that....so I found a package in the Alpine Linux repository, lib6compat, and installed it when building my docker image based on mhart/alpine-node:6.9.1 and it solved the problem. My node app now works just like with the debian based node image.

@chrisalexander55
Copy link

chrisalexander55 commented Oct 27, 2017

Unfortunately, I am also experiencing this issue with a recent version of Alpine leveraged by official Node.js image: node:8.7.0-alpine. So I don't believe the fix is either live or resolving. Here is the stack I see when building my Docker image:

`[nodemon] starting node dist/server.js
module.js:653
return process.dlopen(module, path._makeLong(filename));
^

Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/app/svc-email-prelaunch/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64/grpc_node.node)
at Object.Module._extensions..node (module.js:653:18)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object. (/usr/app/svc-email-prelaunch/node_modules/grpc/src/node/src/grpc_extension.js:30:15)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
[nodemon] app crashed - waiting for file changes before starting...`

Any recommendations to move forward?

@iraycd
Copy link

iraycd commented Nov 24, 2017

@chrisalexander55 Did you find any solution?

@chrisalexander55
Copy link

chrisalexander55 commented Nov 24, 2017 via email

@kilianc
Copy link

kilianc commented Nov 28, 2017

@chrisalexander55 mind elaborating?

@nicolas-chaulet
Copy link

Same issue here with alpine-node:8, any idea?

@murgatroid99
Copy link
Member

Can you elaborate? What version of gRPC are you using? Are you seeing the same dlopen error?

@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 2018
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

7 participants