Mongo Error when using batchSize and .each() from node.js driver

I am just trying to iterate through one collection(again just one collection) from my mongodb. my collection has about 500K documents. I have tried varying the batch_size from 10 to 10K but I still get the following Error

{ [MongoError: QueryFailure flag set on getmore command] name: 'MongoError' }

I hear that it happens coz the cursor timeout but I don't think this is true coz it is the only collection running I dont see a reason why the cursor should time out.

The code look like this

var batch_size = 1000;
cursor.batchSize(batch_size).each(function (err, document) {

}

any ideas will be great!