Hi,
Using Node.js SDK 3.2.1
One of my servers has started sporadically timing out when calling cluster.connect. Today is the first time I have seen this on this server.
To debug this, I have created a test app that calls Couchbase.connect() and reads a known doc from a bucket then closes the connection.
Sometimes the connect call fails with TimeoutError.
Sometimes it takes a long time to connect (I would guess pretty close to the 5 second timeout) then completes but the GET document command fails with a RequestCanceledError, so I guess it didn’t really connect.
Occasionally (maybe 20% of the time?) it works! When it does, the connection is immediate and it then reads the document.
I have never seen the connection take more than a second to complete successfully so I can read the document. If it takes longer than that I get the RequestCanceledError when it tries to read the doc.
If it helps, this is the full error when it times out:
TimeoutError: timeout
at Object.translateCppError (/snapshot/yoid/node_modules/couchbase/dist/bindingutilities.js:180:20)
at Object.<anonymous> (/snapshot/yoid/node_modules/couchbase/dist/connection.js:145:45) {
cause: LibcouchbaseError: libcouchbase error 201
at Object.translateCppError (/snapshot/yoid/node_modules/couchbase/dist/bindingutilities.js:174:21)
at Object.<anonymous> (/snapshot/yoid/node_modules/couchbase/dist/connection.js:145:45) {
code: 201
},
context: undefined
}
This is the error when the connect completes but the GET fails.
RequestCanceledError: request canceled
at Object.translateCppError (/snapshot/yoid/node_modules/couchbase/dist/bindingutilities.js:182:20)
at /snapshot/yoid/node_modules/couchbase/dist/connection.js:237:54 {
cause: LibcouchbaseError: libcouchbase error 202
at Object.translateCppError (/snapshot/yoid/node_modules/couchbase/dist/bindingutilities.js:174:21)
at /snapshot/yoid/node_modules/couchbase/dist/connection.js:237:54 {
code: 202
},
context: KeyValueErrorContext {
status_code: 0,
opaque: 0,
cas: CbCas { '0': <Buffer 00 00 00 00 00 00 00 00> },
key: 'sanityCheck',
bucket: '',
collection: '',
scope: '',
context: '',
ref: ''
}
}
If it helps I can post my full test code, but the crux of it is
const cluster = await couchbase.connect("couchbase://localhost", { username, password });
const bucket = cluster.bucket(bucketName);
const coll = bucket.defaultCollection();
const res = await coll.get("sanityCheck");
I output the username and password before this and they are definitely correct. As I said, sometimes the code works with the same username and password.
I have looked in the CB logs but don’t see anything obvious. I’ve run tail -r on each log whilst running the command and no output gets printed whether it passes or fails.
I’ve tried restarting the couchbase service and even rebooted the server. I don’t know what else to try. I have also run the same code on other servers with the same Couchbase setup and it works successfully every time.
Thanks,
Giles