Can't get to work on Alpine Linux due to relocation error

See original GitHub issue

I’m trying to install aerospike-client-nodejs on Alpine Linux, using C library built from source, but it fails due to a mysterious relocation error. Please help me figure this one out!

The below Dockerfile reproduces the error (given a package.json file in the current directory):

FROM node:10-alpine
MAINTAINER Me

WORKDIR /app

ENV PREFIX=/opt/aerospike-client-c

RUN apk add --no-cache python2 make gcc g++ git libtool autoconf automake linux-headers \
openssl-dev zlib-dev libuv-dev

RUN git clone https://github.com/aerospike/aerospike-client-c.git && cd aerospike-client-c && \
git submodule update --init && \
make EVENT_LIB=libuv && \
mv target/* /opt/aerospike-client-c

COPY package.json .

RUN npm install aerospike
RUN node -e "require('aerospike')"

You should see an error like

/app/node_modules/bindings/bindings.js:88
        throw e
        ^

Error: Error relocating /app/node_modules/aerospike/build/Release/aerospike.node: sk_free: symbol not found
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at bindings (/app/node_modules/bindings/bindings.js:81:44)
    at Object.<anonymous> (/app/node_modules/aerospike/lib/aerospike.js:19:31)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
jheckingcommented, Nov 9, 2018

This issue is fixed in v3.7.2. I was able to build an Alpine Linux docker image using this slightly modified Dockerfile:

FROM node:10-alpine
MAINTAINER Me

WORKDIR /app

RUN apk add --no-cache python2 make gcc g++ git libtool autoconf automake linux-headers \
openssl-dev zlib-dev libuv-dev

RUN git clone https://github.com/aerospike/aerospike-client-c.git && \
  cd aerospike-client-c && \
  git checkout --detach 4.3.20 && \
  git submodule update --init && \
  make EVENT_LIB=libuv

ENV PREFIX=/app/aerospike-client-c/target/Linux-x86_64

RUN npm install aerospike@3.7.2
RUN node -e "require('aerospike')"

Note the extra step git checkout --detach 4.3.20 in the C client build instructions. This is to ensure the right version of the C client is used for the given Node.js client version.

1reaction
jheckingcommented, Nov 1, 2018

@aknuds1, thanks for the PR!

The good news is that I have talked to our C client developer, and he will fix the issues with the C client on Alpine Linux, incl. the pthread_attr_setaffinity_np function dependency. (Apparently, there is a different way to set CPU affinity on Alpine Linux.)

The bad news is that we’ll probably see a new C client release only next week. Once that’s done, I can update the Node.js client to include the fixed C client version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error relocating /usr/bin/node ...
Error relocating /usr/bin/node: nghttp2_option_set_max_settings: symbol not found. Workaround was to add nghttp2-dev package expicitly.
Read more >
Alpine Linux: Error relocating libsudo_util.so.0 (sudo doesn't ...
I installed sudo to not having to use root all the time but after setting it up. Error relocating libsudo_util.so.0: reallocarray: symbol ...
Read more >
Error relocating - building docker-fpm-alpine image
The solution was changing: http://dl-cdn.alpinelinux.org/alpine/edge/main.
Read more >
Troubleshooting Amazon OpenSearch Service
... VPC accessStuck at loading after creating VPC domainDenied requests to the OpenSearch APICan't connect from Alpine LinuxCertificate error when using SDK ...
Read more >
Failed to install on Alpine linux - VMware Communities
I cannot setup BitRock installer in Alpine Docker container. Error relocating /opt/bitrock/installbuilder-20.1.0-linux-x64-installer.run: isnan: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found