Hello everyone.
I’m currently migrating one of our services from the old Node SDK version (2.6.12) to the most recent one (4.2.7).
For testing I run a local couchbase cluster using docker. The version is Enterprise Edition 7.1.3 build 3479.
This is my code (bucket and username are the same):
const uri = "couchbase://localhost:8091"
const bucket = "test";
const pw = "password"
const timeoutOperation = 2;
async function run() {
const cluster = await cb.connect(uri, {
"username": bucket,
"password": pw,
"timeouts": {
"kvTimeout": timeoutOperation * 1000
}
});
const openBucket = cluster.bucket(bucket);
const connection = openBucket.defaultCollection();
}
run();
I get the following error when I run this.
[RequestCanceledError: request canceled] {
cause: [Error: request_canceled (2)] { code: 2 },
context: undefined
}
when I use the old couchbase version and our legacy code, it works fine:
async function connectToBucketOld(){
const cluster = new cbOld.Cluster(uri);
const connection: cbOld.Bucket = await new Promise((resolve, reject) => {
let connection;
const cb = err => (err ? reject(err) : resolve(connection));
connection = cluster.openBucket(bucket, pw, cb);
});
connection.operationTimeout = 1000 * timeoutOperation;
return { connection };
}
I would be grateful if someone could help me with that