Views not working through Node.js

I'm running basic view queries through the Node.js SDK and it's working perfectly about 50% of the time and failing completely the rest of the time.

Have been debugging for days.. can't figure it out.
PLEASE HELP !

Environment:
Ubuntu 13.10
Couchbase 2.2.0
libcouchbase 2.2.0
Couchnode 1.1.0
Node.js v0.10.15

I'm running:

var couchbase = require('couchbase');
var db = new couchbase.Connection({host:'localhost:8091', bucket:'testbucket'});
var query = db.view('dev_test', 'view_all');
query.query(function(err, results)
{
  for (i in results)
	console.log(results[i]);
 
  if (err)
	console.log('Error: ' + err);
});

At least half of the time I'm getting this response:
Error: SyntaxError: Unexpected token u

Going deeper into the code it looks like this is
LCB_PROTOCOL_ERROR

Has anyone seen this, any ideas how to fix it ?
Thanks.

1 Answer

« Back to question.

Hey elementwave,
Version 1.1.1 of the Node.js client will be released shortly. There was an issue with the 1.1.0 client which caused the internal libcouchbase library we use to use the node binary version of the http-parser rather than the one bundled with itself, causing some intermittent issues with views. In the interim you can use `git+https://github.com/couchbase/couchnode.git#master` as your install version to get the fix.
Cheers, Brett

Awesome - that works like a dream. Thanks a million.
I'll keep an eye out for the 1.1.1 official version.

Thanks again,
James.

Hey elementwave,
1.1.1 was released today! Hope this helps.
Cheers, Brett