Saturday, 27 May 2017

Couchbase Node.js Client-Side timeout exceeded for operation, error code 23

I'm writing a simple Node.js API using express. My cluster connection appears to be working, and the bucket says that it's connected, but upsert is returning the following error:

{"message":"Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout","code":23}

My org currently has production code connecting to a different bucket in the same cluster, running python, and that's working fine, so I doubt it's a port problem (I'm using AWS).

Here's my connection code:

//Couchbase Server Details.
const bucket_name = 'bucket_name';
const cb_url = 'couchbase://my_url/';
const bucket_password = "my_password";

//set up couchbase
var couchbase = require('couchbase');
var cluster = new couchbase.Cluster();
console.log(cluster)
var bucket = cluster.openBucket(bucket_name, bucket_password, function(err) {
    if (err) {
        console.log("error!" + err);
    } else {
        console.log("it worked!")
    }
});

and here's my upsert code

bucket.upsert(uuid.v4(), my_json_object, function (err, result) {
          if (err) {
            res.end(JSON.stringify({message: err}));
            return;
          }
          res.end(JSON.stringify({message: 'transaction processed succesfully!'}));
      });

I've tried all of the suggestions I found on Stack overflow and Couchbase forums and nothing has worked.

Thanks guys



via Sam Wilks

No comments:

Post a Comment