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

bucket.collections().getAllScopes() throws wrong Exception for nonexistent bucket

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Major
    • None
    • 3.1.0
    • collections
    • None
    • 7.0.0-4603
    • 1

    Description

      FeatureNotAvailableException is incorrectly thrown when trying to get scopes for a nonexistent bucket

      WARN    2021-03-04 11:23:23,762 [cb-events] com.couchbase.endpoint  - [com.couchbase.endpoint][EndpointConnectionFailedEvent][305ms] Connect attempt 1 failed because of AuthenticationFailureException: Either the bucket with name "b" is not present or the user does not have the right privileges to access it {"bucket":"b","circuitBreaker":"CLOSED","coreId":"0xdbd794e700000001","remote":"172.23.104.16:11210","type":"KV"}
      com.couchbase.client.core.error.AuthenticationFailureException: Either the bucket with name "b" is not present or the user does not have the right privileges to access it {"bucket":"b","circuitBreaker":"CLOSED","coreId":"0xdbd794e700000001","remote":"172.23.104.16:11210","status":"NO_ACCESS","type":"KV"}
              at com.couchbase.client.core.io.netty.kv.SelectBucketHandler.channelRead(SelectBucketHandler.java:172)
              at com.couchbase.client.core.io.netty.kv.MemcacheProtocolVerificationHandler.channelRead(MemcacheProtocolVerificationHandler.java:84)
              at java.base/java.lang.Thread.run(Thread.java:835)
      INFO    2021-03-04 11:23:23,869 [cb-events] com.couchbase.node  - [com.couchbase.node][NodeDisconnectedEvent][641us] Node disconnected {"coreId":"0xdbd794e700000001","managerPort":"8091","remote":"172.23.104.16"}
      WARN    2021-03-04 11:23:23,972 [cb-events] com.couchbase.io  - [com.couchbase.io][SelectBucketFailedEvent] Select bucket failed with status code 0x24 {"bucket":"b","coreId":"0xdbd794e700000001","local":"/10.100.255.179:60014","remote":"172.23.104.16/172.23.104.16:11210"}
      INFO    2021-03-04 11:23:24,078 [cb-events] com.couchbase.node  - [com.couchbase.node][NodeConnectedEvent] Node connected {"coreId":"0xdbd794e700000001","managerPort":"8091","remote":"172.23.104.16"}
      INFO    2021-03-04 11:23:24,182 [cb-events] com.couchbase.node  - [com.couchbase.node][NodeConnectedEvent] Node connected {"coreId":"0xdbd794e700000001","managerPort":"8091","remote":"172.23.104.17"}
      INFO    2021-03-04 11:23:24,182 [cb-events] com.couchbase.node  - [com.couchbase.node][NodeConnectedEvent] Node connected {"coreId":"0xdbd794e700000001","managerPort":"8091","remote":"172.23.104.18"}
      INFO    2021-03-04 11:23:24,183 [cb-events] com.couchbase.node  - [com.couchbase.node][NodeConnectedEvent] Node connected {"coreId":"0xdbd794e700000001","managerPort":"8091","remote":"172.23.104.19"}
      INFO    2021-03-04 11:23:24,309 [main] com.couchbase.javaclient.DocOperations  - Invoke create
      INFO    2021-03-04 11:23:24,310 [ForkJoinPool-1-worker-3] com.couchbase.javaclient.reactive.DocCreate  - Upsert bucket collections
      INFO    2021-03-04 11:23:24,310 [ForkJoinPool-1-worker-3] com.couchbase.javaclient.reactive.DocCreate  - BEFORE GET ALL SCOPES
      ERROR   2021-03-04 11:23:24,358 [main] com.couchbase.javaclient.DocOperations  - com.couchbase.client.core.error.FeatureNotAvailableException: com.couchbase.client.core.error.FeatureNotAvailableException: The cluster does not support collections and scopes.
      

      public void upsertBucketCollections() {
      		List<Collection> bucketCollections = new ArrayList<>();
      		log.info("BEFORE GET ALL SCOPES");
      		List<ScopeSpec> bucketScopes = bucket.collections().getAllScopes();
      		log.info("AFTER GET ALL SCOPES");
      		for (ScopeSpec scope : bucketScopes) {
      			for (CollectionSpec scopeCollection : scope.collections()) {
      				Collection collection = bucket.scope(scope.name()).collection(scopeCollection.name());
      				if (collection != null) {
      					bucketCollections.add(collection);
      				}
      			}
      		}
      		bucketCollections.parallelStream().forEach(c -> upsert(c));
      	}
      

      Attachments

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

        Activity

          People

            pavithra.mahamani Pavithra Mahamani (Inactive)
            pavithra.mahamani Pavithra Mahamani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty