Hi,
I’m trying to run the Node SDK code from github for provisioning clusters. The code fails on the call to create bucket using bucket manager.
ERR: Error: cluster object was closed
at Connection.close (D:\workspace\cb\node_modules\couchbase\lib\connection.js:266:24)
at D:\workspace\cb\node_modules\couchbase\lib\cluster.js:612:14
Two questions:
Why do we need “const bucket = cluster.bucket(“default”);” call?
Can someone explain why this is happening and how can I fix this?
Hi Arun,
I’m getting the same result. I’m running the example in command prompt with node command. This is just a test project for couchbase with javascript. If this works well I will consider integrating CB with this API. (My python code works fine and I’m able to create bucket. Node SDK code fails.)
Hi @AV25242 The code that you provided does indeed work but it is different from the code on github.
When I try to do it with the version I posted, I get bizarre errors. It even fails to recognize the cluster.buckets() function and the error reads that it is not a function.
I’m left wondering what’s so special about the code that you’ve written vs the code on github using ‘new’ [ const cluster = new couchbase.Cluster()]. https://docs.couchbase.com/sdk-api/couchbase-node-client/Cluster.html
The example shows it but when executing, it fails.
Can you shed some light on this?
Thanks.