Couchbase Could Not Acquire Server

Hi, I’m stucked to connnect to my Production bucket using the .net SDK but have success to connect to bucket in the staging environment.

The diff is that production runs on Bucket that its inside in a Cluster 3 nodes.
The staging is a simple community bucket installation.

My Couchbase SDK Version is 2.5.9
My bucket versions is 5.0 staging and 5.5 production

My error is
“Could not acquire a server.”
" em Couchbase.Core.Buckets.RequestExecuterBase.GetServerWithRetry(Func1 getServer)\r\n em Couchbase.Core.Buckets.RequestExecuterBase.RetryRequest[TRequest,TResult](Func1 getServer, Func3 sendRequest, Func3 canRetry, TRequest request)\r\n em Couchbase.Core.Buckets.CouchbaseRequestExecuter.SendWithRetry[T](IQueryRequest queryRequest)"

I made some research and saw someone saying that my bucket or cluster reference can be disposed by garbage collector, so i made a recheck on my injection, but even if a add a call after the bucket instance the error happens
The code base i’m testing is in the image bellow, if a switch the IP of Production to STAGING its works:

Someone said that maybe its can be a firewall Issue I have run the sdk-doctor and saw that the connections are Okay (even with that confirmation i made a test in the machine pointing localhost with firewall disabled, indeed same error).
The output is

Any point i’m forgeting?

That seems unusual, you seem to have covered all of the normal bases in your diagnosis so far.

One point I’d make in your network/firewall testing is that access is required to all machines in the cluster, not just the one you’re connecting to. This includes domain name resolution to the names you see listed in the Couchbase UI on the Servers list, plus several firewall port numbers. SDK Doctor does test that, so it looks okay, but maybe you were running it from a different machine?

Also, you URI under Servers seems unusual. Since you’re using 2.5.9, I’d recommend switching to the ConnectionString approach. Instead of setting Servers, set ConnectionString to “couchbase://localhost”, no port number required. For your production cluster, make it a list of the nodes separated by commas “couchbase://node1,node2,node3”.

1 Like

@leonardo.kobus -

You might want to try enabling logging and seeing what is happening under the covers. Also, while you may be able to connect initially, the connections themselves are cached and reused internally; it is possible that something on the network is closing them.


1 Like

@btburnett3 you rocks!
I added the couchbase:// notation and worked, could not use comma separeted but i could use
new Uri(couchbase://node1),
new Uri(couchbase://node2)
worked too

Also Thanks for @jmorris that log interest me in other ways too. :slight_smile:

Really thank u guys.