Couchbase 4.0 - Counter not working [timeout]

Hello there,

I have been testing the new release candidate for the past couple of days and I have been unable to use a counter key command.

The error is as following:

CouchbaseError: Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout.

I have tested it with both node.JS & Java SDK on Windows,Ubuntu and OSX.

Query example:

var couchbase = require('couchbase');
var cluster = new couchbase.Cluster('couchbase://');
var bucket = cluster.openBucket('default');

bucket.counter('test', 1, {initial:1}, function(err, res) {

After a closer inspection I’ve realized the problem is not the Couch-base version but rather the fact that I had the buckets set for Full Eviction. Value Eviction seems to work.
Could someone confirm if this is an expected behavior? I couldn’t find any remarks about this in the documentation.


Full or Value Eviction shouldn’t affect the functionality of any command (including counter), however with Full Eviction if the item you are trying to operate on isn’t resident (and hence needs to be fetched) it may take longer. Do you see any difference if you increase the timeout on your application.

I can confirm we have the same error. After some testing we found out the following:

  • Environment: fresh couchbase 4.0.0-4051, Nodejs 5.3.0, couchbase@2.1.4, couchlib 2.5.6
  • Created “counters” bucket with Full Eviction, no documents yet
  • If I run the above code, and try to increase a counter it either:
    a) Times out after a while
    b) Throws an error: The key does not exist, code 13 (shouldn’t happen, because it has initial value supplied)
  • We get a succesful reply when we change to Value eviction.
  • This is also still the case if we delete the key and try again. The counter get created on initial try, then gets updated correctly aftewards

We found out about this issue when migrating to 4.0; our counter code stopped working. On 3.0.1 no problem at all.

How do I get this bug recorded & fixed?

It looks like you hit MB-17231 which will be fixed in an upcoming release of Couchbase Server (you can see which versions in the ticket details).
The current workaround as you have correctly identified is to use ‘Value’ eviction!

I’m using the docker image for community edition from docker hub; this still is not resolved.

If the bucket is empty, counters get created; if it’s not empty, it times-out.

(gocd, Ubuntu 14.04)