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

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.5.0
    • 2.5.1
    • library
    • .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

          jmorris Jeff Morris added a comment -

          Hi Roi Katz -

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

          -Jeff

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

          Hi,

          It was with 4.6.3.

          But I see it is already resolved.

          -Roi

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

          People

            jmorris Jeff Morris
            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