Details
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:
- Install Couchbase Server locally (I'm using Community Edition on Docker). Credentials Administrator/password.
- 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).
- 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
For Gerrit Dashboard: NCBC-2462 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
126819,3 | NCBC-2462: Consistently resolve localhost | master | couchbase-net-client | Status: MERGED | +2 | +1 |