Giter Site home page Giter Site logo

aerospike / aerospike-client-nodejs Goto Github PK

View Code? Open in Web Editor NEW
198.0 198.0 77.0 6.52 MB

Node.js client for the Aerospike database

Home Page: https://www.aerospike.com/

License: Apache License 2.0

JavaScript 68.71% Lua 0.06% C++ 25.90% C 1.43% Python 0.42% Shell 0.87% Makefile 0.10% PowerShell 2.51%
aerospike database-driver javascript nodejs nosql

aerospike-client-nodejs's People

Contributors

bit0r1n avatar cstivers78 avatar dependabot[bot] avatar djmax avatar dompeliniaerospike avatar elisawyer avatar eljefedelrodeodeljefe avatar gayathrikaliyamoorthy avatar gimballock avatar greenkeeper[bot] avatar h0lyalg0rithm avatar incsw avatar jhecking avatar ksedgwic avatar leninlin avatar mcoberly2 avatar mrbar42 avatar nallenscott avatar nawara avatar peakji avatar pvinh-spike avatar realmgic avatar revington avatar rpandian-spike avatar ryanwitt avatar snyk-bot avatar srinivasiyer avatar srivarun91 avatar sunilvirus avatar wchu-citrusleaf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aerospike-client-nodejs's Issues

Segmentation fault (core dumped)

I just got a situation where my key is undefined then instead of sending me error code it crashes the entire http server.

aeroclient.get({ns:  "test", set: 'ran', key: undefined} , function(err , result){

if(err.code !=0){

    console.log('err in aerospike  :' ,err.message)
}else{
 doNextThing();

}):

This is the entire stacktrace

Node version : 0.10.28
Server : EC2( ubuntu 12.04)
Aerospike Npm : 1.0.12

err in aerospike : AEROSPIKE_ERR_REQUEST_INVALID
*** glibc detected *** node: free(): invalid pointer: 0x00000000013c7b00 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f6e8a154b96]
/home/ubuntu/anatrack/node_modules/aerospike/build/Release/aerospike.node(+0x18c48)[0x7f6e82191c48]
node(uv__work_done+0xb1)[0x96d351]
node[0x963289]
node[0x963373]
node(uv__io_poll+0x245)[0x9701d5]
node(uv_run+0xd8)[0x963c08]
node(_ZN4node5StartEiPPc+0x130)[0x81c4a0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f6e8a0f776d]
node[0x58d4b1]
======= Memory map: ========
00400000-00bfd000 r-xp 00000000 ca:01 3490 /usr/bin/nodejs
00dfc000-00dfd000 r-xp 007fc000 ca:01 3490 /usr/bin/nodejs
00dfd000-00e12000 rwxp 007fd000 ca:01 3490 /usr/bin/nodejs
00e12000-00e1a000 rwxp 00000000 00:00 0
0137c000-01710000 rwxp 00000000 00:00 0 [heap]
1280f666000-1280f680000 ---p 00000000 00:00 0
1280f680000-1280f6a0000 rwxp 00000000 00:00 0
1280f6a0000-1280f6c6000 ---p 00000000 00:00 0
1d6c5eec000-1d6c5eed000 r-xp 00000000 00:00 0
5391d800000-5391d900000 rwxp 00000000 00:00 0
784d9c0f000-784d9c10000 r-xp 00000000 00:00 0
7dd44000000-7dd44800000 ---p 00000000 00:00 0
7dd44800000-7dd45000000 rwxp 00000000 00:00 0
7dd45000000-7dd45800000 ---p 00000000 00:00 0
7dd45800000-7dd46000000 rwxp 00000000 00:00 0
10bff3900000-10bff3925000 rwxp 00000000 00:00 0
11eadff00000-11eae0000000 rwxp 00000000 00:00 0
150e4cd00000-150e4ce00000 rwxp 00000000 00:00 0
18eabed00000-18eabee00000 rwxp 00000000 00:00 0
1be0c9400000-1be0c9500000 rwxp 00000000 00:00 0
1ec759800000-1ec759900000 rwxp 00000000 00:00 0
20628fc00000-20628fd00000 rwxp 00000000 00:00 0
20e156ae2000-20e156ae3000 r-xp 00000000 00:00 0
23026b900000-23026ba00000 rwxp 00000000 00:00 0
28d136800000-28d136900000 rwxp 00000000 00:00 0
2abde4600000-2abde4700000 rwxp 00000000 00:00 0
2b5714b40000-2b5714b41000 r-xp 00000000 00:00 0
2cda0a100000-2cda0a200000 rwxp 00000000 00:00 0
2db708b00000-2db708b85000 rwxp 00000000 00:00 0
2e3371d00000-2e3371e00000 rwxp 00000000 00:00 0
35a210100000-35a210135000 rwxp 00000000 00:00 0
36f6aeea3000-36f6aef00000 ---p 00000000 00:00 0
36f6aef00000-36f6aef05000 rwxp 00000000 00:00 0
36f6aef05000-36f6aef06000 ---p 00000000 00:00 0
36f6aef06000-36f6aefff000 rwxp 00000000 00:00 0
36f6aefff000-36f6af000000 ---p 00000000 00:00 0
36f6af000000-36f6af005000 rwxp 00000000 00:00 0
36f6af005000-36f6af006000 ---p 00000000 00:00 0
36f6af006000-36f6af0ff000 rwxp 00000000 00:00 0
36f6af0ff000-36f6af100000 ---p 00000000 00:00 0
36f6af100000-36f6af105000 rwxp 00000000 00:00 0
36f6af105000-36f6af106000 ---p 00000000 00:00 0
36f6af106000-36f6af1ff000 rwxp 00000000 00:00 0
36f6af1ff000-36f6af200000 ---p 00000000 00:00 0
36f6af200000-36f6af205000 rwxp 00000000 00:00 0
36f6af205000-36f6af206000 ---p 00000000 00:00 0
36f6af206000-36f6af2ff000 rwxp 00000000 00:00 0
36f6af2ff000-36f6af300000 ---p 00000000 00:00 0
36f6af300000-36f6af305000 rwxp 00000000 00:00 0
36f6af305000-36f6af306000 ---p 00000000 00:00 0
36f6af306000-36f6af3ff000 rwxp 00000000 00:00 0
36f6af3ff000-36f6ceea3000 ---p 00000000 00:00 0
379472444000-379472644000 rwxp 00000000 00:00 0
3867d16aa000-3867d1aaa000 rwxp 00000000 00:00 0
3a9deb7c8000-3a9deb7c9000 r-xp 00000000 00:00 0
3edf2d300000-3edf2d325000 rwxp 00000000 00:00 0
7f6e6c000000-7f6e6c021000 rwxp 00000000 00:00 0
7f6e6c021000-7f6e70000000 ---p 00000000 00:00 0
7f6e72ffe000-7f6e72fff000 ---p 00000000 00:00 0
7f6e72fff000-7f6e737ff000 rwxp 00000000 00:00 0
7f6e737ff000-7f6e73800000 ---p 00000000 00:00 0
7f6e73800000-7f6e74000000 rwxp 00000000 00:00 0
7f6e74000000-7f6e74021000 rwxp 00000000 00:00 0
7f6e74021000-7f6e78000000 ---p 00000000 00:00 0
7f6e78000000-7f6e78021000 rwxp 00000000 00:00 0
7f6e78021000-7f6e7c000000 ---p 00000000 00:00 0
7f6e7c000000-7f6e7c021000 rwxp 00000000 00:00 0
7f6e7c021000-7f6e80000000 ---p 00000000 00:00 0
7f6e801e9000-7f6e81568000 rwxp 00000000 00:00 0
7f6e81568000-7f6e81569000 r-xp 00000000 ca:01 2758314 /home/ubuntu/anatrack/node_modules/mongoskin/node_modules/mongodb/node_modules/kerberos/build/Release/kerberos.node
7f6e81569000-7f6e81768000 ---p 00001000 ca:01 2758314 /home/ubuntu/anatrack/node_modules/mongoskin/node_modules/mongodb/node_modules/kerberos/build/Release/kerberos.node
7f6e81768000-7f6e81769000 r-xp 00000000 ca:01 2758314 /home/ubuntu/anatrack/node_modules/mongoskin/node_modules/mongodb/node_modules/kerberos/build/Release/kerberos.node
7f6e81769000-7f6e8176a000 rwxp 00001000 ca:01 2758314 /home/ubuntu/anatrack/node_modules/mongoskin/node_modules/mongodb/node_modules/kerberos/build/Release/kerberos.node
7f6e8176a000-7f6e81776000 r-xp 00000000 ca:01 2758335 /home/ubuntu/anatrack/node_modules/mongoskin/node_modules/mongodb/node_modules/bson/build/Release/bson.node
7f6e81776000-7f6e81976000 ---p 0000c000 ca:01 2758335 /home/ubuntu/anatrack/node_modules/mongoskin/node_modules/mongodb/node_modules/bson/build/Release/bson.node
7f6e81976000-7f6e81977000 r-xp 0000c000 ca:01 2758335 /home/ubuntu/anatrack/node_modules/mongoskin/node_modules/mongodb/node_modules/bson/build/Release/bson.node
7f6e81977000-7f6e81978000 rwxp 0000d000 ca:01 2758335 /home/ubuntu/anatrack/node_modules/mongoskin/node_modules/mongodb/node_modules/bson/build/Release/bson.node
7f6e81978000-7f6e81979000 ---p 00000000 00:00 0
7f6e81979000-7f6e82179000 rwxp 00000000 00:00 0
7f6e82179000-7f6e821d3000 r-xp 00000000 ca:01 5251967 /home/ubuntu/anatrack/node_modules/aerospike/build/Release/aerospike.node
7f6e821d3000-7f6e823d2000 ---p 0005a000 ca:01 5251967 /home/ubuntu/anatrack/node_modules/aerospike/build/Release/aerospike.node
7f6e823d2000-7f6e823d4000 r-xp 00059000 ca:01 5251967 /home/ubuntu/anatrack/node_modules/aerospike/build/Release/aerospike.node
7f6e823d4000-7f6e823d7000 rwxp 0005b000 ca:01 5251967 /home/ubuntu/anatrack/node_modules/aerospike/build/Release/aerospike.node
7f6e823d7000-7f6e823d9000 rwxp 00000000 00:00 0
7f6e823d9000-7f6e823f1000 r-xp 00000000 ca:01 399308 /lib/x86_64-linux-gnu/libresolv-2.15.so
7f6e823f1000-7f6e825f1000 ---p 00018000 ca:01 399308 /lib/x86_64-linux-gnu/libresolv-2.15.so
7f6e825f1000-7f6e825f2000 r-xp 00018000 ca:01 399308 /lib/x86_64-linux-gnu/libresolv-2.15.so
7f6e825f2000-7f6e825f3000 rwxp 00019000 ca:01 399308 /lib/x86_64-linux-gnu/libresolv-2.15.so
7f6e825f3000-7f6e825f5000 rwxp 00000000 00:00 0
7f6e825f5000-7f6e825fc000 r-xp 00000000 ca:01 399310 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7f6e825fc000-7f6e827fb000 ---p 00007000 ca:01 399310 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7f6e827fb000-7f6e827fc000 r-xp 00006000 ca:01 399310 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7f6e827fc000-7f6e827fd000 rwxp 00007000 ca:01 399310 /lib/x86_64-linux-gnu/libnss_dns-2.15.so
7f6e827fd000-7f6e827fe000 ---p 00000000 00:00 0
7f6e827fe000-7f6e82ffe000 rwxp 00000000 00:00 0
7f6e82ffe000-7f6e82fff000 ---p 00000000 00:00 0
7f6e82fff000-7f6e837ff000 rwxp 00000000 00:00 0
7f6e837ff000-7f6e83800000 ---p 00000000 00:00 0
7f6e83800000-7f6e84000000 rwxp 00000000 00:00 0
7f6e84000000-7f6e84021000 rwxp 00000000 00:00 0
7f6e84021000-7f6e88000000 ---p 00000000 00:00 0
7f6e88126000-7f6e88132000 r-xp 00000000 ca:01 399307 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f6e88132000-7f6e88331000 ---p 0000c000 ca:01 399307 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f6e88331000-7f6e88332000 r-xp 0000b000 ca:01 399307 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f6e88332000-7f6e88333000 rwxp 0000c000 ca:01 399307 /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f6e88333000-7f6e88334000 ---p 00000000 00:00 0
7f6e88334000-7f6e89eb3000 rwxp 00000000 00:00 0
7f6e89eb3000-7f6e89ed4000 r-xp 00000000 ca:01 5251241 /home/ubuntu/anatrack/node_modules/geoip/build/Release/native.node
7f6e89ed4000-7f6e8a0d3000 ---p 00021000 ca:01 5251241 /home/ubuntu/anatrack/node_modules/geoip/build/Release/native.node
7f6e8a0d3000-7f6e8a0d4000 r-xp 00020000 ca:01 5251241 /home/ubuntu/anatrack/node_modules/geoip/build/Release/native.node
7f6e8a0d4000-7f6e8a0d6000 rwxp 00021000 ca:01 5251241 /home/ubuntu/anatrack/node_modules/geoip/build/Release/native.node
7f6e8a0d6000-7f6e8a28b000 r-xp 00000000 ca:01 393535 /lib/x86_64-linux-gnu/libc-2.15.so
7f6e8a28b000-7f6e8a48b000 ---p 001b5000 ca:01 393535 /lib/x86_64-linux-gnu/libc-2.15.so
7f6e8a48b000-7f6e8a48f000 r-xp 001b5000 ca:01 393535 /lib/x86_64-linux-gnu/libc-2.15.so
7f6e8a48f000-7f6e8a491000 rwxp 001b9000 ca:01 393535 /lib/x86_64-linux-gnu/libc-2.15.so
7f6e8a491000-7f6e8a496000 rwxp 00000000 00:00 0
7f6e8a496000-7f6e8a4ae000 r-xp 00000000 ca:01 399314 /lib/x86_64-linux-gnu/libpthread-2.15.so
7f6e8a4ae000-7f6e8a6ad000 ---p 00018000 ca:01 399314 /lib/x86_64-linux-gnu/libpthread-2.15.so
7f6e8a6ad000-7f6e8a6ae000 r-xp 00017000 ca:01 399314 /lib/x86_64-linux-gnu/libpthread-2.15.so
7f6e8a6ae000-7f6e8a6af000 rwxp 00018000 ca:01 399314 /lib/x86_64-linux-gnu/libpthread-2.15.so
7f6e8a6af000-7f6e8a6b3000 rwxp 00000000 00:00 0
7f6e8a6b3000-7f6e8a6c8000 r-xp 00000000 ca:01 396824 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6e8a6c8000-7f6e8a8c7000 ---p 00015000 ca:01 396824 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6e8a8c7000-7f6e8a8c8000 r-xp 00014000 ca:01 396824 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6e8a8c8000-7f6e8a8c9000 rwxp 00015000 ca:01 396824 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6e8a8c9000-7f6e8a9c4000 r-xp 00000000 ca:01 399316 /lib/x86_64-linux-gnu/libm-2.15.so
7f6e8a9c4000-7f6e8abc3000 ---p 000fb000 ca:01 399316 /lib/x86_64-linux-gnu/libm-2.15.so
7f6e8abc3000-7f6e8abc4000 r-xp 000fa000 ca:01 399316 /lib/x86_64-linux-gnu/libm-2.15.so
7f6e8abc4000-7f6e8abc5000 rwxp 000fb000 ca:01 399316 /lib/x86_64-linux-gnu/libm-2.15.so
7f6e8abc5000-7f6e8aca7000 r-xp 00000000 ca:01 7755 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f6e8aca7000-7f6e8aea6000 ---p 000e2000 ca:01 7755 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f6e8aea6000-7f6e8aeae000 r-xp 000e1000 ca:01 7755 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f6e8aeae000-7f6e8aeb0000 rwxp 000e9000 ca:01 7755 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f6e8aeb0000-7f6e8aec5000 rwxp 00000000 00:00 0
7f6e8aec5000-7f6e8aecc000 r-xp 00000000 ca:01 399311 /lib/x86_64-linux-gnu/librt-2.15.so
7f6e8aecc000-7f6e8b0cb000 ---p 00007000 ca:01 399311 /lib/x86_64-linux-gnu/librt-2.15.so
7f6e8b0cb000-7f6e8b0cc000 r-xp 00006000 ca:01 399311 /lib/x86_64-linux-gnu/librt-2.15.so
7f6e8b0cc000-7f6e8b0cd000 rwxp 00007000 ca:01 399311 /lib/x86_64-linux-gnu/librt-2.15.so
7f6e8b0cd000-7f6e8b0cf000 r-xp 00000000 ca:01 399321 /lib/x86_64-linux-gnu/libdl-2.15.so
7f6e8b0cf000-7f6e8b2cf000 ---p 00002000 ca:01 399321 /lib/x86_64-linux-gnu/libdl-2.15.so
7f6e8b2cf000-7f6e8b2d0000 r-xp 00002000 ca:01 399321 /lib/x86_64-linux-gnu/libdl-2.15.so
7f6e8b2d0000-7f6e8b2d1000 rwxp 00003000 ca:01 399321 /lib/x86_64-linux-gnu/libdl-2.15.so
7f6e8b2d1000-7f6e8b2f3000 r-xp 00000000 ca:01 399317 /lib/x86_64-linux-gnu/ld-2.15.so
7f6e8b4d0000-7f6e8b4d1000 ---p 00000000 00:00 0
7f6e8b4d1000-7f6e8b4e7000 rwxp 00000000 00:00 0
7f6e8b4f0000-7f6e8b4f3000 rwxp 00000000 00:00 0
7f6e8b4f3000-7f6e8b4f4000 r-xp 00022000 ca:01 399317 /lib/x86_64-linux-gnu/ld-2.15.so
7f6e8b4f4000-7f6e8b4f6000 rwxp 00023000 ca:01 399317 /lib/x86_64-linux-gnu/ld-2.15.so
7fff9b366000-7fff9b387000 rwxp 00000000 00:00 0 [stack]
7fff9b3b1000-7fff9b3b2000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)

Current workaround is to avoid such situation is simply don't send any undefined value to either put or get method.

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 ?? ()

CentOS7/RHEL7 support

Possible for you to add this support sometime soon? We need to do a major deploy, and this is our blocker.

Get Key Digest

Are there any way to get the digest from key(ns, set,key) and from inserted record?

Build fails at query.cc

Build fails at query.cc.

CC is gcc 4.9.2, I tried with clang, but your build scripts rely on GCC-only flags (-fno-tree-vrp).

> [email protected] install /home/aaron/src/aerospike-node-demo/node_modules/aerospike
> node-gyp rebuild

make: Entering directory '/home/aaron/src/aerospike-node-demo/node_modules/aerospike/build'
  ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a

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

  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/client/batch_exists.o
  CXX(target) Release/obj.target/aerospike/src/main/client/batch_get.o
  CXX(target) Release/obj.target/aerospike/src/main/client/close.o
  CXX(target) Release/obj.target/aerospike/src/main/client/connect.o
  CXX(target) Release/obj.target/aerospike/src/main/client/execute.o
  CXX(target) Release/obj.target/aerospike/src/main/client/exists.o
  CXX(target) Release/obj.target/aerospike/src/main/client/get.o
  CXX(target) Release/obj.target/aerospike/src/main/client/info.o
  CXX(target) Release/obj.target/aerospike/src/main/client/operate.o
  CXX(target) Release/obj.target/aerospike/src/main/client/put.o
  CXX(target) Release/obj.target/aerospike/src/main/client/query.o
../src/main/client/query.cc: In static member function ‘static v8::Handle<v8::Value> AerospikeQuery::where(const v8::Arguments&)’:
../src/main/client/query.cc:222:10: error: ‘AS_PREDICATE_INTEGER_RANGE’ was not declared in this scope
     case AS_PREDICATE_INTEGER_RANGE:
          ^
../src/main/client/query.cc:230:10: error: ‘AS_PREDICATE_INTEGER_EQUAL’ was not declared in this scope
     case AS_PREDICATE_INTEGER_EQUAL:
          ^
../src/main/client/query.cc:238:10: error: ‘AS_PREDICATE_STRING_EQUAL’ was not declared in this scope
     case AS_PREDICATE_STRING_EQUAL:
          ^
../src/main/client/query.cc:242:59: error: ‘string_equals’ was not declared in this scope
      as_query_where( query, bin_name,string_equals(bin_val));
                                                           ^
aerospike.target.mk:131: recipe for target 'Release/obj.target/aerospike/src/main/client/query.o' failed
make: *** [Release/obj.target/aerospike/src/main/client/query.o] Error 1
make: Leaving directory '/home/aaron/src/aerospike-node-demo/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/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 3.18.4-1-ARCH
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/aaron/src/aerospike-node-demo/node_modules/aerospike
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 
npm ERR! Linux 3.18.4-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--save" "aerospike" "--python=python2"
npm ERR! node v0.10.36
npm ERR! npm  v2.4.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the aerospike package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls aerospike
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/aaron/src/aerospike-node-demo/npm-debug.log

Comments and suggestions

  1. The first comment, and something that really seems alien is seeing an error object when there wasn't an error... this really breaks node convention of only having to check for the existence/truthiness of an error, not inspection. It really isn't an error in your implementation. This breaks a lot of utilities that people use to improve their flows such as promisify libraries/methods.
  2. Given the fast movement of io.js and changes to Node 0.12, I'm somewhat surprised that the newer versions aren't supported... I'm not familiar with the protocol, but how difficult would it be to move to a JS based client implementation that isn't dependent on a binary module? I know that this may well not perform quite as fast as the native module, but the trade-off may be well worth it considering how quickly io.js is now moving.
  3. It may be worthwhile to implement a promise based client over the top of the base client (where that implementation checks that the status code is okay before resolving/rejecting the promise). Considering this is where development is moving.
  4. It wasn't immediately obvious if the client implements or needs separate pooling for use with multiple simultaneous requests.

Feel free to break these off into separate issues.. I wanted to open dialog first, and make a couple of suggestions.

Segmentation fault when doing batch insert

Maybe I doing it wrong, but running the below batch put, where uuids is an array with 100k unique UUIDs I see a lot of Internal failure in log message write :9 messages in the console and a [1] {number} segmentation fault after that.

async.eachLimit(uuids, 20, function(uuid, callback) {
  var key = {
    ns: 'test',
    set: 'users',
    key: uuid
  };

  var record = {
    name: 'George',
    email: uuid + '@shopbeam.com'
  };

  var metadata = {
    ttl: 10000,
    gen: 0
  };

  client.put(key, record, metadata, function(err, key) {
    callback();
  });
},
function(err) {
  if (err.code != aerospike.status.AEROSPIKE_OK)
    console.log(err);
});

Error while putting record

So I have a mongoose model object that I am trying to put into aerospike.

aeroDB.put(key, newUser,  function(err) {
                        if (err.code != aerospike.status.AEROSPIKE_OK) {
                            return done(err,  resp);
                        }
                        done(null, resp);
                    });

However it spits out a huge error unless I wrap newUser with JSON.parse and JSON.stringify like

JSON.parse(JSON.stringify(newUser))

I don't see why there should be an error as the mongoose object should be fine.

Error: http://pastebin.com/GuDmaNKb

Build fails on "Linux mint17" which is based on Ubuntu 14.04

Hi,

Currently the client build fails on Linux mint 17. I had to download the tar ball and patch the source files to make it work. Can you please add "linuxmint17" to line 64 aerospike-client-c.sh file.

Mint being the most used variant of Ubuntu many more users would face such issue.

Best regards

Explain AEROSPIKE_LUA_PATH

I had to set AEROSPIKE_LUA_PATH to /usr/share/udf/lua on my system to get past the dependency check portion of the npm install, and this isn't covered in the README.

batchGet() hangs if connection closes and there are outstanding call backs

To simulate


    for(k=1;k<50;k++){
      keys.push({ns:"test",set:"users",key:"user" + k});
    }

    /* Get all users */
    client.batchGet(keys, function (err, results) {
        var i = 0;
        if ( err.code == status.AEROSPIKE_OK ) {
            for ( i = 0; i < results.length; i++ ) {
                switch ( results[i].status ) {
                    case status.AEROSPIKE_OK:
                        // Get tweets
                        var record = results[i].record;
                         var tweet_keys = [];
                        console.log(record.username + ' has ' + record.tweetcount + ' tweets');
                        for (var t=1;t<=record.tweetcount;t++){
                          tweet_keys.push({ns:"test",set:"tweets",key:record.username + ":" + t});
                        }
                        if(tweet_keys.length>0)
                          client.batchGet(tweet_keys,function(terr,tresults){
                          if(terr.code!=0){ console.log('Tweet error : ' + JSON.stringify(terr))};
                          tresults.forEach(function(tweet){
                            if(tweet['record'])
                              console.log('Tweet ' + JSON.stringify(tweet.record));
                          });
                        });
                        break;
                    case status.AEROSPIKE_ERR_RECORD_NOT_FOUND:
                        console.log("NOT_FOUND - ", results[i].keys);
                        break;
                    default:
                        console.log("ERR - %d - ", results[i].status, results[i].keys);
                }
            }
        }
        else {
            console.log("ERR - ", err);
        }    
        client.close();
    });    

client.close() will be executed after about 3 results and the rest of the batchGet requests will wait for a response never reaching any sort of a timeout.

1.0.21 Build Error

Building in a docker container...

Debian Wheezy 3.16.4-tinycore64
node 0.11.14
npm 2.1.4

Step 10 : RUN npm install
 ---> Running in 96c29ecd1882

> [email protected] install /usr/src/app/node_modules/aerospike
> node-gyp rebuild

child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/usr/src/app/node_modules/aerospike/build'
  ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a
info: downloading 'http://www.aerospike.com/download/client/c/latest/artifact/debian7' to '/usr/src/app/node_modules/aerospike/aerospike-client-c/package/aerospike-client-c.tgz'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   349    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0   351    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 13.6M  100 13.6M    0     0  4035k      0  0:00:03  0:00:03 --:--:-- 4569k
info: extracting 'aerospike-client-c-3.0.87.debian7.x86_64/aerospike-client-c-devel-3.0.87.debian7.x86_64.deb' from 'aerospike-client-c.tgz'
info: extracting files from 'aerospike-client-c-3.0.87.debian7.x86_64/aerospike-client-c-devel-3.0.87.debian7.x86_64.deb'

CHECK
   [✓] /usr/src/app/node_modules/aerospike/aerospike-client-c/package/usr/lib/libaerospike.a
   [✓] /usr/src/app/node_modules/aerospike/aerospike-client-c/package/usr/include/aerospike/aerospike.h
   [✓] /usr/src/app/node_modules/aerospike/aerospike-client-c/package/opt/aerospike/client/sys/udf/lua/aerospike.lua

  TOUCH Release/obj.target/aerospike-client-c.stamp
  CXX(target) Release/obj.target/aerospike/src/main/aerospike.o
In file included from ../src/main/aerospike.cc:18:0:
../src/main/client.h:50:43: error: expected class-name before '{' token
../src/main/client.h:58:48: error: 'Arguments' does not name a type
../src/main/client.h:58:59: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:73:40: error: 'Arguments' does not name a type
../src/main/client.h:73:51: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:82:44: error: 'Arguments' does not name a type
../src/main/client.h:82:55: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:87:42: error: 'Arguments' does not name a type
../src/main/client.h:87:53: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:92:40: error: 'Arguments' does not name a type
../src/main/client.h:92:51: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:97:43: error: 'Arguments' does not name a type
../src/main/client.h:97:54: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:102:40: error: 'Arguments' does not name a type
../src/main/client.h:102:51: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:107:43: error: 'Arguments' does not name a type
../src/main/client.h:107:54: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:112:43: error: 'Arguments' does not name a type
../src/main/client.h:112:54: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:117:45: error: 'Arguments' does not name a type
../src/main/client.h:117:56: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:122:48: error: 'Arguments' does not name a type
../src/main/client.h:122:59: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:132:44: error: 'Arguments' does not name a type
../src/main/client.h:132:55: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:137:41: error: 'Arguments' does not name a type
../src/main/client.h:137:52: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:142:49: error: 'Arguments' does not name a type
../src/main/client.h:142:60: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:147:48: error: 'Arguments' does not name a type
../src/main/client.h:147:59: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:152:45: error: 'Arguments' does not name a type
../src/main/client.h:152:56: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:157:44: error: 'Arguments' does not name a type
../src/main/client.h:157:55: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:162:46: error: 'Arguments' does not name a type
../src/main/client.h:162:57: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:167:44: error: 'Arguments' does not name a type
../src/main/client.h:167:55: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/client.h:172:45: error: 'Arguments' does not name a type
../src/main/client.h:172:56: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/aerospike.cc:26:28: error: 'Arguments' does not name a type
../src/main/aerospike.cc:26:39: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/aerospike.cc: In function 'v8::Handle<v8::Value> client(const int&)':
../src/main/aerospike.cc:30:18: error: 'class v8::HandleScope' has no member named 'Close'
../src/main/aerospike.cc: At global scope:
../src/main/aerospike.cc:39:25: error: 'Arguments' does not name a type
../src/main/aerospike.cc:39:36: warning: ISO C++ forbids declaration of 'args' with no type [-fpermissive]
../src/main/aerospike.cc: In function 'v8::Handle<v8::Value> key(const int&)':
../src/main/aerospike.cc:41:5: error: 'isolate' was not declared in this scope
../src/main/aerospike.cc:44:15: error: request for member 'Length' in 'args', which is of non-class type 'const int'
../src/main/aerospike.cc:45:41: error: no matching function for call to 'v8::Object::New()'
../src/main/aerospike.cc:45:41: note: candidate is:
In file included from /root/.node-gyp/0.11.14/src/node.h:61:0,
                 from ../src/main/aerospike.cc:17:
/root/.node-gyp/0.11.14/deps/v8/include/v8.h:2372:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
/root/.node-gyp/0.11.14/deps/v8/include/v8.h:2372:24: note:   candidate expects 1 argument, 0 provided
../src/main/aerospike.cc:46:18: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc:46:49: error: invalid types 'const int[int]' for array subscript
../src/main/aerospike.cc:47:18: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc:47:50: error: invalid types 'const int[int]' for array subscript
../src/main/aerospike.cc:48:18: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc:48:50: error: invalid types 'const int[int]' for array subscript
../src/main/aerospike.cc:49:22: error: 'class v8::HandleScope' has no member named 'Close'
../src/main/aerospike.cc:52:18: error: 'class v8::HandleScope' has no member named 'Close'
../src/main/aerospike.cc:52:34: error: too few arguments to function 'v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)'
In file included from /root/.node-gyp/0.11.14/src/node.h:61:0,
                 from ../src/main/aerospike.cc:17:
/root/.node-gyp/0.11.14/deps/v8/include/v8.h:305:28: note: declared here
../src/main/aerospike.cc: In function 'void Aerospike(v8::Handle<v8::Object>, v8::Handle<v8::Object>)':
../src/main/aerospike.cc:62:18: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc:62:77: error: no matching function for call to 'v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))'
../src/main/aerospike.cc:62:77: note: candidate is:
In file included from /root/.node-gyp/0.11.14/src/node.h:61:0,
                 from ../src/main/aerospike.cc:17:
/root/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
/root/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note:   no known conversion for argument 1 from 'v8::Handle<v8::Value>(const int&)' to 'v8::Isolate*'
../src/main/aerospike.cc:63:18: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc:63:74: error: no matching function for call to 'v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))'
../src/main/aerospike.cc:63:74: note: candidate is:
In file included from /root/.node-gyp/0.11.14/src/node.h:61:0,
                 from ../src/main/aerospike.cc:17:
/root/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
/root/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note:   no known conversion for argument 1 from 'v8::Handle<v8::Value>(const int&)' to 'v8::Isolate*'
../src/main/aerospike.cc:64:18: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc:65:18: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc:66:18: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc:67:15: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc:68:18: error: 'NewSymbol' is not a member of 'v8::String'
../src/main/aerospike.cc: In function 'v8::Handle<v8::Value> key(const int&)':
../src/main/aerospike.cc:53:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/main/aerospike.cc: In function 'v8::Handle<v8::Value> client(const int&)':
../src/main/aerospike.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [Release/obj.target/aerospike/src/main/aerospike.o] Error 1
make: Leaving directory `/usr/src/app/node_modules/aerospike/build'

Wont install on Windows7

When using below link for NodeJS with windows7 and run this command "$ npm install aerospike"
http://www.aerospike.com/docs/client/nodejs/install/

Error Message :
C:\nodecellar> npm install aerospike
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! notsup Valid OS: linux,darwin
npm ERR! notsup Valid Arch: x64
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: ia32

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin
\npm-cli.js" "install" "aerospike"
npm ERR! cwd C:\nodecellar
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code EBADPLATFORM
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\nodecellar\npm-debug.log
npm ERR! not ok code 0
C:\nodecellar>

client.add() issues

client.add(key, bins, function(error, record)) returns an empty record set {} in console.log and subsequent calls to record.anything returns undefined.

wont install on mac OSX

When trying to run the examples from a mac, npm install fails.

npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! notsup Valid OS:    linux
npm ERR! notsup Valid Arch:  x64
npm ERR! notsup Actual OS:   darwin
npm ERR! notsup Actual Arch: x64

npm ERR! System Darwin 13.1.0
npm ERR! command "/usr/local/Cellar/node/0.10.25/bin/node" "/usr/local/bin/npm" "install" "../"
npm ERR! cwd ~/aerospike-client-nodejs/examples
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code EBADPLATFORM
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     ~/aerospike-client-nodejs/examples/npm-debug.log
npm ERR! not ok code 0

Not able to install v 1.0.18

I am trying to install the v 1.0.18 with sudo npm install [email protected]

and getting this error ....

make: *** [Release/obj.target/aerospike/src/main/util/conversions.o] Error 1
make: Leaving directory /home/ubuntu/hitesh/dynamicbidder/node_modules/aerospike/build' gyp ERR! build error gyp ERR! stack Error:makefailed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:807:12) gyp ERR! System Linux 3.2.0-36-virtual gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/ubuntu/hitesh/dynamicbidder/node_modules/aerospike gyp ERR! node -v v0.10.28 gyp ERR! node-gyp -v v0.13.0 gyp ERR! not ok 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 most likely a problem with the aerospike package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls aerospike
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-36-virtual
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "[email protected]"
npm ERR! cwd /home/ubuntu/hitesh/dynamicbidder
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ubuntu/hitesh/dynamicbidder/npm-debug.log
npm ERR! not ok code 0

HERE is the npm-debug.log

135 silly lockFile b2cfdcee-micbidder-node-modules-aerospike tar:///home/ubuntu/hitesh/dynamicbidder/node_modules/aerospike
136 silly lockFile b2cfdcee-micbidder-node-modules-aerospike tar:///home/ubuntu/hitesh/dynamicbidder/node_modules/aerospike
137 silly lockFile dd4089f8-npm-aerospike-1-0-18-package-tgz tar:///home/ubuntu/.npm/aerospike/1.0.18/package.tgz
138 silly lockFile dd4089f8-npm-aerospike-1-0-18-package-tgz tar:///home/ubuntu/.npm/aerospike/1.0.18/package.tgz
139 info preinstall [email protected]
140 verbose readDependencies using package.json deps
141 verbose readDependencies using package.json deps
142 silly resolved []
143 verbose about to build /home/ubuntu/hitesh/dynamicbidder/node_modules/aerospike
144 info build /home/ubuntu/hitesh/dynamicbidder/node_modules/aerospike
145 verbose linkStuff [ false,
145 verbose linkStuff false,
145 verbose linkStuff false,
145 verbose linkStuff '/home/ubuntu/hitesh/dynamicbidder/node_modules' ]
146 info linkStuff [email protected]
147 verbose linkBins [email protected]
148 verbose linkMans [email protected]
149 verbose rebuildBundles [email protected]
150 info install [email protected]
151 verbose unsafe-perm in lifecycle false
152 info [email protected] Failed to exec install script
153 info /home/ubuntu/hitesh/dynamicbidder/node_modules/aerospike unbuild
154 info preuninstall [email protected]
155 info uninstall [email protected]
156 verbose true,/home/ubuntu/hitesh/dynamicbidder/node_modules,/home/ubuntu/hitesh/dynamicbidder/node_modules unbuild [email protected]
157 info postuninstall [email protected]
158 error [email protected] install: node-gyp rebuild
158 error Exit status 1
159 error Failed at the [email protected] install script.
159 error This is most likely a problem with the aerospike package,
159 error not with npm itself.
159 error Tell the author that this fails on your system:
159 error node-gyp rebuild
159 error You can get their info via:
159 error npm owner ls aerospike
159 error There is likely additional logging output above.
160 error System Linux 3.2.0-36-virtual
161 error command "/usr/bin/node" "/usr/bin/npm" "install" "[email protected]"
162 error cwd /home/ubuntu/hitesh/dynamicbidder
163 error node -v v0.10.28
164 error npm -v 1.4.9
165 error code ELIFECYCLE
166 verbose exit [ 1, true ]

I am getting this error since 12:00 PM IST 28 Oct

When i tried to install new version with sudo npm install aerospike . it installs successfully but i am getting higher latencies in v 1.0.21 thats why i want to install the previous version .

Could you please suggest what i am doing wrong ?

Confusing Behavior of client.info('statistics') on Cluster

This might be caused by my lack of understanding of JS/Node.js in general but when I tried to do something like this (assuming client being successfully connected already):

var i = 0;

client.info('statistics', function(err, response, host) {
  console.log(err, i++);
});

The output would be:

{ code: 0, message: null, func: null, file: null, line: null } 0
{ code: 0, message: null, func: null, file: null, line: null } 1
{ code: 0, message: null, func: null, file: null, line: null } 2
{ code: 0, message: null, func: null, file: null, line: null } 3
{ code: 0, message: null, func: null, file: null, line: null } 4
{ code: 0, message: null, func: null, file: null, line: null } 5
{ code: 0, message: null, func: null, file: null, line: null } 6
{ code: 0, message: null, func: null, file: null, line: null } 7

Which indicates to me that this anonymous callback function gets invoked N times, where N being the number of nodes of given cluster in the client connection.

I know there might be techniques to work around this behavior to have a streamlined workflow to collect all statistics of all the nodes within given cluster synchronously (?), but wouldn't it be easier to have this request (I haven't tested other requests through client.info API) behave somewhat similar to client.batchGet where the callback would get an array of results and the callback being effectively just executed once?

I'm happy to elaborate more on this issue. My specific use case is to have a client regularly checks a given Aerospike cluster's health, and maybe there's a better and easier way to do it? Regardless, in my opinion the current behavior of client.info('statistics') is a little bit weird and due to the async nature of js/node.js, it's really hard to collect info from a cluster of nodes.

To give an example of this undesirable behavior, I'm using async, and client.info('statistics') is one of the tasks (I'm using async.parallel if this is relevant):

var jobs = [];

// some other jobs

jobs.push(function(callback) {
  client.info('statistics', function(err, response, host) {
    callback(err);
  });
});

And async would complain to me as Error: Callback was already called. (expected as my observation in the first example).

Malloc error after "LDT-LDT Bin is Damaged"

This is the error I got.
node(10093,0x7fff768b6300) malloc: *** error for object 0x101063e00: pointer being freed was not allocated

The error occurred after the client code continues to execute after a failed LargeList add operation.

Connection errors break mocha tests

In the following example, the connect method works as intended, but an error is also thrown directly from C. The issue is that if your testing a failing connection (you want to have a failed connection) inside a mocha test... the mocha test will always fail because the error is thrown from C.

        var db = aerospike.client(self.settings);

        db.connect(function (response) {
           // ...
        });

Expected result

Client connection fails, and the error is output via the response object. Allowing your software to deal with the error, and mocha tests to be able to test that error handling.

Actual result

Client connection fails, and the error is output via the response object. C also throws an error. Software can manage the error, but mocha tests of this error handling always fails to pass due to the C error

installation fails on various distros (Centos7, U15)

eduard@home:~$ npm install aerospike
/
> [email protected] install /home/eduard/node_modules/aerospike
> node-gyp rebuild

make: Entering directory '/home/eduard/node_modules/aerospike/build'
  ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a
error: ubuntu15 is not supported.
aerospike-client-c.target.mk:13: recipe for target 'aerospike-client-c/lib/libaerospike.a' failed
make: *** [aerospike-client-c/lib/libaerospike.a] Error 1
make: Leaving directory '/home/eduard/node_modules/aerospike/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/eduard/.nvm/versions/io.js/v2.0.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1009:12)
gyp ERR! System Linux 3.19.0-17-generic
gyp ERR! command "/home/eduard/.nvm/versions/io.js/v2.0.2/bin/iojs" "/home/eduard/.nvm/versions/io.js/v2.0.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/eduard/node_modules/aerospike
gyp ERR! node -v v2.0.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 
npm ERR! Linux 3.19.0-17-generic
npm ERR! argv "/home/eduard/.nvm/versions/io.js/v2.0.2/bin/iojs" "/home/eduard/.nvm/versions/io.js/v2.0.2/bin/npm" "install" "aerospike"
npm ERR! node v2.0.2
npm ERR! npm  v2.9.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the aerospike package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls aerospike
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/eduard/npm-debug.log

nodejs/node#1620

Bug overriding timeouts?

I have a client with the following timeout policy:

aerospike.client({
    ...
    policies: { timeout: 10 },
    ...
}).connect(...

However, I have one operate command with it's own timeout:

client.operate(key, operations, {timeout:10000}, function(err, record, metadata, key) {
...
});

Many of these calls are failing with the following error:

{ code: 9,
  message: 'Client timeout: timeout=1000 iterations=1 failedNodes=0 failedConns=0',
  func: 'as_command_execute',
  file: 'src/main/aerospike/as_command.c',
  line: 445 }

Is there something that I'm missing? Or is there a bug in overriding timeouts?

Internal failure in log message write :9 after client.close() with multiple clients

I have a problem to manage two or more aerospike clients in one Node.js app by using client.close().

Here is my sample code.

var aerospike = require('aerospike');

var conf = {hosts:[{"addr":"localhost","port":3000}]};

var client1 = aerospike.client(conf);
var client2 = aerospike.client(conf);

client1.connect(function(err) {
    console.log('client1 connected');
});
client2.connect(function(err) {
    console.log('client2 connected');
});

var key = aerospike.key('session', 'demo', 'test');

client1.put(key, {demo: 'test'}, function(err) {
    console.log('client 1 close');
    client1.close();
    client2.put(key, {demo: 'test'}, function(err) {
        console.log('client 2 put');
    });
});

When I run this code, I have sometimes (not always) "Internal failure in log message write :9."

$ node test.js
client1 connected
client2 connected
client 1 close
client 2 put

$ node test.js
client1 connected
client2 connected
client 1 close
Internal failure in log message write :9
Internal failure in log message write :9
client 2 put

How to solve this problem?

Thanks.

LDT support

LDT support please! Need it ASAP. Or i have to rewrite my project in golang!

Cannot build on OS X

apx:~ apx$ cd /tmp
apx:tmp apx$ npm i aerospike
npm http GET https://registry.npmjs.org/aerospike
npm http 200 https://registry.npmjs.org/aerospike

> [email protected] install /private/tmp/node_modules/aerospike
> node-gyp rebuild

  ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a
info: downloading 'http://www.aerospike.com/download/client/c/latest/artifact/mac' to '/private/tmp/node_modules/aerospike/aerospike-client-c/package/aerospike-client-c.tgz'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   345    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0   347    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100 13.9M  100 13.9M    0     0   410k      0  0:00:34  0:00:34 --:--:--  393k
info: extracting 'aerospike-client-c-3.0.70.mac.x86_64/aerospike-client-c-devel-3.0.70.pkg' from 'aerospike-client-c.tgz'
info: extracting files from 'aerospike-client-c-3.0.70.mac.x86_64/aerospike-client-c-devel-3.0.70.pkg'
7249 blocks

CHECK
   [✓] /private/tmp/node_modules/aerospike/aerospike-client-c/package/usr/local/lib/libaerospike.a
   [✓] /private/tmp/node_modules/aerospike/aerospike-client-c/package/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/client/batch_exists.o
  CXX(target) Release/obj.target/aerospike/src/main/client/batch_get.o
  CXX(target) Release/obj.target/aerospike/src/main/client/close.o
  CXX(target) Release/obj.target/aerospike/src/main/client/connect.o
  CXX(target) Release/obj.target/aerospike/src/main/client/exists.o
  CXX(target) Release/obj.target/aerospike/src/main/client/get.o
  CXX(target) Release/obj.target/aerospike/src/main/client/info.o
In file included from ../src/main/client/info.cc:26:
In file included from ../aerospike-client-c/include/aerospike/aerospike_info.h:41:
In file included from ../aerospike-client-c/include/aerospike/as_node.h:24:
../aerospike-client-c/include/aerospike/as_vector.h:118:22: error: arithmetic on a pointer to void
        return vector->list + (vector->item_size * index);
               ~~~~~~~~~~~~ ^
../aerospike-client-c/include/aerospike/as_vector.h:127:32: error: arithmetic on a pointer to void
        return *(void**)(vector->list + (vector->item_size * index));
                         ~~~~~~~~~~~~ ^
../aerospike-client-c/include/aerospike/as_vector.h:142:22: error: arithmetic on a pointer to void
        memcpy(vector->list + (index * vector->item_size), value, vector->item_size);
               ~~~~~~~~~~~~ ^
../aerospike-client-c/include/aerospike/as_vector.h:154:22: error: arithmetic on a pointer to void
        memcpy(vector->list + (vector->size * vector->item_size), value, vector->item_size);
               ~~~~~~~~~~~~ ^
../aerospike-client-c/include/aerospike/as_vector.h:170:22: error: arithmetic on a pointer to void
        memcpy(vector->list + (target * vector->item_size), vector->list + (source * vector->item_size), vector->item_size);
               ~~~~~~~~~~~~ ^
In file included from ../src/main/client/info.cc:26:
In file included from ../aerospike-client-c/include/aerospike/aerospike_info.h:41:
In file included from ../aerospike-client-c/include/aerospike/as_node.h:27:
In file included from ../aerospike-client-c/include/ck/ck_pr.h:38:
../aerospike-client-c/include/ck/gcc/x86_64/ck_pr.h:172:2: error: no matching function for call to 'ck_pr_load_64_2'
        ck_pr_load_64_2(t, v);
        ^~~~~~~~~~~~~~~
../aerospike-client-c/include/ck/gcc/x86_64/ck_pr.h:157:1: note: candidate function not viable: cannot convert argument of incomplete type 'void *' to
      'const uint64_t *' (aka 'const unsigned long long *')
ck_pr_load_64_2(const uint64_t target[2], uint64_t v[2])
^
../aerospike-client-c/include/ck/gcc/x86_64/ck_pr.h:453:9: error: no matching function for call to 'ck_pr_cas_64_2'
        return ck_pr_cas_64_2(t, c, s);
               ^~~~~~~~~~~~~~
../aerospike-client-c/include/ck/gcc/x86_64/ck_pr.h:434:1: note: candidate function not viable: cannot convert argument of incomplete type 'void *' to 'uint64_t *'
      (aka 'unsigned long long *')
ck_pr_cas_64_2(uint64_t target[2], uint64_t compare[2], uint64_t set[2])
^
../aerospike-client-c/include/ck/gcc/x86_64/ck_pr.h:481:9: error: no matching function for call to 'ck_pr_cas_64_2_value'
        return ck_pr_cas_64_2_value(t, c, s, v);
               ^~~~~~~~~~~~~~~~~~~~
../aerospike-client-c/include/ck/gcc/x86_64/ck_pr.h:457:1: note: candidate function not viable: cannot convert argument of incomplete type 'void *' to 'uint64_t *'
      (aka 'unsigned long long *')
ck_pr_cas_64_2_value(uint64_t target[2],
^
In file included from ../src/main/client/info.cc:26:
In file included from ../aerospike-client-c/include/aerospike/aerospike_info.h:41:
../aerospike-client-c/include/aerospike/as_node.h:227:14: error: cannot initialize a variable of type 'as_address *' (aka 'as_address_s *') with an rvalue of type
      'void *'
        as_address* address = as_vector_get(&node->addresses, node->address_index);
                    ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../aerospike-client-c/include/aerospike/as_node.h:237:9: error: cannot initialize return object of type 'as_address *' (aka 'as_address_s *') with an rvalue of type
      'void *'
        return as_vector_get(&node->addresses, node->address_index);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 errors generated.
make: *** [Release/obj.target/aerospike/src/main/client/info.o] Error 1
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:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:807:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /private/tmp/node_modules/aerospike
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
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 most likely a problem with the aerospike package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls aerospike
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 14.0.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "i" "aerospike"
npm ERR! cwd /private/tmp
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /private/tmp/npm-debug.log
npm ERR! not ok code 0

gcc -v:

Configured with: --prefix=/Applications/Xcode6-Beta2.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.34.4) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

memory leak when using over 14 character bin name

Currently the max length of bin name is 14 characters in aerospike.
And when I use over 14 characters as a bin name, that bin is ignored and memory leak occurs.

For example:

var record = {
  over_14_character_bin_name: 'foo'
}
client.put(key, record, function(error, key) {
  // bin 'foo' is not stored and memory leak occurs
});

So I think there are 2 problems:

  1. Aerospike Node.js Client should validate the length of bin name.
  2. Aerospike C Client should free memory when bin name is over 14 characters.

Return undefined for error on success

Node.js provide the standard way of things that you break in aerospike module. The standard node way or reporting errors is providing err as the first parameter of callbacks.

If there is no error, then err is null or underfined, not {code:0, message:null, func:null, ...}. Providing error object with OK code is very odd way of implementing stuff in node

batch_get() vs batchGet()

The docs on the website suggest that the function for reading multiple keys at once is called batch_get(), but this leads to an error on the latest driver:

TypeError: Object #<AerospikeClient> has no method 'batch_get'

how to stop scan?

how to stop scan when a get data in stream.on('data', function(){})?

Error building

Hello,

I'm getting this error after a clean clone

$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn python
gyp info spawn args [ '/usr/lib/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   '/home/ubuntu/sandbox/aerospike-client-nodejs/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/ubuntu/.node-gyp/0.10.29/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/ubuntu/.node-gyp/0.10.29',
gyp info spawn args   '-Dmodule_root_dir=/home/ubuntu/sandbox/aerospike-client-nodejs',
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 make: Entering directory `/home/ubuntu/sandbox/aerospike-client-nodejs/build'
spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a
make: *** [aerospike-client-c/lib/libaerospike.a] Error 1
make: Leaving directory `/home/ubuntu/sandbox/aerospike-client-nodejs/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 3.11.0-12-generic
gyp ERR! command "node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/ubuntu/sandbox/aerospike-client-nodejs
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
´´´

1.0.36 memory leak

I think there is a major leak somewhere in 1.0.36. Today we upgraded from 1.0.35 and got so exited we also upgraded node to current stable(12). After about 10 min. of benchmarking I noticed the memory of our workers growing out of control 2GB+ per worker and we run about 10 per server. I instantly downgraded node back to 0.10.36 and loaded up a other benchmark, once again memory quickly grew past 1GB mark. I then downgraded the areo client back to 1.0.35 and after about 1hr of benchmarking each worker is sitting at 90m of memory. I am doing simple get,puts, and increment operators.
Let me know if you need any other info or testing done.

NPM Install Process Very Confusing

The installation process for this package is incredibly confusing.

Because I was missing the the libaerospike.a and aerospike.h files that come with the C client SDK, I was unable to install this, and got the following errors.

error: It appears as though one or more files cannot be found.
error: 
error: You can either:
error: 
error:    a. Re-run with 'DOWNLOAD=1'
error:    
error:       $ DOWNLOAD=1 npm install
error: 
error:    b. Set the 'PREFIX' variable to the path containing the files
error:    
error:       $ PREFIX=/usr npm install
error: 
error:    c. Download and install the the Aerospike C Client development package,
error:       then retry the command.
error: 
make: *** [aerospike-client-c/lib/libaerospike.a] Error 1
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:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/test_user/aerospike-test/node_modules/aerospike
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

I even tried with DOWNLOAD=1, and it still didn't work.

Why are these not included with installation?

Failures during secondary index queries

Code to reproduce:

var aerospike=require('aerospike');
var client = aerospike.client(var client = aerospike.client({hosts:[{addr: '127.0.0.1', port: 3000 }]});
client.connect(function() {console.log('connected');}););


var makeRequest=function(index_name,time_from,time_to,callback) {
    var statement={
        filters:[aerospike.filter.range("time", time_from,time_to)]
    };

    var scan = client.query("test", index_name.toString(), statement);

    var stream = scan.execute();

    stream.on('data', function(record) {
        //do nothing
    });


    stream.on('error', function(error) {
        console.error(error);
        process.exit();
    });


    stream.on('end', function(){
        callback();
        //the code does not fail if to write here
        //setImmediate(callback);
        //but in this case there is a memory leak
    });
};




var from=1432218600000;
var i=0;

var f=function(index_name) {
    i++;
    var tm=+new Date;
    makeRequest(index_name,from,from+60000,function(){
        console.log(index_name,i,new Date-tm);
        from+=60000;
        setImmediate(f,index_name);
    });
};
f('myIndex');

After short time it failes with different errors, for example:

*** glibc detected *** node: free(): invalid next size (fast): 0x00007fbce8011040 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x75be6)[0x7fbcf0d34be6]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7fbcf0d3998c]
node(_ZN2v88internal13GlobalHandles31PostGarbageCollectionProcessingENS0_16GarbageCollectorE+0x13c)[0x8fee9c]
node(_ZN2v88internal4Heap24PerformGarbageCollectionENS0_16GarbageCollectorENS_15GCCallbackFlagsE+0x19e)[0x92f63e]
node(_ZN2v88internal4Heap14CollectGarbageENS0_16GarbageCollectorEPKcS4_NS_15GCCallbackFlagsE+0x14f)[0x92fb4f]
node(_ZN2v88internal7Factory13NewHeapNumberEdNS0_11MutableModeENS0_13PretenureFlagE+0x7f)[0x8dff4f]
node(_ZN2v88internal8JSObject14FastPropertyAtENS0_6HandleIS1_EENS0_14RepresentationENS0_10FieldIndexE+0xc6)[0xa48256]
node(_ZNK2v88internal14LookupIterator10FetchValueEv+0x187)[0xa3ec87]
node(_ZNK2v88internal14LookupIterator12GetDataValueEv+0x9)[0xa3f019]
node(_ZN2v88internal6Object11GetPropertyEPNS0_14LookupIteratorE+0x9b)[0xa639bb]
node(_ZN2v88internal7Runtime17GetObjectPropertyEPNS0_7IsolateENS0_6HandleINS0_6ObjectEEES6_+0xc9)[0xaee989]
node(_ZN2v86Object3GetENS_6HandleINS_5ValueEEE+0x4b)[0x7caffb]
/home/node/node_modules/aerospike/build/Release/aerospike.node(_ZN14AerospikeQuery5whereERKN2v820FunctionCallbackInfoINS0_5ValueEEE+0x39d)[0x7fbcf02463ed]
node(_ZN2v88internal25FunctionCallbackArguments4CallEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEE+0x9b)[0x7e34cb]
node[0x806d77]
[0x20bc8c70740e]

or

node: malloc.c:4665: _int_malloc: Assertion `victim->fd_nextsize->bk_nextsize == victim' failed.
Aborted

or

*** glibc detected *** node: double free or corruption (out): 0x00007f275c00fc30 ***

etc.

Sometimes the process simply hangs up.

Node.js v0.12.2
Aerospike Node.js client version 1.0.40
Aerospike Community Edition build 3.5.8

uv assertion during concurent queries

I am running queries with secondary index filter from node process.

Single query always succeedes. But if I run several (2 or more) queries in parallel, in the most cases node.js process terminates with the following message:

node: ../deps/uv/src/unix/core.c:209: uv__finish_close: Assertion `handle->flags & UV_CLOSING' failed.

It seemes that the assertion failes immediately before the 'end' event of one of the queries because of some racing conditions.

Example code to reproduce the situation:

var run_query=function(set_name,from,to) {
    var statement = {
        filters: [aerospike.filter.range("bin", from, to)]
    };

    var scan = client.query("ns", set_name, statement);

    var recordCount = 0;

    console.error('execute', set_name);
    var stream = scan.execute();

    stream.on('data', function (record) {
        recordCount++;
        console.error('     DATA', set_name, recordCount);
    });

    stream.on('error', function (e) {
        console.error('ERR', set_name, e);
    });

    stream.on('end', function () {
        console.error('END', set_name);
    });
};

run_query('1',0,1000);
run_query('2',0,1000);
run_query('3',0,1000);
run_query('4',0,1000);

Output is the following:

execute 1
execute 2
execute 3
execute 4
    DATA 2 1
    DATA 2 2
    DATA 2 3
    DATA 2 4
    DATA 2 5
  .... (all data from set 2)
END 2
    DATA 1 1
    DATA 1 2
    DATA 1 3
    DATA 1 4
    DATA 1 5
  .... (all data from set 1)
node: ../deps/uv/src/unix/core.c:209: uv__finish_close: Assertion `handle->flags & UV_CLOSING' failed.

No 'error' events are emitted, all namespaces, sets and indexes do exist.

Node.js v0.12.2
Aerospike client 1.0.36
Aerospike server 3.5.8-1, Debian 7

bug (critical) - number reads incorrectly

how to reproduce:

var aerospike = require('aerospike'))
var client = aerospike.client()
client.connect(function(err){
if (err.code !== 0)
console.error("Aerospike server connection Error: %j", err)
var key = aerospike.key('test','test','test')
client.put(key, [4294967295], function(){
client.get(key, function(e,d) {
console.log(d) // return: { '0': -1 } expect: 4294967295
})
})
})

but via aql console all returns correctly:

aql> select * from test.test where PK='test'
+-------------------+
| 0 |
+-------------------+
| 4294967295 |
+-------------------+
1 row in set (0.000 secs)

fix please

thanks

Querying

I need to be able to query for records similar to how you can in the java client. Can this please be added? Thanks

Centos 7

Hi,
Trying to do an npm install on centos7 and I'm getting:

$ npm install --save aerospike
\
> [email protected] install /storage/integration-layer/zbac/node_modules/aerospike
> node-gyp rebuild

make: Entering directory `/storage/integration-layer/zbac/node_modules/aerospike/build'
  ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a
error: centos7 is not supported.

Any idea? I presume you do support RHEL7/CENTOS7?

Can not install on io.js 1.8.1

It seems that compiler in io.js is more strict that in node 0.12:

...
CXX(target) Release/obj.target/aerospike/src/main/util/log.o
../src/main/util/log.cc:135:27: error: comparison between pointer and integer ('const char *' and 'int')
        if ( err->message != '\0') {
             ~~~~~~~~~~~~ ^  ~~~~

Current line generates just a warning in node 0.12.2

build error (RHEL)

We got errors when installing aerospike
on RHEL 6

[email protected] install /guip/node_modules/aerospike
node-gyp rebuild

make: Entering directory /guip/node_modules/aerospike/build' ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a error: redhatenterpriseserver6 is not supported. make: *** [aerospike-client-c/lib/libaerospike.a] Error 1 make: Leaving directory/guip/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:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 2.6.32-358.el6.x86_64
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /guip/node_modules/aerospike
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

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 most likely a problem with the aerospike package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls aerospike
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-358.el6.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "aerospike"
npm ERR! cwd /guip
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.4 (Santiago)
Release: 6.4
Codename: Santiago

build error

I got this error when using npm install aerospike
on debian 7

> [email protected] install /home/vvv/redirector/node_modules/aerospike
> node-gyp rebuild

make: Entering directory `/home/vvv/redirector/node_modules/aerospike/build'
  ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a
info: downloading 'http://www.aerospike.com/download/client/c/latest/artifact/debian7' to '/home/vvv/redirector/node_modules/aerospike/aerospike-client-c/package/aerospike-client-c.tgz'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   349    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0/
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
  0   351    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0-
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
100 13.6M  100 13.6M    0     0  1792k      0  0:00:07  0:00:07 --:--:-- 3711k|
info: extracting 'aerospike-client-c-3.0.86.debian7.x86_64/aerospike-client-c-devel-3.0.86.debian7.x86_64.deb' from 'aerospike-client-c.tgz'
info: extracting files from 'aerospike-client-c-3.0.86.debian7.x86_64/aerospike-client-c-devel-3.0.86.debian7.x86_64.deb'
-
CHECK
   [✓] /home/vvv/redirector/node_modules/aerospike/aerospike-client-c/package/usr/lib/libaerospike.a
   [✓] /home/vvv/redirector/node_modules/aerospike/aerospike-client-c/package/usr/include/aerospike/aerospike.h
   [✓] /home/vvv/redirector/node_modules/aerospike/aerospike-client-c/package/opt/aerospike/client/sys/udf/lua/aerospike.lua

  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/client/batch_exists.o
  CXX(target) Release/obj.target/aerospike/src/main/client/batch_get.o
  CXX(target) Release/obj.target/aerospike/src/main/client/close.o
  CXX(target) Release/obj.target/aerospike/src/main/client/connect.o
  CXX(target) Release/obj.target/aerospike/src/main/client/execute.o
  CXX(target) Release/obj.target/aerospike/src/main/client/exists.o
  CXX(target) Release/obj.target/aerospike/src/main/client/get.o
  CXX(target) Release/obj.target/aerospike/src/main/client/info.o
  CXX(target) Release/obj.target/aerospike/src/main/client/operate.o
  CXX(target) Release/obj.target/aerospike/src/main/client/put.o
  CXX(target) Release/obj.target/aerospike/src/main/client/remove.o
  CXX(target) Release/obj.target/aerospike/src/main/client/select.o
  CXX(target) Release/obj.target/aerospike/src/main/client/udf_register.o
  CXX(target) Release/obj.target/aerospike/src/main/client/udf_remove.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/log.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/operators.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/policy.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/status.o
  CXX(target) Release/obj.target/aerospike/src/main/enums/udf_languages.o
  CXX(target) Release/obj.target/aerospike/src/main/util/async.o
  CXX(target) Release/obj.target/aerospike/src/main/util/conversions.o
../src/main/util/conversions.cc: In function ‘int infopolicy_from_jsobject(as_policy_info*, v8::Local<v8::Object>, LogInfo*)’:
../src/main/util/conversions.cc:754:35: error: ‘as_policy_bool’ was not declared in this scope
../src/main/util/conversions.cc:754:51: error: expected ‘;’ before ‘v8send_as_is’
../src/main/util/conversions.cc:765:37: error: ‘as_policy_bool’ was not declared in this scope
../src/main/util/conversions.cc:765:53: error: expected ‘;’ before ‘v8check_bounds’
../src/main/util/conversions.cc: In function ‘int scanpolicy_from_jsobject(as_policy_scan*, v8::Local<v8::Object>, LogInfo*)’:
../src/main/util/conversions.cc:855:47: error: ‘as_policy_bool’ was not declared in this scope
../src/main/util/conversions.cc:855:63: error: expected ‘;’ before ‘failOnClusterChange’
../src/main/util/conversions.cc: In function ‘int scan_from_jsobject(as_scan*, v8::Local<v8::Object>, LogInfo*)’:
../src/main/util/conversions.cc:1262:20: error: ‘as_policy_bool’ was not declared in this scope
../src/main/util/conversions.cc:1262:36: error: expected ‘;’ before ‘noBins’
make: *** [Release/obj.target/aerospike/src/main/util/conversions.o] Error 1
make: Leaving directory `/home/vvv/redirector/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:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 3.15.4-x86_64-linode45
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vvv/redirector/node_modules/aerospike
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok 
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 most likely a problem with the aerospike package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls aerospike
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.15.4-x86_64-linode45
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "aerospike"
npm ERR! cwd /home/vvv/redirector
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/vvv/redirector/npm-debug.log
npm ERR! not ok code 0

Support for linux-mint

I got the following error ; am running Linux Mint

npm install --save aerospike

[email protected] install /home/mofax/node_modules/aerospike
node-gyp rebuild

make: Entering directory /home/mofax/node_modules/aerospike/build' ACTION binding_gyp_aerospike_client_c_target_run_scripts_aerospike_client_c_sh aerospike-client-c/lib/libaerospike.a error: linuxmint17 is not supported. make: *** [aerospike-client-c/lib/libaerospike.a] Error 1 make: Leaving directory/home/mofax/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/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.13.0-24-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/mofax/node_modules/aerospike
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

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 most likely a problem with the aerospike package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls aerospike
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "--save" "aerospike"
npm ERR! cwd /home/mofax
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

Cannot find module '../build/Release/aerospike.node'

I installed "aerospike" via npm on Ubuntu 14.04. I created a js file like below:

var aerospike = require("aerospike");

When I run the file, I get this error:

Cannot find module '../build/Release/aerospike.node'

New status codes

Please add new status codes like LARGE_ITEM_NOT_FOUND = 125 and others

Wrong persistence of Boolean attributes.

I'm having some issue when saving an object with Boolean attributes.
Its apparently is converting them to objects.

This code in NodeJs

var aerospike = require('aerospike');
var client = aerospike.client(connectionSetting);
client.connect(function(response) {
    if (response.code === aerospike.status.AEROSPIKE_OK) {
        var digest = aerospike.key('test', 'test', 'title');
        var value = {
            header: {
                banners: [],
                apply_banner: false
            }
        };
        client.put(digest, value, console.log);
    } else {
        console.error('SOMETHING IS WRONG');
    }
});

Generate this object at Aerospike DB.

ascli get test test title
{"header": { "banners": [ ], "apply_banner": { } }}

Server version 3.4.0
NodeJs module version 1.0.25

Thanks
Pablo

undefined bin makes api crash

Hello, the following code crashes the API and makes a stack dump .

var key = aerospike.key('test','test',1);
var doc = {'bla': 1}
doc.asd = undefined;

client.put(key, doc, function(err) 
{
   //do stuff
});

We cannot handle this error, as this is not being caught by process.on('uncaughtException') or domains. Is this a bug? Is there any way we can handle this kind of errors?

The error is something like this:

Fatal error in ../deps/v8/src/api.h, line 297

CHECK(allow_empty_handle || that != __null) failed

==== Stack trace ============================================

Security context: 0x2ffb4aa06b71 #0#
.....

Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.