Uploaded image for project: 'Java Couchbase JVM Core'
  1. Java Couchbase JVM Core
  2. JVMCBC-354

Retrieving design documents from a non-data node causes a null pointer exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.3.2
    • 1.3.1
    • Services
    • None

    Description

      When using the method 'bucket.bucketManager().getDesignDocuments()' when there are non-data nodes present in the cluster causes a null pointer exception to be thrown:

      Exception in thread "main" java.lang.NullPointerException
      	at com.couchbase.client.java.bucket.DefaultAsyncBucketManager$3.call(DefaultAsyncBucketManager.java:161)
      	at com.couchbase.client.java.bucket.DefaultAsyncBucketManager$3.call(DefaultAsyncBucketManager.java:150)
      	at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:66)
      	at rx.observers.Subscribers$5.onNext(Subscribers.java:229)
      	at rx.internal.producers.SingleProducer.request(SingleProducer.java:65)
      	at rx.Subscriber.setProducer(Subscriber.java:211)
      	at rx.internal.operators.OperatorMap$MapSubscriber.setProducer(OperatorMap.java:99)
      	at rx.Subscriber.setProducer(Subscriber.java:205)
      	at rx.subjects.AsyncSubject.onCompleted(AsyncSubject.java:105)
      	at com.couchbase.client.core.endpoint.AbstractGenericHandler.completeResponse(AbstractGenericHandler.java:348)
      	at com.couchbase.client.core.endpoint.AbstractGenericHandler.access$000(AbstractGenericHandler.java:66)
      	at com.couchbase.client.core.endpoint.AbstractGenericHandler$1.call(AbstractGenericHandler.java:366)
      	at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.core.message.config.GetDesignDocumentsResponse.class
      	at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:109)
      	at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:70)
      	... 17 more
      

      I have attached debug level logging with this failure (NPE_failure.log).

      Interestingly it only seems to occur if the node that I connect to in my bootstrap list is non-data.
      If I change my code to bootstrap off of the data node then I don't have this problem, I have attached the log as NPE_success.log.

      The code to reproduce this is very simple:

      import com.couchbase.client.java.Bucket;
      import com.couchbase.client.java.CouchbaseCluster;
       
      public class Main {
          public static void main(String[] args){
              Bucket bucket = CouchbaseCluster.create("10.142.150.101").openBucket("beer-sample");
              System.out.println(bucket.bucketManager().getDesignDocuments());
          }
      }
      

      Attachments

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

        Activity

          People

            simonbasle Simon Baslé (Inactive)
            matt.carabine Matt Carabine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty