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

ConnectAsync is failing "Cannot resolve DNS for localhost"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0.1
    • 3.0.0
    • library
    • None
    • Windows, Community Edition 6.5, .NET Core 3.1
    • 1

    Description

      Summary: When trying to use ConnectAsync, error "Cannot resolve DNS for localhost" This was reported on the forums - https://forums.couchbase.com/t/net-couchbase-client-3-0-issues/25591

      Repro:

      1. Install Couchbase Server locally (I'm using Community Edition on Docker). Credentials Administrator/password.
      2. Write a .NET app and use the "connect to cluster" instructions in the documentation https://docs.couchbase.com/dotnet-sdk/3.0/hello-world/start-using-sdk.html (I have attached a project that reproduces).
      3. Execute

      Expected:

      Connection to succeed and cluster object available for further use.

      Actual:

      Unhandled exception. Couchbase.Core.Exceptions.InvalidArgumentException: Cannot resolve DNS for localhost.
      at Couchbase.Utils.IpEndPointService.GetIpEndPointAsync(String hostNameOrIpAddress, Int32 port, CancellationToken cancellationToken)
      at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpoint endPoint, CancellationToken cancellationToken)
      at Couchbase.Core.ClusterContext.BootstrapGlobalAsync()
      at Couchbase.Cluster.Couchbase.Core.Bootstrapping.IBootstrappable.BootStrapAsync()
      at Couchbase.Cluster.ConnectAsync(ClusterOptions options)
      at ForumQuestions.Program.Main(String[] args) in C:\zproj\ForumQuestions\ForumQuestions\Program.cs:line 18
      at ForumQuestions.Program.<Main>(String[] args)
      ----------------------Context Info--------------------------
      null

      Notes:

      There is another issue reported in the same forum post. It might be related, but I don't know since I can't get past ConnectAsync.

      Attachments

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

        Activity

          People

            btburnett3 Brant Burnett
            matthew.groves Matthew Groves
            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