Box to open Couchbase error - failed to load

I'm trying to connect to my couchbase server (Enterprise ver 4.6.2) and open the bucket using the .Net SDK, the code is very simple but still doesn't work:

        var cluster = new Cluster(new ClientConfiguration
        {
            Servers = new List<Uri> { new Uri("https://10.0.0.54:8091/") }
        });

        try
        {
            var bucket = cluster.OpenBucket("default");
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error getting bucket.");
            Console.WriteLine(ex.Message);
        }

      

Internal details of the exception I get:

Message

Object reference not set to an instance of an object

      

StackTrace

Couchbase.IO.Services.PooledIOService.CheckEnabledServerFeatures(IConnection connection)
   at Couchbase.IO.Services.PooledIOService..ctor(IConnectionPool connectionPool)
   at Couchbase.IO.IOServiceFactory.<>c__DisplayClass0_0.<GetFactory>b__0(IConnectionPool pool)
   at Couchbase.Configuration.Server.Providers.CarrierPublication.CarrierPublicationProvider.GetConfig(String bucketName, String username, String password)

      

The main exception I see is:

Could not bootstrap - check inner exceptions for details.

      

And the stack trace:

   at Couchbase.Core.ClusterController.CreateBucket(String bucketName, String username, String password, IAuthenticator authenticator)
   at Couchbase.Core.ClusterController.CreateBucket(String bucketName, IAuthenticator authenticator)
   at Couchbase.Cluster.OpenBucket(String bucketname)
   at Couchbase.Program.Main(String[] args)

      

Any idea what the problem is?

+3


source to share


1 answer


I had the same problem with Community edition. In my case, I didn't create a default bucket before trying to access it. Also, if your server / cluster or bucket requires credentials, you need to enter them as well.



+1


source







All Articles