Cannot connect to a working cluster

Hi All,

I have a cluster of three nodes running 2.0.1 enterprise edition (build-170) set up using hostnames.

I also have a basic console app with Main method as follows:

var c = new CouchbaseClientConfiguration();

c.Urls.Add(new Uri(“”));
c.Username = “Administrator”;
c.Password = “qwerty”;

var cluster = new CouchbaseCluster©;
var buckets = cluster.ListBuckets();

ListBuckets throws ArgumentNullException with message “Value cannot be null.\r\nParameter name: uri” and the following stack trace:

   at Couchbase.Helpers.HttpHelper.doRequest(Uri uri, String verb, String username, String password, String postData, String contentType)
   at Couchbase.Helpers.HttpHelper.doRequest(Uri uri, String verb, String username, String password)
   at Couchbase.Helpers.HttpHelper.Get(Uri uri, String username, String password)
   at Couchbase.Management.CouchbaseCluster.ListBuckets()
   at TestApp.Program.Main(String[] args) in C:\Development\TestApp\Program.cs:line 22

I believe it has to do with the bootstrapping process within the CouchbaseCluster class. Running the same with a CouchbaseClient and pulling a view from a bucket works perfectly.

I’m using Couchbase .NET Client v1.2.6.0. I can connect through the console and I am running several systems that are successfully using the Java Client already,

Has anybody encountered this? What am I doing wrong?


I have done some basic test and do not have this issue, I can in the same console application use the cluster and a client.

Do you have the full class?


This is my Program.cs:

using Couchbase.Configuration;
using Couchbase.Management;
using System;

namespace TestApp
class Program
static void Main(string[] args)

        var c = new CouchbaseClientConfiguration();
        c.Urls.Add(new Uri(""));
        c.Username = "Administrator";
        c.Password = "qwerty";
        var cluster = new CouchbaseCluster(c);
        var buckets = cluster.ListBuckets();


I found it!

Within the CouchbaseCluster source, you will find this function:

private Uri getPoolsUri(Uri bootstrapUri)
var bucketUri = ConfigHelper.CleanBootstrapUri(bootstrapUri);

//GET /pools
var json = HttpHelper.Get(bucketUri);
var pools = ClusterConfigParser.ParseNested<object[]>(json, "pools");
var path = (pools.First() as Dictionary<string, object>)["uri"] as string;

return UriHelper.Combine(getAuthority(bootstrapUri), path);


Note the non-authenticated call in HttpHelper.Get(bucketUri). For this to work, it requires the cluster to have at least one bucket without a password. This looks like a bug - the first thing we did is to secure all buckets.

Two ways to solve it:

  1. If you need to use the stock client libraries, create a memcached bucket called “default” and limit it to 100MB so it does not consume your server RAM without being used. This will make the clients work.

  2. If you cannot afford an unprotected bucket, download the latest stable release from Github, find the CouchbaseCluster.cs, find the “private Uri getPoolsUri(Uri bootstrapUri)” method and within locate the “HttpHelper.Get(bucketUri);” call.

Change that call to:

var json = HttpHelper.Get(bucketUri, _username, _password);

… and you are done!