Levon Tamrazov
Levon Tamrazov

Reputation: 556

CouchbaseError: Client-Side timeout exceeded for operation

I am running couchbase server 3.0.1, with NodeJS SDK. I have set up a server with two buckets, and no documents. I opened a connections via:

var dbCluster = new couchbase.Cluster([my_host]); var db = dbCluster.openBucket( [my_bucket_name]);

When I try to execute 'db.upsert', I get the following error:

Error: CouchbaseError: Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout

Now the strangest part, is that the document still gets added. So the command executes successfully, but still returns the error. Also the call gets executed very fast, and definitely does not take 2.5 sec (default operation timeout).

Following this: Couchbase times out after few seconds I have tried increasing the timeout via:

db.operationTimeout = 5000;

This did not work. Again the call was executed successfully, but timeout error was returned even though the specified timeout did not pass (the call was very fast, much faster than 5 sec).

The only other support for this I could find is in this Google Groups, but it seems dead: https://groups.google.com/forum/#!topic/couchbase/scrTb94Mj3w

I am running OSX Yosemite 10.10.2. Any help would be really appreciated, as I do not know where to look next.

Thank you,

Here is the code for reference:

var couchbase = require('couchbase');

var dbCluster = new couchbase.Cluster("mylocalhostname");
var db = dbCluster.openBucket( "mybucketname", function(err){
    // no errors here
    if(err){
        console.log("Can't open bucket");
        throw err;
    }
    else {
        console.log("Successfully opened bucket");
    }
});

db.operationTimeout = 5000;

db.upsert("docname", someJSON, function(err, result){

    if(err){
        // get an error here, even though the call successfully executes
        return console.log("Error: " + err);
    }
});

Upvotes: 1

Views: 6101

Answers (2)

Eyal Zoref
Eyal Zoref

Reputation: 23

I had the same issue with CouchBase on AWS. I solved it by opening the following ports to anyone:

22 tcp 0.0.0.0/0 4369 tcp 0.0.0.0/0 4984 tcp 0.0.0.0/0 8080 tcp 0.0.0.0/0 8088 tcp 0.0.0.0/0 8091 tcp 0.0.0.0/0 8092 tcp 0.0.0.0/0 11209 tcp 0.0.0.0/0 11210 tcp 0.0.0.0/0 11211 tcp 0.0.0.0/0 11214 tcp 0.0.0.0/0 11215 tcp 0.0.0.0/0 18091 tcp 0.0.0.0/0 18092 tcp 0.0.0.0/0

For more info see: http://docs.couchbase.com/couchbase-manual-2.5/cb-install/#network-ports

Upvotes: 2

Levon Tamrazov
Levon Tamrazov

Reputation: 556

So turns out the problem was in the cluster connection. As per the documentation, I specified my connection as:

"couchbase://my.domain.com", where "my.domain.com" pointed to 127.0.0.7.

Removing "couchbase://" solved my issue. So connecting via:

"my.domain.com"

solved the problem. Interestingly enough, connecting via:

"couchbase://127.0.0.7"

also worked. Not sure how they are related, and how it was still able to update the document, but this solved it for me. Won't mark it as accepted yet, in case someone comes up with a more satisfying answer.

Upvotes: 1

Related Questions