streamnative / pulsar-archived

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org
Apache License 2.0
72 stars 25 forks source link

ISSUE-9731: Pulsar C++ Client Library not working on Alpine Linux #2220

Open sijie opened 3 years ago

sijie commented 3 years ago

Original Issue: apache/pulsar#9731


Describe the bug Pulsar C++ Client Library not working on Alpine Linux, not able to run example scripts using pulsar-client(npm/yarn) in docker container built based on alpine linux image.

hostname # node node_modules/pulsar-client/examples/consumer /mars/node_modules/bindings/bindings.js:121 throw e; ^

Error: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/lib/libpulsar.so.2.7.0) at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at bindings (/mars/node_modules/bindings/bindings.js:112:48) at Object. (/mars/node_modules/pulsar-client/index.js:20:42) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32)

Desktop (please complete the following information):

ldd musl libc (x86_64) Version 1.1.24 Dynamic Program Loader Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname

ludusrusso commented 3 years ago

I've also having this issue! Trying to add the missing library using apk add gcompat but then when I import pulsar-client node crashes in segmentation fault:

Welcome to Node.js v14.15.1.
Type ".help" for more information.
> const pulsar = require('pulsar-client');
Segmentation fault

any help?