Could you provide a bit more of your code so we can help you? Unfortunately there are a number of things that could cause this problem. You may also want to check and make sure that your bucket successfully opened (subscribe to the error event on the bucket, example below).
var cluster = new couchbase.Cluster('couchbase://127.0.0.1');
var bucket = cluster.openBucket('default');
bucket.on('error', function(err) {
console.log('Error connecting to Couchbase Server:', err);
});
In continuation to this issue, I understand that one is suppose to use the above solution to capture the thrown shutdown bucket error.
Otherwise the SDK crashes the process of my server (BTW, NEVER EVER NEVER DO THAT - THROW AN ERROR TO A CALLBACK!).
The issue is that I am to pass a function to capture the error and “log” it… but i don’t want to log it, I want to receive it as an error upon the specific operation I did, just like any other error.
Hey @tzali,
In the issue above, the user was opening a bucket connection, but the connection was failing. They were then trying to perform operations, which caused the specific operation to indicate that you cannot perform an operation on a shutdown bucket.
It sounds like your situation may be different than this. If you want to elaborate on your issue, I’d be happy to help.
This is what I do when my server uploads - I connect to Couchbase.
Then, when a user does something I execute this:
bucket.get(key, function(err, result) {…});
I expect that if for any reason the bucket is disconnected to receive an error in the err parameter. You SHOULD NOT THROW THE PROCESS _ YOU ARE KILLING THE SERVER THAT USES YOUR SDK!