Very slow connection to bucket and zero results

Hi,
I’m trying to use the following .net console app for testing, but it seems to take about 50 seconds to connect and the result is empty, although the view seems to work in the web console:

var config = new ClientConfiguration();
    config.Servers = new List<Uri>(){new Uri("http://MY PUBLIC IP:8091/pools")};
    //config.ApiPort = 8091; ??????
    //config.DirectPort = 8091; ??????
   
    using (var _cluster = new Cluster(config))
    {
        using (var bucket = _cluster.OpenBucket("MY BUCKET NAME", "MY PASS"))
        {
            var document = bucket.GetDocument<Object>("20b948ad-2807-4f0c-8b10-179f93a07b12");
            Console.Write(document.ToString());
///here the document is null and I get the exception
The node MY PUBLIC IP:11210 that the key was mapped to is either down or unreachable. The SDK will continue to try to connect every 1000 seconds. Until it can connect every operation routed to it will fail with this exception

     var query = bucket.CreateQuery("CataDesign", "NrInregistrareAn").Limit(50);

    var result = bucket.Query<dynamic>(query);
    foreach (var row in result.Rows)
    {
///result.Rows = 0
        Console.WriteLine(row);
    }
        }
        _cluster.Dispose();
    }

If it matters - the database on the couchbase server was created as a mean for replication between mobile clients (couchbase lite) and I’m trying now to query this database from the server. The replication works ok and I can create a new development and production (using the web consoled) view that display sample data.

  • server: 3.0.1 Community Edition (build-1444)
  • .net client: 2.1.1.0

My questions:

  • should I change the ports (ApiPort and DirectPort) from their defaults?
  • what ports should be opened in the firewall (I can already access the web console on port 8091 using my public IP)

Thank you,
Catalin

@icm76 -

It looks like the client is having a problems connecting or maintaining connections with the cluster. Make sure the Uri in the servers list works correctly (try a browser) and perhaps check if your anti-virus or firewall isn’t blocking the client.

You shouldn’t have to change the ApiPort or DirectPort. Here is a list of ports that CB and the SDKs use: http://docs.couchbase.com/admin/admin/Install/install-networkPorts.html

You can enable logging and that may also help diagnose the problem: http://docs.couchbase.com/developer/dotnet-2.1/setting-up-logging.html

-Jeff

The first time I saw this, I had accidentally NOT checked off the Query Service on the only node in my single node cluster, so I effectively had a Cluster Without Query. If that’s your situation, you’ll basically find that the Query Service is NOT listening on its assigned ports.

Make sure your cluster has a node that is running the Query service, and make sure port 8091 and 8092 are open for starters, for all the IPs of the nodes in your cluster.

Warren

Thank you,

I’ve succeeded after I’ve enabled logging and then I’ve opened some ports

Catalin