0

I have written a ASP.NET MVC application that makes primitice use of couchbase 1.8. The application works when I run it in my dev environment but when I deploy it into my test environment then I get the following error.

System.NullReferenceException: Object reference not set to an instance of an object.
at Enyim.Caching.Memcached.DefaultKeyTransformer.Transform(String key) at
Enyim.Caching.Memcached.KeyTransformerBase.Enyim.Caching.Memcached.IMemcachedKeyTransforme
.Transform(String key) at Couchbase.CouchbaseClient.PerformStore(StoreMode mode,
String key, Object value, UInt32 expires, UInt64& cas, Int32& statusCode) at
Enyim.Caching.MemcachedClient.Store(StoreMode mode, String key, Object value, DateTime
expiresAt) at MyApp.AddInActiveSession(String key, DateTime expires)...

My config looks like this:

<couchbase>
  <servers bucket="default" bucketPassword="">
    <add uri="http://xxxxx:8091/pools"/>
  </servers>
</couchbase>

And the calling code is:

using (var client = new CouchbaseClient())            
{
  var session = client.Get<string>(idString);
  return session;
}

and

using (var client = new CouchbaseClient())
{
    client.Store(StoreMode.Set, idString,
    "Logged Out",
    expires);                
}

Does anyone have any clues what the issue is?

Dunc
  • 7,688
  • 10
  • 31
  • 38
  • Could you post your config and calling code? – John Zablocki Jul 06 '12 at 14:11
  • @JohnZablocki there you are. Let me know if you need anymore info? – Dunc Jul 09 '12 at 08:50
  • Given that stack trace and the code you posted, it's odd, but it appears that your key is null - DefaultKeyTransformer.Transform is the call that's breaking with a null reference exception. How do you generate idString? Also note that you don't want to use the CouchbaseClient in an instance-per-operation manner because there's an expensive handshake when you new up an instance - instead try a per-app-domain model (i.e., global static instance). – John Zablocki Jul 10 '12 at 16:01
  • Hey mate did you found solution to this problem as i am facing same issue – abhi Oct 14 '15 at 13:59
  • Possible duplicate of [Timeout when using remote couchbase an AWS ec2](http://stackoverflow.com/questions/22997837/timeout-when-using-remote-couchbase-an-aws-ec2) – Paul Sweatte Apr 28 '17 at 23:03

0 Answers0