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

ConnectAsync throws ArgumentNullException when cluster cannot be reached

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-beta.4
    • 3.0.2
    • library
    • None
    • 1
    • SDK14: Tracing/Otel

    Description

      If you attempt to connect to a cluster using an address that is unreachable, ClusterAsync throws an ANE because the DNS cannot be resolved; this should be handled better and propagate an error that points the user to a solution.

      System.ArgumentNullException : Value cannot be null.
      Parameter name: endPoint
         at Couchbase.Core.ClusterNode..ctor(ClusterContext context, IConnectionPoolFactory connectionPoolFactory, ILogger`1 logger, ITypeTranscoder transcoder, ICircuitBreaker circuitBreaker, ISaslMechanismFactory saslMechanismFactory, IRedactor redactor, IPEndPoint endPoint) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\ClusterNode.cs:line 51
         at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpoint endPoint, CancellationToken cancellationToken) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\DI\ClusterNodeFactory.cs:line 48
         at Couchbase.Core.ClusterContext.BootstrapGlobalAsync() in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Core\ClusterContext.cs:line 246
         at Couchbase.Cluster.Couchbase.Core.Bootstrapping.IBootstrappable.BootStrapAsync() in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Cluster.cs:line 375
         at Couchbase.Cluster.ConnectAsync(ClusterOptions options) in C:\Users\Jeff Morris\source\couchbase-net-client\src\Couchbase\Cluster.cs:line 119
         at Couchbase.IntegrationTests.Fixtures.ClusterFixture.InitializeAsync() in C:\Users\Jeff Morris\source\couchbase-net-client\tests\Couchbase.IntegrationTests\Fixtures\ClusterFixture.cs:line 70
      

      Attachments

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

        Activity

          This appears to be fixed, already.

          Using couchbase://www.couchbase.com, I get an appropriate error message,

          SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
          

          Using couchbase://HOST_THAT_DOES_NOT_EXIST, I get an appropriate error message.

          SocketException: No such host is known.
          

          richard.ponton Richard Ponton added a comment - This appears to be fixed, already. Using couchbase://www.couchbase.com, I get an appropriate error message, SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Using couchbase://HOST_THAT_DOES_NOT_EXIST, I get an appropriate error message. SocketException: No such host is known.

          People

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