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

Cluster class: when requesting a Query and bucket is not authenticate -> wrong exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.0
    • Fix Version/s: 2.5.1
    • Component/s: library
    • Labels:
    • Environment:
      .net visual studio 2017

      Description

      if you run that code:

       

       

      // var config = new ClientConfiguration()
      {
      Servers = new List<Uri> {
      <snip>
      },
       
       
      };
      Cluster cluster = new Cluster(config);
       
      var cred = new ClassicAuthenticator("Administrator","password");
      //cred.AddBucketCredential("buck", "");
      //cred.AddBucketCredential("travel-sample", "");
       
       
      cluster.Authenticate(cred);
       
      var qr = new QueryRequest().Statement("select * from buck;").Metrics(true);
      var result = cluster.Query<dynamic>(qr);
      

      and do not have the "AddBucketCredential" - query will fail with "Sequence has no elements" instead of an exception which is more informative like "Can't issue query, bucket is not authenticate" or something similar.

      Link:

      https://github.com/couchbase/couchbase-net-client/blob/master/Src/Couchbase/Cluster.cs#L270

       

       

       

        Attachments

        For Gerrit Dashboard: NCBC-1522
        # Subject Branch Project Status CR V

          Activity

          Hide
          jmorris Jeff Morris added a comment -

          Hi Roi Katz -

          Which server version are you using? Not sure if it matters, but...with RBAC.

          -Jeff

          Show
          jmorris Jeff Morris added a comment - Hi Roi Katz - Which server version are you using? Not sure if it matters, but...with RBAC. -Jeff
          Hide
          roi.katz Roi Katz added a comment -

          Hi,

          It was with 4.6.3.

          But I see it is already resolved.

          -Roi

          Show
          roi.katz Roi Katz added a comment - Hi, It was with 4.6.3. But I see it is already resolved. -Roi

            People

            • Assignee:
              jmorris Jeff Morris
              Reporter:
              roi.katz Roi Katz
            • 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

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.