Failed to connect to Node
I have installed Couchbse 2.0 server on my local box and .net driver 1.2.
Every time I try to connect to server and save the object (from same box) it gives "Failed to connect to server".
I read this thread (http://www.couchbase.com/forums/thread/unable-store-data-net-client) and tried everything whatever mentioned in it it does not work.
I tried uninstalling server copule of times and restarting the box, no luck.
I have specifically opened port 8091 for all traffics, that did not help either.
Please help.
Regards,
VB
I have this web.config section to read my couchbase connection properties in my custom class
<CacheConfig>
<CacheConfigElement StoreType="Couchbase" ConnectionString="http://localhost:8091/pools/" BucketName="default" BucketPassword="Administrator" >
<TypeElementCollection>
<TypeElement Name="Rms.Platform.Cache2.Test.Contract"/>
<TypeElement Name="Rms.Platform.Cache2.Test.Portfolio"/>
</TypeElementCollection>
</CacheConfigElement>
<!--<CacheConfigElement StoreType="Couchbase" ConnectionString="http://localhost:8091/pools/" BucketName="BucketName1" BucketPassword="Administrator" >
<TypeElementCollection>
<TypeElement Name="Rms.Platform.Cache2.Test.Contract1"/>
<TypeElement Name="Rms.Platform.Cache2.Test.Contract11"/>
</TypeElementCollection>
</CacheConfigElement>-->
The in this code I am trying to create connection
var config = new CouchbaseClientConfiguration
{
Bucket = CouchConfig.BucketName,
BucketPassword = CouchConfig.BucketPassword
};
config.Urls.Add(new Uri(CouchConfig.ConnectionString));
config.SocketPool.ConnectionTimeout = new TimeSpan(0, 0, 1, 0, 0);
config.SocketPool.DeadTimeout = config.SocketPool.ConnectionTimeout;
And this the save method.
public bool SaveObject<T>(string key, T singleObject) where T : class
{
if (Logger.IsDebugEnabled) { Logger.LogDebug("Start SaveObject"); }
try
{
ValidateKeys(new List<string> { key });
if (singleObject == null)
{
if (Logger.IsErrorEnabled) { Logger.LogError("Cache object is null."); }
throw new ArgumentException("Cache object is null.");
}
var result = CouchbaseClient.ExecuteStore(StoreMode.Set, key, singleObject);
if (result.Success)
{
return true;
}
if (result.Exception == null && !string.IsNullOrWhiteSpace(result.Message))
{
throw new Exception(result.Message);
}
throw result.Exception;
}
catch (Exception ex)
{
if (Logger.IsErrorEnabled) { Logger.LogError("Exception in SaveObject", ex); }
throw;
}
finally
{
if (Logger.IsDebugEnabled) { Logger.LogDebug("End SaveObject"); }
}
Hi Vishal,
It looks like you're using the default bucket in your app, but passing a bucket password to the client. Could you remove the BucketPassword line or set it to an empty string and try again? The "default" bucket in auth-less bucket.
-- jz
Even that was tried, it does not work
You can get detailed logs about any possible exceptions by setting up logging - http://www.couchbase.com/docs/couchbase-sdk-net-1.2/couchbase-sdk-net-lo.... The default bucket definitely won't work with a password, so make sure you do remove that. Even if that's not the underlying cause, it will cause problems.
Hi,
can you please post the snippet where you are connecting to the server?