I am getting this error when try to insert 2M objects via node.js into Couchbase. 1M works fine.

C:\Users\Administrator\Desktop\node_modules\couchbase\lib\bucket.js: 728 throw new Error(‘cannot perform operations on a shutdown bucket’);

I am using Couchbase 3.0.1, node.js 2.0.2 SDK.

This is the code:

var Couchbase = require('couchbase');

var myCluster = new Couchbase.Cluster('couchbase://,,,');

var myBucket = myCluster.openBucket('rre');

   for (var i = 0;i<1000000;i++)

 	myBucket.insert('dwhtryrdue_'+i,  {
    "guid": "003dddbf-da50-46d4-a2aa-319677b5d2be",
    "CampaignID": 22,
    "ZoneID": 29,
    "AdvertiserID": 30,
    "BannerID": 36,
    "UserID": 32,
    "ClickIP": "Bette",
    "ClickHost": "Jerry",
    "ClickReferringURL": "Dejesus",
    "ClickDateTime": "2014-06-09T12:53:22 -00:00",
    "ClickCountry": "Central African Republic",
    "ClickState": "Kentucky",
    "ClickBrowser": "Chrome"
	}, function(err, res) {


N1qlQuery always fail

I don’t know about the Node.JS SDK, but in order to have the relevant crowd pick your issue up more easily, you should also probably assign it to the “Node.js SDK” category…

As a first lead, did you debug/log the err parameter (error) in the callback you pass to insert method to check if something else went wrong?

The error you get indicates that the bucket either hasn’t been opened or has been shutdown(). I’m not sure if internal errors are known to close the bucket, but you should also probably include the code relative to cluster and bucket opening.


Resolved the issue by increasing the timeout: myBucket.operationTimeout = 120 * 1000;

Bulk loading with node.js client

Where do you set timeout: myBucket.operationTimeout = 120 * 1000; ?


@morgan that would be in the CouchbaseEnvironment, that you can in turn pass in when creating the Cluster. See the documentation on configuring the environment.