Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-210

.NET Client is throwing NullReferenceExceptions (CBSE-341)


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: library
    • Labels:


      Issue is raised by a customer in ticket CBSE-341 (http://www.couchbase.com/issues/browse/CBSE-341), the details are mentioned in the ticket itself.

      Following are the observations related to the issue:

      --> when we create a client with bucket which doesn't exist, the error message should be more appropriate like "Bucket does not exist" and the code should simply exit with a false status. Currently it throws an exception and the error message that comes is "Object reference not set to an instance of an object.".

      Error source : Couchbase.CouchbasePool.Enyim.Caching.Memcached.IServerPool.Locate(String key)
      Couchbase.CouchbaseClient.PerformStore(StoreMode mode, String key, Object value, UInt32 expires, UInt64& cas, Int32& statusCode)
      Enyim.Caching.MemcachedClient.Store(StoreMode mode, String key, Object value)
      May be we need to add some condition that checks whether node (returned from Locate()) in null or not. If null, it should not proceed further to perform store operation. It should return apt message and simply exit with false status.

      --> Rebalance operation takes quite some time. During this operation, the server nodes may become unavailable for sometime or even get removed from the cluster and hence the bucket is also not available. Exception is thrown "Object reference not set to an instance of an object)". Error source same as above : Couchbase.CouchbasePool.Enyim.Caching.Memcached.IServerPool.Locate(String key)

      --> Refer to the attached sample code, I used my cluster which has following server nodes:
      In the code Program.cs, use the bucket name that does not exist, the code will throw the exception.
      Next use the correct bucket name but manually fail over a node & start rebalance. It will throw the exception.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.


        john John Zablocki (Inactive) added a comment - http://www.couchbase.com/issues/browse/NCBC-192
        saakshi.manocha Saakshi Manocha added a comment -

        sample code to reproduce issue

        saakshi.manocha Saakshi Manocha added a comment - sample code to reproduce issue


          • Assignee:
            saakshi.manocha Saakshi Manocha
            saakshi.manocha Saakshi Manocha
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created:

              Gerrit Reviews

              There are no open Gerrit changes