Network error 16 in bucket.js when try to get or set

I have a this simple script:

var cb = require('couchbase'); var bucket; var connectionSettings = { 'user':'test-bucket', 'password':'test', 'hosts':['localhost:8091'], 'bucket':'test-bucket' };

cb.connect(connectionSettings, function(e, bucket) {

if (e) {

	errorHandler('connect', e);

} else {

	console.log('Connection established!');

	bucket.get('testObject', function(e, doc) {
		if(e) {
			errorHandler('get', e);
		} else {



function errorHandler(from, e) {

console.log('Function: ' + from);


I did a fresh install of couchbase server + libcouch + node.js + all modules on my ubuntu 12.04 x64 just to check but I still get this error:

syd@HP-Notebook:~/Desktop$ node test.js Connection established! Function: get Network error Error: Network error at makeError (/home/syd/node_modules/couchbase/lib/bucket.js:578:18) at getParsedHandler (/home/syd/node_modules/couchbase/lib/bucket.js:625:17) node: ../src/ virtual int Couchnode::IoOps::updateEvent(lcb_socket_t, void*, short int, void*, void (*)(lcb_socket_t, short int, void*)): Assertion `socket != __null' failed. Aborted (core dumped)

And here are the code blocks that 578 and 625 errors occur


function makeError(conn, errorCode) {
// Early-out for success
if (errorCode == 0) {
return null;

// Build a standard NodeJS Error object with the passed errorCode
var errObj = new Error(conn.strError(errorCode)); // <- 578 error here
errObj.code = errorCode;
return errObj;



function getParsedHandler(data, errorCode, key, cas, flags, value) {
// if it looks like it might be JSON, try to parse it
if (/[{[]/.test(value)) {
try {
value = JSON.parse(value);
} catch (e) {
// console.log(“JSON.parse error”, e, value)
var error = makeError(data[1], errorCode); // <- 625 error here
data[0](error, value, {
id : key,
cas: cas,
flags : flags

I can’t figure out why is this happening I’m trying to figure it out 2 days now with no luck and it’s driving me nuts.
Any help will be greatly appreciated.

P.S. I cant mine the database using php with no problems at all but with no luck in node.

I have the same problem.
Fresh ubuntu 13.04 x64 / ubuntu 12.04 x64 (tried both)
libcouchbase2 - 2.0.7 / 2.1.2 (also tried both)
couchnode 0.0.12
nodejs 0.10.17

Result is
Error: Network error
at makeError (/home/pawel/f4demo/node_modules/couchbase/lib/bucket.js:578:18)
at setHandler (/home/pawel/f4demo/node_modules/couchbase/lib/bucket.js:585:17)


Since we have released a new version of Couchbase Node.js driver can you upgrade to this release? (0.1.0)



We have not released the official Node.js SDK (1.0.0) that is available here:

I am inviting your to update your system and let us know if the problem persist.


Excellent and great article, Couchbase has saved me so much trouble. Thank you very much.