Hi, I find that the getReplica function from collection.js not trigger correctly the replica and end events. So the Promise remain unresolved.
This happend to me on NODE sdk 3.2. Is that fixed on other version ?
Based on basic nodejs event:
const EventEmitter = require(‘events’);
const myEE = new EventEmitter();
myEE.on(“x”, () => console.log(“x”));
myEE.emit(“y”);
myEE.on(“y”, () => console.log(“y”));
myEE.emit(“x”);
myEE.emit(“asdf”);
our bind events from super callback should be trigger before callback in order to be able to listed on that events
class StreamableRowPromise extends StreamablePromise {
constructor(fn) {
let err;
const rows = ;
let meta;
let resolverFn, rejectFn;
super((emitter, resolve, reject) => {
resolverFn = resolve;
rejectFn = reject;
});
this.on('row', (r) => rows.push(r));
this.on('meta', (m) => (meta = m));
this.on('error', (e) => (err = e));
this.on('end', () => {
if (err && rejectFn) {
return rejectFn(err);
}
resolverFn && resolverFn(fn(rows, meta));
});
}
}
Hey @laurentiustroia!
Have you tried using the Node.js SDK v4.1.0? That is the most current version and may fix your issue, but if not let us know and we’ll investigate further!
Cheers
I try to upgrade to 4.1.0, but I stucked on a segmentation fault 11 error:
0 segfault-handler.node 0x00000001134a90aa _ZL16segfault_handleriP9__siginfoPv + 298
1 libsystem_platform.dylib 0x00007fff2041ad7d _sigtramp + 29
2 ??? 0x00007fcbed02c2d8 0x0 + 140513831469784
3 couchbase_impl.node 0x0000000113517b89 _ZN9couchbase2io12mcbp_session18initiate_bootstrapEv + 489
4 couchbase_impl.node 0x00000001134f0191 _ZN9couchbase2io12mcbp_session9bootstrapEONS_5utils16movable_functionIFvNSt3__110error_codeENS_8topology13configurationEEEEb + 433
5 couchbase_impl.node 0x00000001134c65d6 ZN9couchnode10Connection12jsOpenBucketERKN4Napi12CallbackInfoE + 2182
6 couchbase_impl.node 0x00000001134c9673 ZN4Napi7detailsL25TemplatedInstanceCallbackIN9couchnode10ConnectionEXadL_ZNS3_12jsOpenBucketERKNS_12CallbackInfoEEEEEP12napi_value__P10napi_env__P20napi_callback_info + 99
7 node 0x000000010e8002e0 _ZN6v8impl12_GLOBAL__N_123FunctionCallbackWrapper6InvokeERKN2v820FunctionCallbackInfoINS2_5ValueEEE + 128
8 node 0x000000010ea2d1b9 _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE + 265
9 node 0x000000010ea2cc86 _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEESA_NS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EENS0_16BuiltinArgumentsE + 550
10 node 0x000000010ea2c3ff _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE + 255
11 node 0x000000010f29f8f9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 57
and in documentation with migrated to sdk 4 don’t find any info regarding needs to update libcouchbase lib or other C dependency’s.
What version of Node are you running? If you are on 17.x can you try 16.x and see if the issue goes away?
Thanks
Aaron
I was used 16, also I try with 14 same problem with fault error 11, I use MacOS BigSur.
Hi @laurentiustroia
It looks like you might be hitting Loading.... More importantly, get replica is not yet supported in 4.0 Loading...
1 Like