Node.js client for the Aerospike database

Overview

Aerospike Node.js Client travis codecov npm downloads

An Aerospike add-on module for Node.js.

The client is compatible with Node.js v8.x, v10.x (LTS), v12.x (LTS), and v14.x (LTS). It supports the following operating systems: CentOS/RHEL 7/8, Debian 8/9/10, Ubuntu 16.04/18.04/20.04, as well as many Linux distributions compatible with one of these OS releases. macOS is also supported. The client port to Windows is a community supported project and suitable for application prototyping and development.

Usage

The following is very simple example how to create, update, read and remove a record using the Aerospike database.

const Aerospike = require('aerospike')

const config = {
  hosts: '192.168.33.10:3000'
}
const key = new Aerospike.Key('test', 'demo', 'demo')

Aerospike.connect(config)
  .then(client => {
    const bins = {
      i: 123,
      s: 'hello',
      b: Buffer.from('world'),
      d: new Aerospike.Double(3.1415),
      g: Aerospike.GeoJSON.Point(103.913, 1.308),
      l: [1, 'a', {x: 'y'}],
      m: {foo: 4, bar: 7}
    }
    const meta = { ttl: 10000 }
    const policy = new Aerospike.WritePolicy({
      exists: Aerospike.policy.exists.CREATE_OR_REPLACE
    })

    return client.put(key, bins, meta, policy)
      .then(() => {
        const ops = [
          Aerospike.operations.incr('i', 1),
          Aerospike.operations.read('i'),
          Aerospike.lists.append('l', 'z'),
          Aerospike.maps.removeByKey('m', 'bar')
        ]

        return client.operate(key, ops)
      })
      .then(result => {
        console.log(result.bins) // => { i: 124, l: 4, m: null }

        return client.get(key)
      })
      .then(record => {
        console.log(record.bins) // => { i: 124,
                                 //      s: 'hello',
                                 //      b: <Buffer 77 6f 72 6c 64>,
                                 //      d: 3.1415,
                                 //      g: '{"type":"Point","coordinates":[103.913,1.308]}',
                                 //      l: [ 1, 'a', { x: 'y' }, 'z' ],
                                 //      m: { foo: 4 } }
      })
      .then(() => client.close())
  })
  .catch(error => {
    console.error('Error: %s [%i]', error.message, error.code)
    if (error.client) {
      error.client.close()
    }
  })

Prerequisites

The Aerospike Node.js client supports all Node.js LTS releases. To download and install the latest stable version of Node.js, visit nodejs.org or use the version that comes bundled with your operating system.

The package includes a native add-on. gcc/g++ v4.8 or newer or clang/clang++ v3.4 or newer are required to build the add-on.

The Aerospike add-on depends on the Aerospike C client library, which is downloaded during package installation. Either the cURL or Wget command line tool is required for this. See "C Client Resolution" below for further information.

The package has the following compile time/run time dependencies:

Library Name Description
libssl
libcrypto Required for RIPEMD160 hash function.
libz Required for (optional) command compression.

CentOS/RHEL

To install library prerequisites via yum:

sudo yum install gcc-c++ openssl-devel zlib-devel

Debian

To install library prerequisites via apt-get:

sudo apt-get install g++ libssl1.0.0 libssl-dev libz-dev

Ubuntu

To install library prerequisites via apt-get:

sudo apt-get install g++ libssl1.0.0 libssl-dev zlib1g-dev

Mac OS X

Before starting with the Aerospike Nodejs Client, please make sure the following prerequisites are met:

  • Mac OS X 10.8 or greater.
  • Xcode 5 or greater.

Openssl library installation in Mac OS X.

$ brew install openssl
$ brew link openssl --force

Windows

See Prerequisites for Aerospike Node.js Client on Windows.

Installation

The Aerospike Node.js client is a Node.js add-on module utilizing the Aerospike C client. The installation will attempt to build the add-on module prior to installation. The build step will resolve the Aerospike C client dependency as described in C Client Resolution.

The Aerospike Node.js client can be installed like any other Node.js module, however we provided the following information for those not so familiar with Node.js modules.

Primer on Node.js Modules

Node.js modules are containers of JavaScript code and a package.json, which defines the module, its dependencies and requirements. Modules are usually installed as dependencies of others Node.js application or module. The modules are installed in the application's node_modules directory, and can be utilized within the program by requiring the module by name.

A module may be installed in global location via the -g flag. The global location is usually reserved for modules that are not directly depended on by an application, but may have executables which you want to be able to call regardless of the application. This is usually the case for tools like tools like npm and mocha.

Installing via npm Registry

Installing via npm Registry is pretty simple and most common install method, as it only involves a single step.

Although the module may be installed globally or locally, we recommend performing local installs.

To install the module as a dependency of your application, run the following from your application's directory:

$ npm install aerospike

In most cases, an application should specify aerospike as a dependency in its package.json.

Once installed, the module can be required in the application:

const Aerospike = require('aerospike')

Installing via Git Repository

The following is relevant for users who have cloned the repository, and want to install it as a dependency of their application.

Installing via Git Repository is slightly different from installing via npm registry, in that you will be referencing the module by path, rather than name.

Although the module may be installed globally or locally, we recommend performing local installs.

Installing Globally

This option required root permissions. This will download the Aerospike C client only once, which will improve the experience of using the module for many users. However, you will need to first install the package globally using root permissions.

Run the following as a user with root permission or using the sudo command:

$ npm install -g <PATH>

Where <PATH> is the path to the Aerospike Node.js client's Git respository is located. This will install the module in a globally accessible location.

To install the module as a dependency of your application, run the following from your application's directory:

$ npm link aerospike

Linking to the module does not require root permission.

Once linked, the module can be required in the application:

const Aerospike = require('aerospike')

Installing Locally

This option does not require root permissions to install the module as a dependency of an application. However, it will require resolving the Aerospike C client each time you install the dependency, as it will need to exist local to the application.

To install the module as a dependency of your application, run the following from your application's directory:

$ npm install <PATH>

Where <PATH> is the path to the Aerospike Node.js client's Git respository is located.

Once installed, the module can be required in the application:

const Aerospike = require('aerospike')

C Client Resolution

When running npm install, npm link or node-gyp rebuild, the .gyp script will run scripts/aerospike-client-c.sh to resolve the C client dependency.

The script will check for the following files in the search paths:

  • lib/libaerospike.a
  • include/aerospike/aerospike.h

By default, the search paths are:

  • ./aerospike-client-c
  • /usr

If neither are found, then it will download the C client and create the ./aerospike-client-c directory.

You can modify the C client resolution via:

Force Download

To force downloading of the C client, you can specify the DOWNLOAD=1 environment variable. Example:

$ DOWNLOAD=1 npm install

Custom Search Path

If you have the Aerospike C client installed in a non-standard location or built from source, then you can specify the search path for the build step to use while resolving the Aerospike C client library.

Use the AEROSPIKE_C_LIB_PATH=<PATH> environment variable to specify the search path for the Aerospike C client. The <PATH> must be the path to a directory containing lib and include subdirectories.

The following is an example of specifying the path to the Aerospike C client build directory:

$ export AEROSPIKE_C_LIB_PATH=~/aerospike-client-c/target/Linux-x86_64

Documentation

Detailed documentation of the client's API can be found at http://www.aerospike.com/apidocs/nodejs. This documentation is build from the client's source using JSDocs v3 for every release.

The API docs also contain a few basic tutorials:

A variety of additional example applications are provided in the examples directory of this repository.

Backward incompatible API changes by release are documented at https://www.aerospike.com/docs/client/nodejs/usage/incompatible.html.

API Versioning

The Aerospike Node.js client library follows semantic versioning. Changes which break backwards compatibility will be indicated by an increase in the major version number. Minor and patch releases, which increment only the second and third version number, will always be backwards compatible.

Tests

The client includes a comprehensive test suite using Mocha. The tests can be found in the 'test' directory.

Before running the tests, you need to update the dependencies:

$ npm update

To run all the test cases:

$ npm test

To run the tests and also report on test coverage:

$ npm run coverage

Benchmarks

Benchmark utilies are provided in the benchmarks directory. See the benchmarks/README.md for details.

License

The Aerospike Node.js Client is made available under the terms of the Apache License, Version 2, as stated in the file LICENSE.

Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.

Comments
  • Discussion: error first callbacks, API changes

    Discussion: error first callbacks, API changes

    As per discussion on #11 and short email correspondence with Alvin R. of Aerospike, I want to propose some API changes. Those might be friendlier to the node developer as it adopts error-firstcallbacks being null on success and generally rather resemble other DB interfaces.

    Motivation: The DB is awesome, but the client's API is hard to teach and kind of verbose.

    Since porting the tests will take a while I wanted to have the discussion and proposal before the effective PR. However afterwards the API should look like the below, with the library changes below that.

    'use strict'
    const Aerospike = require('./lib/aerospike')
    
    let config = {
      hosts: [
        { addr: '127.0.0.1', port: 3000 }
      ]
    }
    
    Aerospike.connect(config, function (err) {
      if (err) {
        console.log(err);
      }
    
      var key = Aerospike.key('test','demo','foo');
      console.log(key);
    
      var bins = { i : 123, s : "str"};
      var metadata = {ttl : 10000, gen: 1};
    
      Aerospike.put(key, bins, metadata, function(err, key) {
        if (err) {
          console.log('put error:', err);
        }
    
        Aerospike.get(key, function(err, rec, meta) {
          if (err) {
            console.log('get error:', err);
          }
          console.log(rec, meta);
        });
      });
    })
    

    It's fairly easy to port this with the current cpp layer below.

    var as = require('../build/Release/aerospike.node')
    
    function Aerospike () {
      this.key = as.key,
      this.status = as.status,
      this.status_ok = this.status.AEROSPIKE_OK,
      this.policy = as.policy,
      this.language = as.language,
      this.log = as.log,
      this.scanPriority = as.scanPriority,
      this.predicates = as.predicates,
      this.indexType = as.indexType,
      this.scanStatus = as.scanStatus,
      this.Double = as.Double
    
      this._currentClient = {}
      this.proto = {}
    }
    
    Aerospike.prototype._client = function client (config) {
      let client = as.client(config)
      if (client === null) {
        throw new Error('Client object creation failed - null value returned')
      }
    
      this.proto = Object.getPrototypeOf(client)
    
      // TODO: implement subclases
      // if (!proto.createQuery) {
      //   proto.createQuery = proto.query
      //   proto.query = query
      // }
    
      // if (!proto.createIntegerIndex) {
      //   proto.createIntegerIndex = createIntegerIndex
      // }
      //
      // if (!proto.createStringIndex) {
      //   proto.createStringIndex = createStringIndex
      // }
      //
      // if (!proto.createGeo2DSphereIndex) {
      //   proto.createGeo2DSphereIndex = createGeo2DSphereIndex
      // }
      //
      // if (!proto.LargeList) {
      //   proto.LargeList = LargeList
      // }
      //
      // if (!proto.add) {
      //   proto.add = add
      // }
      //
      // if (!proto.append) {
      //   proto.append = append
      // }
      //
      // if (!proto.prepend) {
      //   proto.prepend = prepend
      // }
    
      return client
    }
    
    Aerospike.prototype.connect = function connect (config, cb) {
      const status_ok = this.status_ok
      this._currentClient = this._client(config)
    
      this._currentClient.connect(function connectCb (er) {
        if (er.code != status_ok) {
          return cb(er)
        }
    
        return cb(null)
      })
    }
    
    Aerospike.prototype.get = function get (key, policy, cb) {
      const status_ok = this.status_ok
    
      if (typeof policy === 'function') cb = policy
    
      this._currentClient.get(key, policy, function getCb (er, record, metadata) {
    
        if (er.code != status_ok) {
          return cb(er)
        }
    
        return cb(null, record, metadata)
      })
    }
    
    Aerospike.prototype.put = function put (key, record, metadata, policy, cb) {
      const status_ok = this.status_ok
    
      if (typeof policy === 'function') cb = policy
    
      this._currentClient.put(key, record, metadata, policy, function putCb (er, key) {
    
        if (er.code != status_ok) {
          return cb(er)
        }
    
        return cb(null, key)
      })
    }
    
    module.exports = new Aerospike()
    
    opened by eljefedelrodeodeljefe 30
  • Max node/event loop [...] async connections would be exceeded: 300

    Max node/event loop [...] async connections would be exceeded: 300

    I'm getting the error Unhandled rejection AerospikeError: Max node/event loop [...] async connections would be exceeded: 300 on scan operations. How can I overwrite this limit or fix the problem?

    enhancement 
    opened by akyoto 26
  • Randomly getting AEROSPIKE_ERR_TIMEOUT

    Randomly getting AEROSPIKE_ERR_TIMEOUT

    Unhandled rejection AerospikeError: AEROSPIKE_ERR_TIMEOUT
        at Function.AerospikeError.fromASError (/home/eduard/node_modules/aerospike/lib/aerospike_error.js:113:10)
        at Client.DefaultCallbackHandler [as callbackHandler] (/home/eduard/node_modules/aerospike/lib/client.js:71:72)
        at putCb (/home/eduard/node_modules/aerospike/lib/client.js:1247:10)
    Unhandled rejection AerospikeError: AEROSPIKE_ERR_TIMEOUT
        at Function.AerospikeError.fromASError (/home/eduard/node_modules/aerospike/lib/aerospike_error.js:113:10)
        at Client.DefaultCallbackHandler [as callbackHandler] (/home/eduard/node_modules/aerospike/lib/client.js:71:72)
        at putCb (/home/eduard/node_modules/aerospike/lib/client.js:1247:10)
    Unhandled rejection AerospikeError: AEROSPIKE_ERR_TIMEOUT
        at Function.AerospikeError.fromASError (/home/eduard/node_modules/aerospike/lib/aerospike_error.js:113:10)
        at Client.DefaultCallbackHandler [as callbackHandler] (/home/eduard/node_modules/aerospike/lib/client.js:71:72)
        at /home/eduard/node_modules/aerospike/lib/client.js:836:10
    

    I get about 560 of the first error message at once, sometimes. Here's my config:

    Aerospike.client({
        hosts: [{
            addr: '127.0.0.1',
            port: 3000
        }],
        log: {
            level: Aerospike.log.WARN
        },
        policies: {
            timeout: 5000
        },
        maxConnsPerNode: 1024
    })
    
    namespace live {
        replication-factor 2
        memory-size 500M
        storage-engine device {
            file /home/eduard/db/db.dat
            filesize 2G
            data-in-memory true
            post-write-queue 1
        }
    }
    

    DB and client are on the same machine (server 3.9.0.3, node client 2.3.1). I can provide more information if needed. Is there anything I can do to fix these timeouts?

    opened by akyoto 22
  • Synchronous error callback in query command causes

    Synchronous error callback in query command causes "unspecified" error in record stream

    In our test code we are using AS.query and on error it gives a complete halt of system.

    events.js:146
          throw err;
          ^
    
    Error: Uncaught, unspecified "error" event. ([object Object])
        at RecordStream.emit (events.js:144:17)
        at /home/ec2-user/testcode/node_modules/aerospike/lib/query.js:315:14
        at Query.foreach (/home/ec2-user/testcode/node_modules/aerospike/lib/query.js:313:11)
        at async.parallel.datasearch (/home/ec2-user/testcode/webnew.js:2301:27)
        at /home/ec2-user/testcode/node_modules/async/dist/async.js:3671:13
        at replenish (/home/ec2-user/testcode/node_modules/async/dist/async.js:884:21)
        at iterateeCallback (/home/ec2-user/testcode/node_modules/async/dist/async.js:869:21)
        at /home/ec2-user/testcode/node_modules/async/dist/async.js:847:20
        at /home/ec2-user/testcode/node_modules/async/dist/async.js:3676:17
        at /home/ec2-user/testcode/node_modules/async/dist/async.js:339:31
    
    bug 
    opened by blaazetech 20
  • make the cline build on alpine linux (musl libc)

    make the cline build on alpine linux (musl libc)

    Installed bash, python, alpine-sdk and clang on alpine linux docker image with nodejs and npm ~ # node -v v5.9.1 ~ # npm -v 3.8.3 with bash-4.3# cat /etc/issue debian bash-4.3# cat /etc/debian_version 7.0 I was able to build it with CC=/usr/bin/clang CXX=/usr/bin/clang++ but then ldd would result in

    bash-4.3# ldd ./build/Release/aerospike.node ldd (0x556f03bcb000) libc.musl-x86_64.so.1 => ldd (0x556f03bcb000) Error relocating ./build/Release/aerospike.node: _ZN2v86Object3GetEj: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v82V88MakeWeakEPPNS_8internal6ObjectEPvPFvRKNS_16WeakCallbackDataINS_5ValueEvEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object16SetInternalFieldEiNS_5LocalINS_5ValueEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v87Isolate17GetCurrentContextEv: symbol not found Error relocating ./build/Release/aerospike.node: __strndup: symbol not found Error relocating ./build/Release/aerospike.node: ZN2v86Object3SetENS_5LocalINS_5ValueEEES3: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v816FunctionTemplate17PrototypeTemplateEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v88Template3SetENS_5LocalINS_4NameEEENS1_INS_4DataEEENS_17PropertyAttributeE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86String11NewFromUtf8EPNS_7IsolateEPKcNS_13NewStringTypeEi: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value9ToIntegerENS_5LocalINS_7ContextEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v814ObjectTemplate21SetInternalFieldCountEi: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object3GetENS_5LocalINS_5ValueEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Number3NewEPNS_7IsolateEd: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v87Isolate14ThrowExceptionENS_5LocalINS_5ValueEEE: symbol not found Error relocating ./build/Release/aerospike.node: RAND_bytes: symbol not found Error relocating ./build/Release/aerospike.node: _ZN4node12MakeCallbackEPN2v87IsolateENS0_5LocalINS0_6ObjectEEENS3_INS0_8FunctionEEEiPNS3_INS0_5ValueEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object3SetEjNS_5LocalINS_5ValueEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object3HasENS_5LocalINS_5ValueEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN4node6Buffer6LengthEN2v85LocalINS1_6ObjectEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v82V812ToLocalEmptyEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value12BooleanValueEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v89Signature3NewEPNS_7IsolateENS_5LocalINS_16FunctionTemplateEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v88Function11NewInstanceEiPNS_5LocalINS_5ValueEEE: symbol not found Error relocating ./build/Release/aerospike.node: _Znwm: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value7IsArrayEv: symbol not found Error relocating ./build/Release/aerospike.node: uv_close: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v86Uint325ValueEv: symbol not found Error relocating ./build/Release/aerospike.node: node_module_register: symbol not found Error relocating ./build/Release/aerospike.node: SHA1: symbol not found Error relocating ./build/Release/aerospike.node: _ZN4node14FatalExceptionEPN2v87IsolateERKNS0_8TryCatchE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v88TryCatch9HasCaughtEv: symbol not found Error relocating ./build/Release/aerospike.node: uv_async_init: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v87Integer15NewFromUnsignedEPNS_7IsolateEj: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v814ObjectTemplate11SetAccessorENS_5LocalINS_4NameEEEPFvS3_RKNS_20PropertyCallbackInfoINS_5ValueEEEEPFvS3_NS1_IS5_EERKNS4_IvEEESB_NS_13AccessControlENS_17PropertyAttributeENS1_INS_17AccessorSignatureEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v82V89ClearWeakEPPNS_8internal6ObjectE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object18GetConstructorNameEv: symbol not found Error relocating ./build/Release/aerospike.node: RIPEMD160_Init: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object20SlowGetInternalFieldEi: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v811HandleScopeD2Ev: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v82V818GlobalizeReferenceEPNS_8internal7IsolateEPPNS1_6ObjectE: symbol not found Error relocating ./build/Release/aerospike.node: compressBound: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value8IsUint32Ev: symbol not found Error relocating ./build/Release/aerospike.node: _ZN4node6Buffer11HasInstanceEN2v85LocalINS1_5ValueEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v814ObjectTemplate11NewInstanceENS_5LocalINS_7ContextEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v811HandleScopeC1EPNS_7IsolateE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value9ToBooleanENS_5LocalINS_7ContextEEE: symbol not found Error relocating ./build/Release/aerospike.node: RIPEMD160_Update: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v811HandleScope12CreateHandleEPNS_8internal7IsolateEPNS1_6ObjectE: symbol not found Error relocating ./build/Release/aerospike.node: RIPEMD160_Final: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value8IsObjectEv: symbol not found Error relocating ./build/Release/aerospike.node: uv_queue_work: symbol not found Error relocating ./build/Release/aerospike.node: _ZN4node6Buffer4CopyEPN2v87IsolateEPKcm: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v87Integer5ValueEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object3NewEPNS_7IsolateE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v88Function7SetNameENS_5LocalINS_6StringEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object38SlowGetAlignedPointerFromInternalFieldEi: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value12IntegerValueEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZNSt8ios_base4InitC1Ev: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v820EscapableHandleScope6EscapeEPPNS_8internal6ObjectE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object32SetAlignedPointerInInternalFieldEiPv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v814ObjectTemplate3NewEPNS_7IsolateENS_5LocalINS_16FunctionTemplateEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v87Integer3NewEPNS_7IsolateEi: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEi: symbol not found Error relocating ./build/Release/aerospike.node: uv_async_send: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v816FunctionTemplate16InstanceTemplateEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN4node6Buffer4DataEN2v85LocalINS1_6ObjectEEE: symbol not found Error relocating ./build/Release/aerospike.node: pthread_rwlockattr_setkind_np: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value7IsInt32Ev: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v816FunctionTemplate12SetClassNameENS_5LocalINS_6StringEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object18InternalFieldCountEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value11NumberValueEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value10IsFunctionEv: symbol not found Error relocating ./build/Release/aerospike.node: RAND_seed: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86Object19GetOwnPropertyNamesEv: symbol not found Error relocating ./build/Release/aerospike.node: RIPEMD160: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v86Number5ValueEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v816FunctionTemplate11GetFunctionEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value8ToUint32ENS_5LocalINS_7ContextEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value9IsBooleanEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZdlPv: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value8IsNumberEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value8ToStringENS_5LocalINS_7ContextEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v87Isolate10GetCurrentEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86String9Utf8ValueC1ENS_5LocalINS_5ValueEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v87Context6GlobalEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v89Exception5ErrorENS_5LocalINS_6StringEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v816FunctionTemplate11GetFunctionENS_5LocalINS_7ContextEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v87Boolean5ValueEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value8ToNumberENS_5LocalINS_7ContextEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value8ToObjectENS_5LocalINS_7ContextEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v88External3NewEPNS_7IsolateEPv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v820EscapableHandleScopeC1EPNS_7IsolateE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Array6LengthEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v88TryCatchC1EPNS_7IsolateE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Value7ToInt32ENS_5LocalINS_7ContextEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v86String6LengthEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v85Array3NewEPNS_7IsolateEi: symbol not found Error relocating ./build/Release/aerospike.node: uv_default_loop: symbol not found Error relocating ./build/Release/aerospike.node: compress2: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v88External5ValueEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v88TryCatchD1Ev: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v811HandleScopeD1Ev: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v811HandleScope12CreateHandleEPNS_8internal10HeapObjectEPNS1_6ObjectE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNK2v85Int325ValueEv: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v82V813DisposeGlobalEPPNS_8internal6ObjectE: symbol not found Error relocating ./build/Release/aerospike.node: _ZN2v86String9Utf8ValueD1Ev: symbol not found Error relocating ./build/Release/aerospike.node: _ZN4node6Buffer11HasInstanceEN2v85LocalINS1_6ObjectEEE: symbol not found Error relocating ./build/Release/aerospike.node: _ZNSt8ios_base4InitD1Ev: symbol not found

    Can you please try to make it to work on alpine linux?

    opened by dmytroleonenko 20
  • segmentation fault

    segmentation fault

    I have segfaults in client on high load (bin content is map object like {key1: timestamp, key2: timestamp, ...}): #0 0x00007ffff6c5ead0 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007ffff6c60146 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007ffff6c62c95 in malloc () from /lib/x86_64-linux-gnu/libc.so.6 #3 0x00007ffff7783ded in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #4 0x00007ffff6994343 in prepare (args=...) at ../src/main/client/put.cc:88 #5 0x00007ffff699905b in async_invoke (args=..., prepare=0x7ffff69942d0 <prepare(v8::Arguments const&)>, execute=0x7ffff6994140 <execute(uv_work_t*)>, respond=0x7ffff6993e70 <respond(uv_work_t*, int)>) at ../src/main/util/async.cc:37 #6 0x00007ffff6994c1e in AerospikeClient::Put (args=...) at ../src/main/client/put.cc:290 #7 0x00003f02aad1ad99 in ?? () #8 0x00007fffffffaad8 in ?? () #9 0x00007fffffffaaf0 in ?? () #10 0x0000000000000003 in ?? () #11 0x0000000000000000 in ?? ()


    #0 0x00007ffff6c5ead0 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007ffff6c60146 in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x00007ffff6c62c95 in malloc () from /lib/x86_64-linux-gnu/libc.so.6 #3 0x00007ffff7783ded in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #4 0x00007ffff6995a98 in prepare (args=...) at ../src/main/client/select.cc:90 #5 0x00007ffff699905b in async_invoke (args=..., prepare=0x7ffff6995a30 <prepare(v8::Arguments const&)>, execute=0x7ffff69958e0 <execute(uv_work_t*)>, respond=0x7ffff6995620 <respond(uv_work_t*, int)>) at ../src/main/util/async.cc:37 #6 0x00007ffff699630e in AerospikeClient::Select (args=...) at ../src/main/client/select.cc:294 #7 0x0000392b8fe53339 in ?? () #8 0x00007fffffffde98 in ?? () #9 0x00007fffffffdeb0 in ?? () #10 0x0000000000000003 in ?? () #11 0x0000000000000000 in ?? ()

    opened by Hamper 20
  • Please include the C client in this package instead of downloading it on every rebuild

    Please include the C client in this package instead of downloading it on every rebuild

    Otherwise you are forcing me to download this package on every deploy. If I can not download the package I can not deploy :( For production environmensts you usually do:

    $ npm install --ignore-scripts
    $ git add node_modules
    $ git commit -m 'deps'
    

    Then in production just build your stuff. No downloads!

    $ npm rebuild
    

    With this module that can not be done because on npm rebuild it downloads the C client from aerospike. Therefore, if the aerospike site is down I can not deploy.

    http://www.letscodejavascript.com/v3/blog/2014/03/the_npm_debacle

    I discovered that becasue today my travis test are failing due a connectivity error with aeropspike site.

    $ wget -O aerospike-server.tgz http://aerospike.com/download/server/latest/artifact/tgz
    --2015-09-22 07:25:07--  http://aerospike.com/download/server/latest/artifact/tgz
    Resolving aerospike.com (aerospike.com)... 184.168.221.29
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:26:11--  (try: 2)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:27:16--  (try: 3)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:28:22--  (try: 4)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:29:29--  (try: 5)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:30:37--  (try: 6)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:31:46--  (try: 7)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:32:56--  (try: 8)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:34:07--  (try: 9)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:35:19--  (try:10)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:36:32--  (try:11)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:37:45--  (try:12)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... failed: Connection timed out.
    Retrying.
    --2015-09-22 07:38:58--  (try:13)  http://aerospike.com/download/server/latest/artifact/tgz
    Connecting to aerospike.com (aerospike.com)|184.168.221.29|:80... 
    
    wontfix 
    opened by revington 19
  • Docker alpine-10 with aerospike not working

    Docker alpine-10 with aerospike not working

    My docker file is -

    
    MAINTAINER me
    
    RUN mkdir -p /usr/src/app
    
    WORKDIR /usr/src/app
    
    COPY package.json ./
    
    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
    
    RUN npm install
    
    VOLUME ["./logs"]
    
    COPY . .
    
    EXPOSE 9008
    
    CMD [ "npm", "start" ]
    

    On docker build, getting error -

    make: *** [aerospike-client-c.target.mk:17: ebf8c619d512e7a1a724a0ecb06ec5eec50df7dc.intermediate] Error 1
    rm ebf8c619d512e7a1a724a0ecb06ec5eec50df7dc.intermediate
    make: Leaving directory '/usr/src/app/node_modules/aerospike/build'
    gyp ERR! build error
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
    gyp ERR! System Linux 4.4.0-1077-aws
    gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /usr/src/app/node_modules/aerospike
    gyp ERR! node -v v10.15.3
    gyp ERR! node-gyp -v v3.8.0
    gyp ERR! not ok
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.```
    installation 
    opened by vikasjindal100 16
  • Error installing package using yarn instead of npm

    Error installing package using yarn instead of npm

    I have package.json with "aerospike": "^2.7.2" . I am using mac. Earlier checks [✓] /usr/local/lib/libaerospike.a were getting failed so I installed c client pkg com.aerospike.client.c.4.1.4 on mac as well. Now that error was gone but then following error arise.

    When I run command yarn run upgrade it gives error on aerospike module as follows.

    error /Users/sanketd/Documents/testproject/node_modules/aerospike: Command failed. Exit code: 1 Command: node-gyp rebuild Arguments: Directory: /Users/sanketd/Documents/testproject/node_modules/aerospike Output: gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | darwin | x64 gyp info spawn /usr/bin/python gyp info spawn args [ '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/Users/sanketd/Documents/testproject/node_modules/aerospike/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/sanketd/.node-gyp/8.11.4/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/Users/sanketd/.node-gyp/8.11.4', gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/Users/sanketd/.node-gyp/8.11.4/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/Users/sanketd/Documents/testproject/node_modules/aerospike', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] TOUCH e57f3d8558e9d79f83a1d12ee621e0adf8d6bb11.intermediate ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh e57f3d8558e9d79f83a1d12ee621e0adf8d6bb11.intermediate

    CHECK [✓] /usr/local/lib/libaerospike.a [✓] /usr/local/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 ../src/main/events.cc:48:13: error: unknown type name 'as_cluster_event'; did you mean 'as_cluster_s'? void push(as_cluster_event *event) { ^~~~~~~~~~~~~~~~ as_cluster_s ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: 'as_cluster_s' declared here struct as_cluster_s; ^ ../src/main/events.cc:71:24: error: unknown type name 'as_cluster_event'; did you mean 'as_cluster_s'? Local convert(as_cluster_event *event) { ^~~~~~~~~~~~~~~~ as_cluster_s ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: 'as_cluster_s' declared here struct as_cluster_s; ^ ../src/main/events.cc:43:34: error: unknown type name 'as_cluster_event'; did you mean 'as_cluster_s'? cf_queue_init(&events, sizeof(as_cluster_event), 4, true); ^~~~~~~~~~~~~~~~ as_cluster_s ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: 'as_cluster_s' declared here struct as_cluster_s; ^ ../src/main/events.cc:43:27: error: invalid application of 'sizeof' to an incomplete type 'as_cluster_s' cf_queue_init(&events, sizeof(as_cluster_event), 4, true); ^ ~~~~~~~~~~~~~~~~~~ ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: forward declaration of 'as_cluster_s' struct as_cluster_s; ^ ../src/main/events.cc:51:11: error: member access into incomplete type 'as_cluster_s' event->type, event->node_name, event->node_address); ^ ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: forward declaration of 'as_cluster_s' struct as_cluster_s; ^ ../src/main/events.cc:51:24: error: member access into incomplete type 'as_cluster_s' event->type, event->node_name, event->node_address); ^ ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: forward declaration of 'as_cluster_s' struct as_cluster_s; ^ ../src/main/events.cc:51:42: error: member access into incomplete type 'as_cluster_s' event->type, event->node_name, event->node_address); ^ ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: forward declaration of 'as_cluster_s' struct as_cluster_s; ^ ../src/main/events.cc:55:4: error: unknown type name 'as_cluster_event'; did you mean 'as_cluster_s'? as_cluster_event event; ^~~~~~~~~~~~~~~~ as_cluster_s ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: 'as_cluster_s' declared here struct as_cluster_s; ^ ../src/main/events.cc:55:21: error: variable has incomplete type 'as_cluster_s' as_cluster_event event; ^ ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: forward declaration of 'as_cluster_s' struct as_cluster_s; ^ ../src/main/events.cc:75:17: error: member access into incomplete type 'as_cluster_s' switch (event->type) { ^ ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: forward declaration of 'as_cluster_s' struct as_cluster_s; ^ ../src/main/events.cc:89:20: error: member access into incomplete type 'as_cluster_s' Nan::New(event->node_name).ToLocalChecked()); ^ ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: forward declaration of 'as_cluster_s' struct as_cluster_s; ^ ../src/main/events.cc:91:20: error: member access into incomplete type 'as_cluster_s' Nan::New(event->node_address).ToLocalChecked()); ^ ../aerospike-client-c/include/aerospike/aerospike.h:71:8: note: forward declaration of 'as_cluster_s' struct as_cluster_s; ^ ../src/main/events.cc:104:36: error: unknown type name 'as_cluster_event' static void cluster_event_callback(as_cluster_event *event); ^ ../src/main/events.cc:123:10: error: no member named 'event_callback_udata' in 'as_config_s' config->event_callback_udata = (void *) handle; ~~~~~~ ^ ../src/main/events.cc:124:10: error: no member named 'event_callback' in 'as_config_s' config->event_callback = cluster_event_callback; ~~~~~~ ^ ../src/main/events.cc:131:46: error: no member named 'event_callback_udata' in 'as_config_s' uv_handle_t *async = (uv_handle_t *)config->event_callback_udata; ~~~~~~ ^ ../src/main/events.cc:146:24: error: unknown type name 'as_cluster_event' cluster_event_callback(as_cluster_event *event) ^ 17 errors generated. make: *** [Release/obj.target/aerospike/src/main/events.o] Error 1 rm e57f3d8558e9d79f83a1d12ee621e0adf8d6bb11.intermediate gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Darwin 17.7.0 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/sanketd/Documents/testproject/node_modules/aerospike gyp ERR! node -v v8.11.4 gyp ERR! node-gyp -v v3.8.0

    I am struck on this since 2 days trying to figure out what is going wrong. npm install aerospike works fine.

    installation 
    opened by sanketdhoble 16
  • Server error in Connect command:  [9]

    Server error in Connect command: [9]

    Aerospike Community Edition build 4.3.0.2 (Docker)

    $ docker exec -it db aql
    Seed:         127.0.0.1
    User:         None
    Config File:  /etc/aerospike/astools.conf /root/.aerospike/astools.conf
    Aerospike Query Client
    Version 3.15.3.14
    C Client Version 4.3.12
    Copyright 2012-2017 Aerospike. All rights reserved.
    aql> show namespaces;
    +------------+
    | namespaces |
    +------------+
    | "test"     |
    +------------+
    [127.0.0.1:3000] 1 row in set (0.002 secs)
    
    OK
    
    aql>
    
    $ ncat localhost 3000 -v
    Ncat: Version 7.70 ( https://nmap.org/ncat )
    Ncat: Connected to ::1:3000.
    ^C
    
    let client = Aerospike.client({
      hosts: [
        { addr: "127.0.0.1", port: 3000 }
      ],
      log: {
        level: Aerospike.log.TRACE
      }
    })
    
    client.connect((error) => {
      if (error) {
        console.error('Connection to Aerospike cluster failed!', error);
        process.exit(-1);
      }
    });
    
    npm run start
    
    > [email protected] start /path/to/my/code/api
    > node --experimental-modules index.mjs
    
    (node:24368) ExperimentalWarning: The ESM module loader is experimental.
    Aug 06 2018 16:56:16 UTC: TRACE(24368) [conversions.cc:181] [get_optional_uint32_property] - port => (uint32) 3000
    Aug 06 2018 16:56:16 UTC: TRACE(24368) [conversions.cc:184] [get_optional_uint32_property] - authMode => undefined
    Aug 06 2018 16:56:16 UTC: TRACE(24368) [config.cc:82] [config_from_jsobject] - adding host, addr="127.0.0.1", port=3000
    Aug 06 2018 16:56:16 UTC: DEBUG(24368) [config.cc:161] [config_from_jsobject] - Parsing global policies: success
    Aug 06 2018 16:56:16 UTC: TRACE(24368) [conversions.cc:85] [get_optional_string_property] - systemPath => "/path/to/my/code/api/node_modules/aerospike/modules/lua-core/src"
    Aug 06 2018 16:56:16 UTC: DEBUG(24368) [config.cc:185] [config_from_jsobject] - Using default Lua user path: /usr/local/aerospike/client/usr/udf/lua
    Aug 06 2018 16:56:16 UTC: TRACE(24368) [conversions.cc:184] [get_optional_uint32_property] - connTimeoutMs => undefined
    Aug 06 2018 16:56:16 UTC: TRACE(24368) [conversions.cc:184] [get_optional_uint32_property] - loginTimeoutMs => undefined
    Aug 06 2018 16:56:16 UTC: TRACE(24368) [conversions.cc:184] [get_optional_uint32_property] - tendInterval => undefined
    Aug 06 2018 16:56:16 UTC: TRACE(24368) [conversions.cc:184] [get_optional_uint32_property] - maxConnsPerNode => undefined
    Aug 06 2018 16:56:16 UTC: TRACE(24368) [conversions.cc:184] [get_optional_uint32_property] - maxConnsPerNodeSync => undefined
    Aug 06 2018 16:56:16 UTC: DEBUG(24368) [client.cc:82] [New] - Aerospike client initialized successfully
    Aug 06 2018 16:56:16 UTC: DEBUG(24368) [events.cc:52] [push] - Cluster event 0 triggered by node "BB9020015AC4202" (172.21.0.2:3000)
    Aug 06 2018 16:56:17 UTC: DEBUG(24368) [command.cc:86] [ErrorCallback] - Server error in Connect command:  [9]
    Aug 06 2018 16:56:17 UTC: DEBUG(24368) [command.cc:66] [Callback] - Executing JS callback for Connect command
    Aug 06 2018 16:56:17 UTC: DEBUG(24368) [client.cc:116] [Close] - Closing the connection to aerospike cluster
    Connection to Aerospike cluster failed! { AerospikeError
        at Function.fromASError (/path/to/my/code/api/node_modules/aerospike/lib/error.js:113:19)
        at as_client.connect (/path/to/my/code/api/node_modules/aerospike/lib/client.js:508:28)
        at Client.connect (/path/to/my/code/api/node_modules/aerospike/lib/client.js:507:20)
        at file:///path/to/my/code/api/db/index.mjs:32:8
        at ModuleJob.run (internal/modules/esm/module_job.js:96:12)
      name: 'AerospikeError',
      code: 9,
      command: null,
      func: '',
      file: '',
      line: 0,
      inDoubt: false }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 255
    npm ERR! [email protected] start: `node --experimental-modules index.mjs`
    npm ERR! Exit status 255
    npm ERR!
    npm ERR! Failed at the [email protected] start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     ~/.npm/_logs/2018-08-06T16_56_17_447Z-debug.log
    

    package.json -> "aerospike": "^3.5.0"

    Connection is fine, but it has some issue with Server error in Connect command: [9].

    P.S. Just checked with v3.4.0 - works fine. Looks like regression with nodejs-client v.3.5.0

    bug 
    opened by industral 16
  • "Freeze" node.js process on client.close(false)

    We observed freezing of the node.js process when invoking client.stop(false). The node.js "freezing" is quite fatal and results in the process becoming unresponsive to incoming network connections (and probably internally as well).

    Perhaps this is a pre-condition for the issue to manifest. The only time we ever call client.stop(false) is just after we detect some issues with a client, e.g. a node was removed from the cluster of 3. Then we reconnect.

    Not calling client.stop(false) avoids the "freezing" but obviously leaks the connection associated with the client.

    opened by sempi 16
  • Fix ssl_check.sh

    Fix ssl_check.sh

    What does this PR do? This PR updates the script to check the OpenSSL version and copy files from the appropriate directory.

    Why is this change necessary? The old script used the wrong syntax to extract the first element from the text array, resulting in the incorrect value used in the if statement. This caused the script to execute the else block even when the OpenSSL version was 3.

    The new script extracts the first word from the version string and checks whether it starts with "Libre." It also removes the version number from the second element of the array and splits it into dots to extract the major version number. This allows the script to determine the major version number correctly and whether the version is LibreSSL or OpenSSL.

    How does this PR fix the issue? The PR fixes the issue by using the correct syntax to extract the first element from the text array and extract the major version number from the version string. This allows the script to determine the major version number correctly and whether the version is LibreSSL or OpenSSL, enabling it to copy the files from the appropriate directory.

    Are there any side effects? There should not be any side effects as the changes are limited to the script for checking the OpenSSL version and copying files.

    Other information N/A

    opened by v-anton 0
  • Version 5.1.1 breaks using Docker

    Version 5.1.1 breaks using Docker

    If we use Docker with the latest 5.1.1 version I get the following error - Error: libssl.so.3: cannot open shared object file: No such file or directory

    Everything works well with version 5.0.3

    This looks like an OpenSSL error and I feel like the Aerospike client is expecting OpenSSL v3 while my container uses v1.

    Dockerfile

    FROM node:18-bullseye-slim as base

    WORKDIR /app

    COPY package*.json ./

    RUN apt update -y RUN apt install -y
    openssl
    zlib1g

    FROM base as dev ENV NODE_ENV=development RUN npm install -g nodemon RUN npm install

    COPY . .

    CMD ["nodemon", "index.js"]

    opened by ziyak97 0
  • Update typings

    Update typings

    I have created first version of typings, but it was created with errors, which I haven't seen for some unknown reasons (but my projects are still building with my previous typings 😳) Recently I have decided to update aerospike package in my application, but new typings causes some errors. For example:

    1. I can't initialize client with only "hosts" property, I need to provide all properties, that exists in config interface Code_UyuxGedWSI
    2. I can't normally declare property of my class with "Aerospike Client" - "Client" refers to value (??) Code_pVWQ9lggXY And I don't know if there are more problems with current typings, since I can't even initialize client. Recently @realmgic have pointed me why my typings was removed (btw I have created fork only for using in my project, but it just so happened that I decided to fix my typings). Also I hope, that I have added typings for all new methods, properties, etc. ~~also there are a lot of "any" in current typings 😢~~
    opened by bit0r1n 2
  • Incompatibility between client version 5.0.2 and Ubuntu 18.04

    Incompatibility between client version 5.0.2 and Ubuntu 18.04

    Problem №1 When trying to use the built and redistributable aerospike client binary on ubuntu 18.04, the following error occurs: _Error: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.28' not found (required by /project/node_modules/aerospike/lib/binding/node-v72-linux-x64/aerospike.node )_

    GLIBC_2.28 is a dependency that is only available on Ubuntu 20.04 and above. At the same time, the C client itself should work on 18.04. My guess is that the binaries being distributed were built to target the 20.04 platform (or built on 20.04). Because of this, we are unable to use this library on Ubuntu 18.04. At the same time, when trying to build the client manually and link via npm link, everything works fine on Ubuntu 18.04.

    I have a guess that the build is on Github Actions where ubuntu-latest is used which points to 20.04

    Suggested solution:

    1. Run build binaries on ubuntu-18.04;

    Problem №2 There was an option to work around this issue with npm install [email protected] --build-from-source=aerospike to run the node-gyp build process on installation to build the binaries, but most likely there is a problem in the bash script and an error occurs : _11 25.69 [✗] /project/node_modules/aerospike/libuv-v1.8.0/include/uv.h_ Although libuv is installed globally.

    I see 2 solutions for this problem:

    1. Add logic to download libuv when trying to run npm i with --build-from-source=aerospike flag;
    2. Use libuv which is installed globally;

    Below I will provide docker files that can be used to reproduce the problem:

    1. Trying to use prebuilt binaries;
    2. Trying to build binaries with --build-from-source=aerospike;
    Dockerfile 1
    FROM ubuntu:18.04
    
    RUN apt update && apt install -yq --no-install-recommends \
          build-essential \
          curl \
          wget \
          lsb-release \
          ca-certificates \
          gcc \
          g++ \
          make \
          cmake \
          clang \
          libssl1.0.0 \
          libssl-dev \
          libuv1-dev && \
      rm -rf /var/lib/apt/lists/*
    
    RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
    RUN apt install -y nodejs
    
    WORKDIR project
    RUN npm init -y
    RUN npm install [email protected]
    RUN echo "const aerospike = require('aerospike'); console.log(aerospike);" > index.js
    RUN node index.js
    
    Dockerfile 2
    FROM ubuntu:18.04
    
    RUN apt update && apt install -yq --no-install-recommends \
          build-essential \
          curl \
          wget \
          lsb-release \
          ca-certificates \
          gcc \
          g++ \
          make \
          cmake \
          clang \
          libssl1.0.0 \
          libssl-dev \
          libuv1-dev && \
      rm -rf /var/lib/apt/lists/*
    
    RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
    RUN apt install -y nodejs
    
    WORKDIR project
    RUN npm init -y
    RUN npm install [email protected] --build-from-source=aerospike
    RUN echo "const aerospike = require('aerospike'); console.log(aerospike);" > index.js
    RUN node index.js
    
    opened by xom9ikk 0
  • Not obvious error message when trying to set TTL

    Not obvious error message when trying to set TTL

    I tried to perform a simple put event like client.put(key, bins, { ttl: 1 }); and got an error "AerospikeError: Operation not allowed at this time."

    After debugging I found that the problem was with TTL. I need to set allow-ttl-without-nsup true to change TTL to anything other than 0 and -1. This helped, but the error message is weird - it's very difficult to understand that "operation not allowed at this time" is connected to setting TTL. Could you improve the message, so it would be understandable the actual error? Thanks.

    opened by iblessedi 2
Releases(5.2.0)
  • 5.2.0(Dec 13, 2022)

    • Added support for:
      • Node.js 19
      • Ubuntu 22.04
      • RHEL 9
    • Dropped support for:
      • Node.js 10, 12, 17
      • RHEL 7
      • Debian 8, 9
    • New Features:
      • [CLIENT-2000] - Added ARM architecture support for all currently supported OS systems
    Source code(tar.gz)
    Source code(zip)
  • 5.1.1(Dec 2, 2022)

    • Improvements:
      • [CLIENT-1944] Revamped existing API documentation.
      • [CLIENT-1943] Added documentation for list, map, hll, and bit expressions.
      • [CLIENT-1942] Improved examples within the API documentation.
    Source code(tar.gz)
    Source code(zip)
  • v5.0.3(Jul 14, 2022)

  • v4.0.5(Jul 14, 2022)

  • v5.0.2(Jun 10, 2022)

    • Bug Fixes [CLIENT-1745] Fixed build error identified in Apline 3.15 and Node.js 17.9. [CLIENT-1746] Fixed aerospike/batchType module documentation.
    Source code(tar.gz)
    Source code(zip)
  • v4.0.4(Jun 10, 2022)

  • v5.0.1(May 26, 2022)

    • Bug Fixes [CLIENT-1743] Node.js mac client exits on first database operation (4.00+) [CLIENT-1734] NodeJS client: Typescript file missing in npm package version 4.0.2
    Source code(tar.gz)
    Source code(zip)
  • v4.0.3(May 26, 2022)

    • Bug Fixes [CLIENT-1743] Node.js mac client exits on first database operation (4.00+) [CLIENT-1734] NodeJS client: Typescript file missing in npm package version 4.0.2
    Source code(tar.gz)
    Source code(zip)
  • v5.0.0(May 1, 2022)

    • New Features [CLIENT-1713] - Node.js: Support batch apply command. [CLIENT-1712] - Node.js: Support batch remove operations. [CLIENT-1711] - Node.js: Support batch write operations. [CLIENT-1715] - Node.js: Support query partition. [CLIENT-1714] - Node.js: Support scan partition.

    • Updates BREAKING: Remove deprecated PredicateExpression filtering which has been replaced by new Filter Expressions npm registry includes images for nodejs v17.8.0 and v18.0.0

    Source code(tar.gz)
    Source code(zip)
  • v4.0.2(May 1, 2022)

    • Bug Fixes [CLIENT-1718] - Support failOnClusterChange for query policy

    • Updates npm registry includes images for nodejs v17.8.0 and v18.0.0

    Source code(tar.gz)
    Source code(zip)
  • v4.0.1(Apr 18, 2022)

    • Updates [CLIENT-1703] - Update API Documentation with new Filter Expressions, that have replaced the deprecated PredicateExpression filtering.
    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Mar 16, 2022)

    • New Features

      • [CLIENT-1678] - Support boolean particle type. This feature requires Aerospike server version 5.6+. #428
      • [CLIENT-1679] - Add support for Aerospike Expressions.
      • [CLIENT-1680] - Added TypeScript typings. #446 Thanks to @bit0r1n!
    • Updates

      • BREAKING: This client requires server version 4.9 or later.
      • BREAKING: Drop support for Node.js 8.
      • BREAKING: Remove support for CentOS 6 as well as Ubuntu 16.04.
      • BREAKING: Remove Scan#priority, Scan#percent, and ScanPolicy#failOnClusterChange, as the server no longer supports these fields.
      • Add support for building c-client as a sub-module.
    • Backward Incompatible API Changes

      • totalTimeout Replaced by timeout Info Policy Option New "timeout" InfoPolicy

        const subject = new Aerospike.InfoPolicy({
          timeout: 1000,
          sendAsIs: true,
          checkBounds: false
        })
        

      Deprecated "totalTimeout" InfoPolicy

        const subject = new Aerospike.InfoPolicy({
          totalTimeout: 1000,
          sendAsIs: true,
          checkBounds: false
        })
      
    Source code(tar.gz)
    Source code(zip)
  • v3.16.7(Jan 11, 2022)

  • v3.16.6(Jul 13, 2021)

  • v3.16.5(Apr 14, 2021)

    • Bug Fixes

      • CLIENT-1498: Support infoTimeout on QueryPolicy. The timeout is used when failOnClusterChange is true and an info validation command is sent before/after the query. #412
    • Updates

      • Update C client library to v4.6.21.
    Source code(tar.gz)
    Source code(zip)
  • v3.16.4(Feb 21, 2021)

  • v3.16.3(Feb 9, 2021)

  • v3.16.2(Dec 4, 2020)

    • New Features

      • Support setting tlsname using Host obj. #382
    • Bug Fixes

      • Reverses the breaking change introduced in v3.16.0 of not supporting percent-based scan sampling for server versions 4.9 or later. However, note that scan percent and max_records are mutually exclusive; the client will return an error if both values are set on a scan policy.
      • Query with "failOnClusterChange" causes timeout when using command queue. #389
    • Updates

      • Remove support for ApplyPolicy#gen, which is not supported by the server. #390
      • Update C client library to v4.6.19
      • Clarify docs for HLL ALLOW_FOLD policy #386
      • Fix minhash bits range in docs (4-51, not 4-58). #385
      • Fix spelling of capacity in Command Queue docs. #376 Thanks to @icflournoy!
      • Refactor: Set TTL as part of the touch operation #391
      • Add support for Ubuntu 20.04.
      • Drop support for Ubuntu 14.04.
    Source code(tar.gz)
    Source code(zip)
  • v3.16.1(Jun 30, 2020)

  • v3.16.0(May 18, 2020)

    • New Features

      • Add max records option for sampling with basic scans. Requires server version 4.9 or later. #359
      • Add support for HyperLogLog data type and operations. Requires server version 4.9 or later. #361
      • Add minConnsPerNode and maxSocketIdle client config. #366
    • Updates

      • BREAKING: The client no longer supports the percent-based scan sampling for server versions 4.9 or later. Use the new max records scan policy option instead. See API Changes for details.
      • Update C client library to v4.6.16.
      • Update dependencies with potential vulnerabilities by running npm audit fix. #367
    Source code(tar.gz)
    Source code(zip)
  • v3.15.0(Mar 24, 2020)

  • v3.14.1(Jan 15, 2020)

  • v3.14.0(Jan 8, 2020)

    • New Features

      • Add new delete record operation. Requires server version 4.7 or later (4.7.0.8+ or 4.8.0.3+ recommended). #322
      • Support compressed commands and responses. Requires Aerospike Enterprise Server version 4.8 or later. #335
      • Add per-node opened/closed connection stats. #336
      • Support write operations on background scans & queries. Requires server version 4.7 or later. #338
      • Support new records-per-second limit for scans, replacing scan priority. Requires server version 4.7 or later. #339
      • Add predicate filter support for batch, read, write, delete, and record UDF transactions. Requires server version 4.7 or later. #340
    • Updates

      • Add support for RHEL/CentOS 8.
      • Update C client library to v4.6.10.
      • Minor API document updates. #342
      • Update several dev dependencies to latest version.
    Source code(tar.gz)
    Source code(zip)
  • v3.13.0(Sep 30, 2019)

  • v3.12.0(Aug 31, 2019)

    • New Features

      • Support for operations on nested lists & maps. Requires server version 4.6 or later. #307
    • Updates

      • Update C client library to v4.6.7.
      • Support Debian 10. Drop support for Debian 7.
      • Fix tests for certain out-of-bounds list operations due to changed error code sent by server v4.6.
      • Update dev dependecies: standard v14, yargs v14, nyc
    Source code(tar.gz)
    Source code(zip)
  • v3.11.0(May 22, 2019)

  • v3.10.0(Apr 8, 2019)

    • New Features

      • Support new relaxed read modes for SC namespaces. (via C client v4.6)
      • Use stack based connection pools for more aggressive trimming of idle connections. (via C client v4.6)
    • Updates

      • BREAKING: Read consistency level changes - see Incompatible API Changes for details.
      • Update C client library to v4.6.1.
      • Update nan to v2.13.2.
      • Update mocha, codecov & other dev dependencies to latest version.
    Source code(tar.gz)
    Source code(zip)
  • v3.9.0(Feb 20, 2019)

    • Updates
      • Update C client library to v4.5.0.
      • Update nan to v2.12.1.
      • Update nyc to v13.3 to address multiple potential vulnerabilities in nyc dependencies.
      • Update docs for udfRemove function to document changes in server behavior when trying to delete a UDF module that does not exist.
      • Drop Node.js v4 from the test matrix. The client still runs on Node.js v4 for now, but not all of its dev dependencies do.
    Source code(tar.gz)
    Source code(zip)
  • v3.8.0(Dec 14, 2018)

    • New Features

      • Add support for rack-aware clients.
      • Add client run-time stats.
    • Updates

      • Update C client library to v4.4.0.
      • Remove unused error codes.
      • Improve global command queue docs.
      • Shared memory layout has changed. The default Config#sharedMemory.key has changed to 0xA8000000 so old client applications do not mix shared memory with new client applications. If you are using shared memory clients with a custom shared memory key, it's critical that you change the key when upgrading to this version.
    Source code(tar.gz)
    Source code(zip)
  • v3.7.2(Nov 9, 2018)

    • Bug Fixes

      • Fix Alpine Linux builds #286
      • Fix policies constructor to support setting totalTimeout to zero #289
      • Fix segfault in predexp unit tests on Node.js 11
    • Updates

      • Update C client library to v4.3.20.
      • Replace V8 conversion functions deprecated in Node.js 10.12/11
      • Suppress compiler deprecation warnings for Release builds
      • Add Node.js 10 back to Travis CI test matrix
    Source code(tar.gz)
    Source code(zip)
DolphinDB JavaScript API is a JavaScript library that encapsulates the ability to operate the DolphinDB database, such as: connecting to the database, executing scripts, calling functions, uploading variables, etc.

DolphinDB JavaScript API English | 中文 Overview DolphinDB JavaScript API is a JavaScript library that encapsulates the ability to operate the DolphinDB

DolphinDB 6 Dec 12, 2022
TypeScript client for Tile38 geo-database

Tile38-ts tier.engineering · Report Bug · Request Feature Table of Contents About The Project Built With Getting Started Requirements Installation Com

Tier Mobility SE 22 Dec 29, 2022
🌐 API and CLIENT API for FiveM to externalize database responsibilities.

?? Query API API and CLIENT API for FiveM to externalize database responsibilities. FAQ Is the project finished? Definitely NOT, this is a first versi

Thiago Neubern 2 Jul 5, 2022
⚡️ lowdb is a small local JSON database powered by Lodash (supports Node, Electron and the browser)

Lowdb Small JSON database for Node, Electron and the browser. Powered by Lodash. ⚡ db.get('posts') .push({ id: 1, title: 'lowdb is awesome'}) .wri

null 18.9k Dec 30, 2022
Execute one command (or mount one Node.js middleware) and get an instant high-performance GraphQL API for your PostgreSQL database!

PostGraphile Instant lightning-fast GraphQL API backed primarily by your PostgreSQL database. Highly customisable and extensible thanks to incredibly

Graphile 11.7k Jan 4, 2023
AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.

Please use version 1.x as prior versions has a security flaw if you use user generated data to concat your SQL strings instead of providing them as a

Andrey Gershun 6.1k Jan 9, 2023
The JavaScript Database, for Node.js, nw.js, electron and the browser

The JavaScript Database Embedded persistent or in memory database for Node.js, nw.js, Electron and browsers, 100% JavaScript, no binary dependency. AP

Louis Chatriot 13.2k Jan 2, 2023
Common Database Interface for Node

database-js Wrapper for multiple databases with a JDBC-like connection Database-js implements a common, promise-based interface for SQL database acces

null 57 Dec 3, 2022
jSQL is a locally instantiated database for Node.js

jSQL is a locally instantiated database for Node.js. It provides the functionalities of a database, unique to a single project, meaning that no configuration from one project will affect another one.

Denes Garda 3 Mar 7, 2022
A database library stores JSON file for Node.js.

concisedb English | 简体中文 A database library stores JSON file for Node.js. Here is what updated every version if you want to know. API Document Usage B

LKZ烂裤子 3 Sep 4, 2022
The Blog system developed by nest.js based on node.js and the database orm used typeorm, the development language used TypeScript

考拉的 Nest 实战学习系列 readme 中有很多要说的,今天刚开源还没来及更新,晚些慢慢写,其实本人最近半年多没怎么写后端代码,主要在做低代码和中台么内容,操作的也不是原生数据库而是元数据Meta,文中的原生数据库操作也当作复习下,数据库的操作为了同时适合前端和Node开发小伙伴,所以并不是很

程序员成长指北 148 Dec 22, 2022
A Node.js library for retrieving data from a PostgreSQL database with an interesting query language included.

RefQL A Node.js library for retrieving data from a PostgreSQL database with an interesting query language included. Introduction RefQL is about retrie

Rafael Tureluren 7 Nov 2, 2022
PostgreSQL client for node.js.

node-postgres Non-blocking PostgreSQL client for Node.js. Pure JavaScript and optional native libpq bindings. Monorepo This repo is a monorepo which c

Brian C 10.9k Jan 9, 2023
A pure node.js JavaScript Client implementing the MySQL protocol.

mysql Table of Contents Install Introduction Contributors Sponsors Community Establishing connections Connection options SSL options Connection flags

null 17.6k Jan 1, 2023
🚀 A robust, performance-focused and full-featured Redis client for Node.js.

A robust, performance-focused and full-featured Redis client for Node.js. Supports Redis >= 2.6.12 and (Node.js >= 6). Completely compatible with Redi

Zihua Li 11.6k Jan 8, 2023
Microsoft SQL Server client for Node.js

node-mssql Microsoft SQL Server client for Node.js Supported TDS drivers: Tedious (pure JavaScript - Windows/macOS/Linux, default) Microsoft / Contrib

null 2.1k Jan 4, 2023
Couchbase Node.js Client Library (Official)

Couchbase Node.js Client The Node.js SDK library allows you to connect to a Couchbase cluster from Node.js. It is a native Node.js module and uses the

null 460 Nov 13, 2022
Pulsar Flex is a modern Apache Pulsar client for Node.js, developed to be independent of C++.

PulsarFlex Apache Pulsar® client for Node.js Report Bug · Request Feature About the project Features Usage Contributing About PulsarFlex is a modern A

null 43 Aug 19, 2022
🔄 A realtime Database for JavaScript Applications

RxDB A realtime Database for JavaScript Applications RxDB (short for Reactive Database) is a NoSQL-database for JavaScript Applications like Websites,

Daniel Meyer 18.6k Dec 31, 2022