Problem with nodejs client, external loop capacity

#1

Hi, I am having trouble connecting to aerospike server using nodejs, I got this error:

nodejs: symbol lookup error: /home/xxx/as/node/node_modules/aerospike/build/Release/aerospike.node: undefined symbol: as_event_set_external_loop_capacity

On the same server I have C-client and ruby client that works fine. Do you have any idea where is the problem?

p.s. it is ubuntu 18.04 and install npm install aerospike is fine:

npm install aerospike

> aerospike@3.10.0 install /home/dorijan/as/node/node_modules/aerospike
> node-gyp rebuild

make: Entering directory '/home/dorijan/as/node/node_modules/aerospike/build'
  TOUCH ebf8c619d512e7a1a724a0ecb06ec5eec50df7dc.intermediate
  ACTION binding_gyp_aerospike_client_c_target_Installing_Aerospike_C_Client_dependency ebf8c619d512e7a1a724a0ecb06ec5eec50df7dc.intermediate

CHECK
   [✓] /usr/lib/libaerospike.a
   [✓] /usr/include/aerospike/aerospike.h

  TOUCH Release/obj.target/aerospike-client-c.stamp
  CXX(target) Release/obj.target/aerospike/src/main/aerospike.o
  CXX(target) Release/obj.target/aerospike/src/main/client.o
  CXX(target) Release/obj.target/aerospike/src/main/config.o
  CXX(target) Release/obj.target/aerospike/src/main/events.o
  CXX(target) Release/obj.target/aerospike/src/main/operations.o
  CXX(target) Release/obj.target/aerospike/src/main/policy.o
  CXX(target) Release/obj.target/aerospike/src/main/query.o
  CXX(target) Release/obj.target/aerospike/src/main/scan.o
  CXX(target) Release/obj.target/aerospike/src/main/predexp.o
  CXX(target) Release/obj.target/aerospike/src/main/async.o
  CXX(target) Release/obj.target/aerospike/src/main/command.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/apply_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/batch_exists.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/batch_get.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/batch_select.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/batch_read_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/exists_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/get_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/info.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/info_foreach.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/job_info.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/operate_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/put_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/query_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/query_apply.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/query_background.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/query_foreach.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/remove_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/scan_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/scan_background.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/select_async.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/truncate.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/index_create.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/index_remove.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/udf_register.o
  CXX(target) Release/obj.target/aerospike/src/main/commands/udf_remove.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/predicates.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/maps.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/lists.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/index.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/policy_enum.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/status.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/scanPriority.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/job_status.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/udf_languages.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/ttl.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/config_enum.o
  CXX(target) Release/obj.target/aerospike/src/main/stats.o
  CXX(target) Release/obj.target/aerospike/src/main/util/conversions.o
  CXX(target) Release/obj.target/aerospike/src/main/util/log.o
  SOLINK_MODULE(target) Release/obj.target/aerospike.node
  COPY Release/aerospike.node
rm ebf8c619d512e7a1a724a0ecb06ec5eec50df7dc.intermediate
make: Leaving directory '/home/dorijan/as/node/node_modules/aerospike/build'
#2

The problem is in fact that you have installed the C client library on the same server. When you build the Node.js client, it finds this library in /usr/lib:

[✓] /usr/lib/libaerospike.a

But the C client library you installed was likely not the build with libuv support, which is what the Node.js client requires. That’s why building the Node.js client fails. You can work around this problem by forcing the Node.js client to download it’s own copy of the C client library as part of the build process by setting DOWNLOAD=1 as described here: https://github.com/aerospike/aerospike-client-nodejs/blob/master/README.md.

#3

Thank you, this is the solution, it works now. Dorijan