How to fix "View XXX was mapped to a dead node, failing."

Hi all,
Sorry for my bad English but I have a big problem in accessing data in Couchbase and I’d like to be helped from experts in this forum.
I use .net Sdk 1.3.10 and Couchbase 3.0.1 CE, Windows 7(my local machine), Windows server 2008(my server). Everyday I get this exception several times when I accessing data from my program with both GetView(…)/GetView(…).Stale(StaleMode.False) and StoreJson(…). This problem has made me to be nervous with no solution to fix. I’ve faced this problem since last year when I used Couchbase version 2.2 CE.

Pls help me, thanks in advance.

could you add the exception you are getting to this post?

Dear cihangirb,
I get the originally exception content is “View xxx was mapped to a dead node, failing.”, xxx is one of many view in my Couchbase. This situation happens quite often even if i didn’t restart the machine. I still accessed the Couchbase Console normally, and the view had queried data.

@ntphongnt -

What type of application is this (ASP.NET/IIS)? Where in the project (i.e. Global.asax?) are you initializing the client?

-Jeff

hi jmorris,
i use a .net library project as Data Access Layer to retrieve data in Couchbase, this dll is call via a windows service, of course I initialize object before make a call function. Most of query is ok but sometimes it failed with this exception.

@ntphongnt -

Do you store the CouchbaseClient reference and reuse it or recreate it for every request? A best practice is to create the CouchbaseClient object at application startup and reuse it for the duration of the applications lifetime and then destroy as the application (process) is torn down. There should usually be a 1:1 mapping of CouchbaseClient references/instances to processes using it.

You mentioned “call via a windows service” is this a WCF service or service deriving from ServiceBase? If it’s ServiceBase then make the CouchbaseClient a instance of your derived class and create it within the OnStart event and destroy in OnStop. If you use OnPause or OnContinue you can also probably destroy (via Dispose) and create the client there.

-Jeff

@jmorris
I created CouchbaseClient object as a single object like Singleton pattern in onStart event of windows service deriving from ServiceBase.
I have no ideal that the problem in .net sdk or couchbase server. :frowning:

I vaguely remember having this problem as well. Unfortunately I don’t remember what caused it.
However, I remember that I had some issues when the URI was wrong, and I remember that there was an issue of a timeout with the .NET client.

For the URI, make sure your bucket name is not in the URI, so “http://server:8091/pools” instead of “http://server:8091/pools/bucket

Was there an extended period of time between queries? Like 30 minutes? As a test, when you next get that error, try querying the view 10-20 more times

@ntphongnt -

Would it be possible to create a Jira ticket and attach an example project showing this behavior? You can create the Jira ticket here: https://issues.couchbase.com/browse/NCBC

Thanks,

Jeff

1 Like

@jmorris,
this afternoon the problem became serious with me, the exception occurred despite of my effort to try to restart app service, couchbaseserver service even I’d restarted the machine many times. Pls check my new comment to issue ticket NCBC 844.