Hi,
We have been struggling with this Error:
{ “errorMessage”: “Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout”,
“errorType”: “CouchbaseError”,
“stackTrace”:
}
And after this we get error on queries:
“Cannot perform operation on a shutdown bucket”
Now, we are using AWS lambda for this operation but I don’t think that matters as we have a regular couchbase server 4.5 and couchbase node.js 2.2 SDK with Ottoman as ORM. I have gone through the previously posted issues on this forum as well as other. Following is the one which we looked into.
We have tried all the possible options we could to overcome this, like, by increasing the operationTimeout and n1qlTimeout to a sufficiently high value but we still get this. Also we have tried to narrow down the issue which happens mostly whenever we try to query user. We get this error on the bucket as well connection string.
Below is our sample code:
exports.handler = function(event, context, callback) {
function sendResponse(error, data) {
ottoman.bucket.disconnect();
console.log("error : ", error);
console.log("data : ", data);
callback(error, data);
context.succeed({
success: true
});
}
console.log(event);
if(event.id != undefined) {
user.find({ _id: event.id }, function(error, result) { > //this line generates the error
if (error) {
sendResponse(error, null);
}
console.log("22 : ", result);
});
}
});
And this is database connection code:
var couchbase=require(‘couchbase’);
var ottoman=require(‘ottoman’);
var config = require(“./config”);
var myCluster = new couchbase.Cluster(config.couchbase.server);
module.exports.bucket = myCluster.openBucket(config.couchbase.bucket,function (error) {
if(error) {
console.log(error);
}
module.exports.bucket.operationTimeout=20000;
module.exports.bucket.n1qlTimeout=100000;
console.log(“Successfully opened igt bucket”);
ottoman.bucket = module.exports.bucket;
});
Ottoman npm package has other methods or functions to query user but all of them give the same error on query. Issue is we get the timeout error most of the times in the database connection when we execute the lambda function.
Below are few logs from our function and error:
2016-09-01T16:22:40.011Z 4d72d039-7060-11e6-9c97-f338272e12c8 Error: cannot perform operations on a shutdown bucket
at Bucket._maybeInvoke (/var/task/node_modules/couchbase/lib/bucket.js:1063:11)
at Bucket._n1ql (/var/task/node_modules/couchbase/lib/bucket.js:716:8)
at Bucket.query (/var/task/node_modules/couchbase/lib/bucket.js:948:17)
at CbStoreAdapter.find (/var/task/node_modules/ottoman/lib/cbstoreadapter.js:839:15)
at Ottoman._findModels (/var/task/node_modules/ottoman/lib/ottoman.js:593:16)
at Function.ModelInstance.find (/var/task/node_modules/ottoman/lib/modelinstance.js:659:23)
at exports.handler (/var/task/userForgotPasswordDev.js:21:14)
Also let me know from where can I get or generate more verbose logs to view and analyse the error.
Thanks.