Error: parent cluster object has been closed

Getting Error: parent cluster object has been closed with Couchbase Node SDK v3

When on development I would get his error randomly and after restarting the server CB wouldn’t throw this error but now restarting also not a fix for this issue.

Error

Error: parent cluster object has been closed
    at Connection._maybeFwd (E:\project\server\node_modules\couchbase\lib\connection.js:201:13)
    at Connection.query (E:\project\server\node_modules\couchbase\lib\connection.js:305:10)
    at QueryExecutor.query (E:\project\server\node_modules\couchbase\lib\queryexecutor.js:111:16)
    at Cluster.query (E:\project\server\node_modules\couchbase\lib\cluster.js:294:24)
    at _callee6$ (E:\project\server\database\couchbase\/index.js:106:36)
    at tryCatch (E:\project\server\node_modules\@babel\node\node_modules\regenerator-runtime\runtime.js:63:40)
    at Generator.invoke [as _invoke] (E:\project\server\node_modules\@babel\node\node_modules\regenerator-runtime\runtime.js:293:22)
    at Generator.next (E:\project\server\node_modules\@babel\node\node_modules\regenerator-runtime\runtime.js:118:21)
    at asyncGeneratorStep (E:\project\server\database\couchbase\index.js:14:103)
    at _next (E:\project\server\database\couchbase\index.js:16:194)

Couchbase setup

const couchbase = require("couchbase");

const cluster = new couchbase.Cluster("couchbase://localhost/", {
  username: "admin",
  password: "admin123",
});

const bucket = cluster.bucket("ads");

const collection = bucket.defaultCollection();

1 Like

This seems to be the server not being ready. This may need to be fixed with some type of loading error, if your API gets this error, please try again or something.

Any additional info can help me to troubleshoot this better. You say restarting the server?

“parent cluster object has been closed” I have found to also mean, “parent cluster object is not ready yet”

Thanks for the response,

I tried restarting the server but that’s not the fix, I tried the couchbase Node SDK example too, and still the “cluster closed” error.

And is there any function to start the cluster? And what the additional info you look forward to troubleshoot?

I’m using node sdk v3

@ericb