I am simulating a retrieve function from our database in couchbase and when I try to retreive the data it is showing me this. I’ve search throughout the net on how to solve this but found none.
Error: cluster object was closed
at Connection.close (/Users/franzdayrit/_Nobel systems/Projects/valencia-billing/node_modules/couchbase/lib/connection.js:266:24)
at /Users/franzdayrit/_Nobel systems/Projects/valencia-billing/node_modules/couchbase/lib/cluster.js:612:14
Here is my code using serverless along with couchbase and nodejs
Thanks @aeo03 I am assuming that you using Couchbase SDK 3.x
I see you are not awaiting on the query part and are using callbacks remember SDK 3.x uses promise
I am assuming you have the right indexes on billstatus and your query returns faster when tried using Couchbase Query workbench
try { let query = "SELECT * FROM xxx WHERE billstatus = 'paid'" let result = await cluster.query(query) console.log("Result:", result) return result } catch (error) { console.error('Query failed: ', error) }
so to avoid any confusions the latest version of Couchbase Node.js SDK is 3.1, if possible for you to download that and use (may not be needed but doesn’t hurt) ?
Look very similar with that problem, but in my cases the couchbase server is up and running before app, so I exclude a delay until couchbase are starting, but a strang behaviour is if I restart that app then all working perfectly. Can be another delay until the connection is established and that work to be cached somewhere and when restart just reuse it ?
If a retry mechanism will be implemented in 3.1.1 would be great.