Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-181

Misleading exception when replica server not found

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Duplicate
    • Minor
    • 1.1.2
    • 1.1.0
    • Core
    • Security Level: Public
    • None

    Description

      If the number of Couchbase servers is not enough to provide the required number of replicas (e.g. when installing a stand-alone server and forgetting to uncheck the 'Enable replicas' option), observe throws an ArrayIndexOutOfBoundsException. An exception with a more descriptive name would indicate the error cause more clearly.

      An example stack trace:

      ArrayIndexOutOfBoundsException: -1
      java.util.ArrayList.elementData(ArrayList.java:371)
      java.util.ArrayList.get(ArrayList.java:384)
      com.couchbase.client.vbucket.config.DefaultConfig.getServer(DefaultConfig.java:81)
      com.couchbase.client.vbucket.VBucketNodeLocator.getServerByIndex(VBucketNodeLocator.java:112)
      com.couchbase.client.CouchbaseClient.observe(CouchbaseClient.java:1621)
      com.couchbase.client.CouchbaseClient.observePoll(CouchbaseClient.java:1750)
      com.couchbase.client.CouchbaseClient.set(CouchbaseClient.java:1199)
      ...

      Attachments

        Issue Links

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

          Activity

            People

              daschl Michael Nitschinger
              schp schp
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty