Unable to connect to Bucket Couchbase server with dotnet sdk

Hi All,

I am facing bucket not found or its unreachable issue when i try to connect the bucket from dotnet SDK. Please help me out to resolve the issue.

Platform: Ubuntu 18.04 server
Couchbase edition: community v7.0.2 build 6703
Trying to access from: Dotnet core 3.1 (Console app)
Installed SDK: 3.2.7
Line i am getting error: var bucket = await cluster.BucketAsync(bucketName);

SDK Doctor Log:

|====================================================================|

| ___ ___ _ __ ___ ___ ___ _____ ___ ___ |

| / | | |/ /| \ / _ \ / _| _/ _ | _ \ |

| __ \ |) | ’ <| |) | () | ( | || (_) | / |

| |//||_\ |/ _/ _| |_| _/||\ |

| |

|====================================================================|

Note: Diagnostics can only provide accurate results when your cluster

is in a stable state. Active rebalancing and other cluster configuration

changes can cause the output of the doctor to be inconsistent or in the

worst cases, completely incorrect.

18:50:47.288 INFO :arrow_forward: Parsing connection string couchbases://ip_address

18:50:47.294 INFO :arrow_forward: Connection string specifies to use secured connections

18:50:47.294 INFO :arrow_forward: Connection string identifies the following CCCP endpoints:

18:50:47.295 INFO :arrow_forward: 1. ip_address:11207

18:50:47.296 INFO :arrow_forward: Connection string identifies the following HTTP endpoints:

18:50:47.297 INFO :arrow_forward: 1. ip_address:18091

18:50:47.300 INFO :arrow_forward: Connection string specifies bucket ``

18:50:47.305 WARN :arrow_forward: No certificate authority file specified (–tls-ca), skipping server certificate verification for this run.

18:50:47.305 WARN :arrow_forward: Your connection string specifies only a single host. You should consider adding additional static nodes from your cluster to this list to improve your applications fault-tolerance

18:50:47.306 INFO :arrow_forward: Performing DNS lookup for host ip_address

18:50:47.306 INFO :arrow_forward: Attempting to connect to cluster via CCCP

18:50:47.307 INFO :arrow_forward: Attempting to fetch config via cccp from ip_address:11207

18:50:49.308 ERRO :arrow_forward: Failed to fetch configuration via cccp from ip_address:11207 (error: dial tcp ip_address:11207: i/o timeout)

18:50:49.308 INFO :arrow_forward: Attempting to connect to cluster via HTTP (Terse)

18:50:49.310 INFO :arrow_forward: Attempting to fetch terse config via http from ip_address:18091

18:50:51.314 ERRO :arrow_forward: Failed to fetch terse configuration via http from ip_address:18091 (error: Get “http://ip_address:18091/pools/default/b/”: context deadline exceeded (Client.Timeout exceeded while awaiting headers))

18:50:51.314 INFO :arrow_forward: Attempting to connect to cluster via HTTP (Full)

18:50:51.316 INFO :arrow_forward: Failed to connect via HTTP (Full), as it is not yet supported by the doctor

18:50:51.320 INFO :arrow_forward: Selected the following network type:

18:50:51.320 ERRO :arrow_forward: All endpoints specified by your connection string were unreachable, further cluster diagnostics are not possible

18:50:51.321 INFO :arrow_forward: Diagnostics completed

Summary:

←[33m[WARN]←[0m No certificate authority file specified (–tls-ca), skipping server certificate verification for this run.

←[33m[WARN]←[0m Your connection string specifies only a single host. You should consider adding additional static nodes from your cluster to this list to improve your applications fault-tolerance

←[31m[ERRO]←[0m Failed to fetch configuration via cccp from ip_address:11207 (error: dial tcp ip_address:11207: i/o timeout)

←[31m[ERRO]←[0m Failed to fetch terse configuration via http from ip_address:18091 (error: Get “http://ip_address:18091/pools/default/b/”: context deadline exceeded (Client.Timeout exceeded while awaiting headers))

←[31m[ERRO]←[0m All endpoints specified by your connection string were unreachable, further cluster diagnostics are not possible

Found multiple issues, see listing above.

Here is the stacktrace:
StackTrace " at Couchbase.Core.ClusterContext.d__58.MoveNext()\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Threading.Tasks.ValueTask1.get_Result()\r\n at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable1.ConfiguredValueTaskAwaiter.GetResult()\r\n
at Couchbase.Cluster.<>c__DisplayClass30_0.<b__0>d.MoveNext()\r\n
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n
at System.Threading.Tasks.ValueTask1.get_Result()\r\n at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable1.ConfiguredValueTaskAwaiter.GetResult()\r\n

Code:

image

image1252×666 39.6 KB

Getting error on the highlighted line

Dot net SDK log using Ilogger service:

022-02-04T17:55:04.4168879+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T17:55:04.8182813+05:30 [INF] There was an error attempting to resolve hosts using DNS-SRV - “Non-Existent Domain” (9daf8ee2)

2022-02-04T17:55:04.8209168+05:30 [DBG] Bootstrapping with node “10.0.0.4” (98ca0e33)

2022-02-04T17:55:06.9453887+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T17:55:06.9459714+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T17:55:09.4544395+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T17:55:09.4547490+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T17:55:11.9653667+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T17:55:11.9656025+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T17:55:14.4767948+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T17:55:14.4783201+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T17:56:26.6747204+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T17:56:27.0653344+05:30 [INF] There was an error attempting to resolve hosts using DNS-SRV - “Non-Existent Domain” (9daf8ee2)

2022-02-04T17:56:27.0673873+05:30 [DBG] Bootstrapping with node “ip_address” (98ca0e33)

2022-02-04T17:56:29.2001344+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T17:56:29.2006203+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T17:56:31.7143507+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T17:56:31.7146322+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T17:56:34.2258917+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T17:56:34.2261256+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T17:56:36.7306773+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T17:56:36.7308615+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:08.2714886+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:10.8043246+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:10.8048323+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:13.3179654+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:13.3182655+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:15.8255144+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:15.8257825+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:18.3397437+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:18.3401505+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:20.8546040+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:20.8548508+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:23.3703691+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:23.3708658+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:23.4945069+05:30 [INF] Error trying to retrieve DNS SRV entries. (addddf06)

DnsClient.DnsResponseException: Query 64785 => _couchbase._tcp.ip_address IN SRV on 192.168.8.1:53 timed out or is a transient error.

—> System.OperationCanceledException: The operation was canceled.

at System.Threading.Tasks.TaskExtensions.WithCancellation[T](Task`1 task, CancellationToken cancellationToken, Action onCancel)

at DnsClient.LookupClient.ResolveQueryAsync(IReadOnlyList`1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit audit, CancellationToken cancellationToken)

— End of inner exception stack trace —

at DnsClient.LookupClient.ResolveQueryAsync(IReadOnlyList`1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit audit, CancellationToken cancellationToken)

at DnsClient.LookupClient.QueryInternalAsync(DnsQuestion question, DnsQuerySettings queryOptions, IReadOnlyCollection`1 servers, CancellationToken cancellationToken)

at Couchbase.DnsClientDnsResolver.GetDnsSrvEntriesAsync(Uri bootstrapUri, CancellationToken cancellationToken)

at Couchbase.Core.ClusterContext.BootstrapGlobalAsync()

2022-02-04T18:06:23.4959924+05:30 [DBG] Bootstrapping with node “ip_address” (98ca0e33)

2022-02-04T18:06:25.8861248+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:25.8864816+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:28.3964098+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:28.3966407+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:30.9124005+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:30.9127205+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:33.4132269+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:33.4136058+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:33.6984760+05:30 [DBG] Attempted bootstrapping on endpoint “ip_address” has failed. (e80489ed)

System.Net.Sockets.SocketException (10060): 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.

at Couchbase.Core.IO.Connections.ConnectionFactory.CreateAndConnectAsync(HostEndpointWithPort hostEndpoint, CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.ConnectionPoolBase.CreateConnectionAsync(CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.<>c__DisplayClass30_0.<g__StartConnection|0>d.MoveNext()

— End of stack trace from previous location where exception was thrown —

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.AddConnectionsAsync(Int32 count, CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.InitializeAsync(CancellationToken cancellationToken)

at Couchbase.Core.ClusterNode.InitializeAsync()

at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpointWithPort endPoint, BucketType bucketType, NodeAdapter nodeAdapter, CancellationToken cancellationToken)

at Couchbase.Core.ClusterContext.BootstrapGlobalAsync()

2022-02-04T18:06:35.9138427+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:35.9140652+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:38.4150857+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:38.4152298+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:40.9168835+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:40.9171448+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:43.4295840+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:43.4297382+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:43.7951617+05:30 [INF] Cannot bootstrap bucket “test” as Couchbase. (1ecb21a9)

System.Net.Sockets.SocketException (10060): 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.

at Couchbase.Core.IO.Connections.ConnectionFactory.CreateAndConnectAsync(HostEndpointWithPort hostEndpoint, CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.ConnectionPoolBase.CreateConnectionAsync(CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.<>c__DisplayClass30_0.<g__StartConnection|0>d.MoveNext()

— End of stack trace from previous location where exception was thrown —

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.AddConnectionsAsync(Int32 count, CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.InitializeAsync(CancellationToken cancellationToken)

at Couchbase.Core.ClusterNode.InitializeAsync()

at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpointWithPort endPoint, BucketType bucketType, NodeAdapter nodeAdapter, CancellationToken cancellationToken)

at Couchbase.Core.ClusterContext.CreateAndBootStrapBucketAsync(String name, HostEndpointWithPort endpoint, BucketType type)

at Couchbase.Core.ClusterContext.GetOrCreateBucketAsync(String name)

2022-02-04T18:06:45.9440290+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:45.9442162+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:48.4446238+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:48.4447723+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:50.9600492+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:50.9601938+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:53.4776688+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:53.4784582+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:53.8112898+05:30 [INF] Cannot bootstrap bucket “test” as Memcached. (1ecb21a9)

System.Net.Sockets.SocketException (10060): 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.

at Couchbase.Core.IO.Connections.ConnectionFactory.CreateAndConnectAsync(HostEndpointWithPort hostEndpoint, CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.ConnectionPoolBase.CreateConnectionAsync(CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.<>c__DisplayClass30_0.<g__StartConnection|0>d.MoveNext()

— End of stack trace from previous location where exception was thrown —

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.AddConnectionsAsync(Int32 count, CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.InitializeAsync(CancellationToken cancellationToken)

at Couchbase.Core.ClusterNode.InitializeAsync()

at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpointWithPort endPoint, BucketType bucketType, NodeAdapter nodeAdapter, CancellationToken cancellationToken)

at Couchbase.Core.ClusterContext.CreateAndBootStrapBucketAsync(String name, HostEndpointWithPort endpoint, BucketType type)

at Couchbase.Core.ClusterContext.GetOrCreateBucketAsync(String name)

2022-02-04T18:06:55.9969802+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:55.9970995+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:06:58.5069802+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:06:58.5070858+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:07:01.0107038+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:07:01.0108372+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:07:03.5209183+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:07:03.5210410+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:07:03.8332560+05:30 [INF] Cannot bootstrap bucket “test” as Ephemeral. (1ecb21a9)

System.Net.Sockets.SocketException (10060): 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.

at Couchbase.Core.IO.Connections.ConnectionFactory.CreateAndConnectAsync(HostEndpointWithPort hostEndpoint, CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.ConnectionPoolBase.CreateConnectionAsync(CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.<>c__DisplayClass30_0.<g__StartConnection|0>d.MoveNext()

— End of stack trace from previous location where exception was thrown —

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.AddConnectionsAsync(Int32 count, CancellationToken cancellationToken)

at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.InitializeAsync(CancellationToken cancellationToken)

at Couchbase.Core.ClusterNode.InitializeAsync()

at Couchbase.Core.DI.ClusterNodeFactory.CreateAndConnectAsync(HostEndpointWithPort endPoint, BucketType bucketType, NodeAdapter nodeAdapter, CancellationToken cancellationToken)

at Couchbase.Core.ClusterContext.CreateAndBootStrapBucketAsync(String name, HostEndpointWithPort endpoint, BucketType type)

at Couchbase.Core.ClusterContext.GetOrCreateBucketAsync(String name)

2022-02-04T18:07:08.2145387+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:07:08.2155421+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

2022-02-04T18:07:11.3506140+05:30 [DBG] Done waiting, polling… (93018145)

2022-02-04T18:07:11.3511237+05:30 [DBG] Waiting for 00:00:02.5000000 before polling. (c8639b24)

I am not getting what exactly went wrong please help me out.

Thanks!!