Uploaded image for project: 'Java DCP Client'
  1. Java DCP Client
  2. JDCP-67

NPE in Conductor.masterChannelByPartition when SSL is enabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 0.14.0
    • 0.12.0
    • None
    • DCP Client version 0.12.0
      Core IO version 1.5.3
      Java SDK version 2.5.3
      Server 5.0.0
    • 1

    Description

      Connection fails if SSL is enabled. 

      Forum thread: https://forums.couchbase.com/t/java-dcp-client-throw-nullpointerexception-when-ssl-is-enabled/15494

      As reported by community member shen.jin:

      Stack trace of NPE is:

      Exception in thread "main" java.lang.NullPointerException
      	at com.couchbase.client.dcp.conductor.Conductor.masterChannelByPartition(Conductor.java:290)
      	at com.couchbase.client.dcp.conductor.Conductor.access$500(Conductor.java:56)
      	at com.couchbase.client.dcp.conductor.Conductor$11.call(Conductor.java:208)
      	at com.couchbase.client.dcp.conductor.Conductor$11.call(Conductor.java:205)
      	at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
      	at rx.internal.util.ScalarSynchronousObservable$WeakSingleProducer.request(ScalarSynchronousObservable.java:276)
      	at rx.Subscriber.setProducer(Subscriber.java:211)
      

      in my debug I see that client received config from server

      {“rev”:4163,“name”:“myRater”,“uri”:"/pools/default/buckets/myRater?bucket_uuid=c6041a71b30ddc09e58ae5eb69ebd789",“streamingUri”:"/pools/default/bucketsStreaming/myRater?bucket_uuid=c6041a71b30ddc09e58ae5eb69ebd789",“nodes”:[{“couchApiBase”:“http://:8092$HOST/myRater%2Bc6041a71b30ddc09e58ae5eb69ebd789",“hostname”:"$HOST:8091",“ports”:{“proxy”:11211,“direct”:11210}}],“nodesExt”:[{“services”:{“mgmt”:8091,“mgmtSSL”:18091,“indexAdmin”:9100,“indexScan”:9101,“indexHttp”:9102,“indexStreamInit”:9103,“indexStreamCatchup”:9104,“indexStreamMaint”:9105,“indexHttps”:19102,“capiSSL”:18092,“capi”:8092,“kvSSL”:11207,“projector”:9999,“kv”:11210,“moxi”:11211,“n1ql”:8093,“n1qlSSL”:18093},“thisNode”:true}],“nodeLocator”:“vbucket”,“uuid”:“c6041a71b30ddc09e58ae5eb69ebd789”,“ddocs”:{“uri”:"/pools/default/buckets/myRater/ddocs"},“vBucketServerMap”:{“hashAlgorithm”:“CRC”,“numReplicas”:0,“serverList”:["$HOST:11210"],“vBucketMap”:[[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0]]},“bucketCapabilitiesVer”:"",“bucketCapabilities”:[“xattr”,“dcp”,“cbhello”,“touch”,“couchapi”,“cccp”,“xdcrCheckpointing”,"nodesExt”]}
      

      Then a copy of NodeInfo without sslService is first created, then another instance with sslService is created in AbstractBucketConfig constructor. However when Conductor code throws NPE

      NodeInfo node = config.nodeAtIndex(index);
      for (DcpChannel ch : channels) {
      InetSocketAddress address = new InetSocketAddress(node.hostname().nameOrAddress(),
      (env.sslEnabled() ? node.sslServices() : node.services()).get(ServiceType.BINARY));
      

      config.nodeAtIndex(index) call returns the NodeInfo instance without sslService, causing a null in map get.

      Attachments

        Issue Links

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

          Activity

            People

              david.nault David Nault
              david.nault David Nault
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty