Skip to content

unable to use the extension to connect to counchbase server (version 4.0.0-4051) #67

Description

@sfabid

Hi,

I tried the extension and it worked fine with the couchbase server 6.5.0 Enterprise edition. The problem surfaced when I tried connecting to the older couchbase server 4.0.0-4051.

Steps to reproduce:

  1. Create a new dotnet core webapi project.

  2. Add the Couchbase.Extensions.Caching package from nugget package manager.

  3. Go to the startup.cs to configure the Couchbase by doing the following:
    `
    services.AddCouchbase(option =>
    {
    option.Servers = new List
    {
    new Uri("http://couchbaseserverhostname:8091")
    };

         });
    

services.AddDistributedCouchbaseCache("bucketname", opt => {});
4. Goto to the controller where you want the caching to be used and inject the distributed cache and do the caching operation.
public class DistributedCacheController : ControllerBase
{
private readonly IDistributedCache _cache;
public DistributedCacheController(IDistributedCache cache)
{
_cache = cache;
}
[HttpPut]
public IActionResult Update([FromQuery]string key, [FromBody] string item)
{
_cache.SetString(key, JsonConvert.SerializeObject(item));
return Ok(id);
}
}
Note this works fine if I use this in the startup and connect to the couchbase server 6.5.0:
services.AddDistributedCouchbaseCache("bucketname","password", opt => {});
`

Expected result: the item should be added to the cache
Actual result: Gets an exception:
An unhandled exception occurred while processing the request.
BootstrapException: Could not bootstrap - check inner exceptions for details. (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) (Could not bootstrap with CCCP. (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)) (After bootstrapping the nodes list has zero elements indicating that client failed during bootstrapping. Please check the client logs for more information as for why it failed.)
Couchbase.Core.ClusterController.CreateBucketImpl(string bucketName, string password, IAuthenticator authenticator)

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
Couchbase.IO.DefaultConnectionFactory+<>c__0.b__0_0(IConnectionPool p, IByteConverter c, BufferAllocator b)

CouchbaseBootstrapException: After bootstrapping the nodes list has zero elements indicating that client failed during bootstrapping. Please check the client logs for more information as for why it failed.
Couchbase.Configuration.CouchbaseConfigContext.UpdateServices(Dictionary<IPEndPoint, IServer> servers)

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
Couchbase.IO.DefaultConnectionFactory+<>c__0.b__0_0(IConnectionPool p, IByteConverter c, BufferAllocator b)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions