Invalid password should raise AuthenticationFailedException instead it raises ServiceNotAvailableException

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

 

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Story Points

Sprint

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created November 11, 2021 at 10:13 PM
Updated April 22, 2022 at 7:57 PM
Resolved April 20, 2022 at 10:31 PM
Instabug