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

Invalid password should raise AuthenticationFailedException instead it raises ServiceNotAvailableException

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.3.0
    • 3.2.4
    • None

    Description

       

      static async Task Main(string[] args)
       {
          try
           {
                var cluster = await Couchbase.Cluster.ConnectAsync("couchbase://localhost",          "Administrator", "password");
      var queryResult = await cluster.QueryAsync<dynamic>("select * from `travel-   sample`.inventory.airport limit 2");
          await foreach (var row in queryResult)
         {
          Console.WriteLine(row);
          }
       
       }
       catch (CouchbaseException ex)
       {
       Console.WriteLine(ex); 
       
       }
       catch (Exception ex)
       {
       Console.WriteLine(ex);
       
       }
      Console.Read();
       }
       
      

      The code above works as expected. However if you provide an incorrect password the exception thrown is ServiceNotAvailableException, instead it should be AuthenticationFailedException 

       

      Couchbase.ServiceNotAvailableException: Service n1ql not available.
       at Couchbase.Core.ClusterContext.GetRandomNodeForService(ServiceType service, String bucketName)
       at Couchbase.Core.ServiceUriProvider.GetRandomQueryUri()
       at Couchbase.Query.QueryClient.ExecuteQuery[T](QueryOptions options, ITypeSerializer serializer, IRequestSpan span)
       at Couchbase.Query.QueryClient.QueryAsync[T](String statement, QueryOptions options)
       at Couchbase.Cluster.<>c__DisplayClass33_0`1.<<QueryAsync>g__Func|0>d.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
       at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync[T](Func`1 send, IRequest request)
       at Couchbase.Cluster.QueryAsync[T](String statement, QueryOptions options)
       at ScopeLevelQuery.Program.Main(String[] args) in /Users/arun.vijayraghavan/ScopeLevelQuery/ScopeLevelQuery/Program.cs:line 24

       

      Attachments

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

        Activity

          People

            richard.ponton Richard Ponton
            arun.vijayraghavan Arun Vijayraghavan (Inactive)
            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