I am running into a wired issue when trying to open more then one bucket at given time. In my app i have 2 main buckets, one is to store all email messages and notifications and then i have a bucket which stores the CRM info.
I have multiple sytems which open these buckets but always only one bucket per system. Now i have the need to open both buckets on one server at a time to validate a notification and then update the CRM of bounced message.
Here is how i went about it
var cluster = new couchbase.Cluster(config.cluster)
cluster.authenticate(config.userid, config.password)
let bucket = cluster.openBucket(config.bucket)
let bucket2 = cluster.openBucket(config.bucket_contact)
bucket.manager().createPrimaryIndex(function() {})
var N1qlQuery = couchbase.N1qlQuery;
and here is what i get when i try to make any call against the bucket 2
Error: cannot perform operations on a shutdown bucket
at Bucket._ensureConnected (C:\nodeRoot\OutlookAPI\node_modules\couchbase\lib\bucket.js:1523:11)
at Bucket._maybeInvoke (C:\nodeRoot\OutlookAPI\node_modules\couchbase\lib\bucket.js:1546:10)
at Bucket._n1ql (C:\nodeRoot\OutlookAPI\node_modules\couchbase\lib\bucket.js:985:8)
at Bucket.query (C:\nodeRoot\OutlookAPI\node_modules\couchbase\lib\bucket.js:1412:17)
at Promise (C:\nodeRoot\OutlookAPI\helpers\couchContacts.js:42:16)
at new Promise ()
at n1qlQuery_wId (C:\nodeRoot\OutlookAPI\helpers\couchContacts.js:37:12)
at Object.getBounceInfo (C:\nodeRoot\OutlookAPI\helpers\couchContacts.js:31:20)
at C:\nodeRoot\OutlookAPI\routes\index.js:152:37
at process.internalTickCallback (internal/process/next_tick.js:77:7)
So question is how can I keep 2 Buckets open at the same time ?