Couchbase .Net driver issues "Unable to locate node"

2.1k views Asked by At

I've installed Couchbase server on Amazon EC2 and trying to build a client with VisualStudio C#.

Couchbase is accessible from my computer via web interface. I can add and modify data. But from C# it doesn't work: getting "Unable to locate node" error. At the same time Fiddler shows that some "handshaking" is taking place: my test program is getting some metadata while establishing a connection with Couchbase. But any attempt to read or write data fails.

Following ports are open: 11211,8091,8092,22,11210,21100 - 21299,11209,4369 (but turning firewall off doesn't seem to help)

Below is my testing program. Any help is very much appreciated.

App.config:

<configuration>
  <configSections>
    <section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
  </configSections> 
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <couchbase>
  <servers bucket="mybucket" username="Administrator" password="xxxxxxxxx">
    <add uri="http://XXX.XXX.XXX.XXX:8091/pools"/>
  </servers>
  </couchbase>
</configuration>

code:

public static void Run()
{
    System.Configuration.Configuration cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
    ICouchbaseClientConfiguration section = cfg.GetSection("couchbase") as ICouchbaseClientConfiguration;
    using (CouchbaseClient client = new CouchbaseClient(section))
    {
        MyData mydata= new MyData();
        mydata.MyName= "bla-bla";
        IStoreOperationResult res = client.ExecuteStore(StoreMode.Set, "1", mydata);
        System.Diagnostics.Debug.WriteLine("*************************************************************");
        if (!res.Success)
            System.Diagnostics.Debug.WriteLine(res.Message); // writes "Unable to locate node"
    }
}
3

There are 3 answers

0
humanity On

Found this - it affected me exactly the same.

http://www.couchbase.com/communities/q-and-a/unable-locate-node-error-net-sdk

Edit: The above link is busted. Here's where it is now. https://forums.couchbase.com/t/unable-to-locate-node-error-net-sdk/258

0
tungnt185 On

Another problem can lead to this error is blocked by firewall in development environment. You can resolve this by bypass couchbase ip server in IE: Tools/Internet Options/Connections/LAN Settings/Advanced/Exceptions.

Regards.

0
scalabilitysolved On

You probably need to follow the documentation here which describes using hostnames in the cloud as opposed to ip addresses, see if that helps!

EDIT: Actually use the following article, specifically how to set up the couchbase node names using the public dns! http://blog.couchbase.com/cross-data-center-replication-step-step-guide-amazon-aws

I'll leave the following links that point to the higher level official documentation.

Couchbase in the cloud overview: http://docs.couchbase.com/couchbase-manual-2.2/#handling-changes-in-ip-addresses

Couchbase hostname configuration: http://docs.couchbase.com/couchbase-manual-2.2/#couchbase-getting-started-hostnames