Hi All, I tried to connect growthbook app in the ...
# announcements
i
Hi All, I tried to connect growthbook app in the documentdb aws, but I received this error below: | {"level":50,"time":1682458961139,"pid":59,"hostname":"ip-xxxx.ec2.internal", "err":{"type":"MongooseServerSelectionError", "message":"unable to get local issuer certificate","stack":"MongooseServerSelectionError: unable to get local issuer certificate\n at NativeConnection.Connection.openUri (/usr/local/src/app/node_modules/mongoose/lib/connection.js84732)\n at /usr/local/src/app/node_modules/mongoose/lib/index.js35110\n at /usr/local/src/app/node_modules/mongoose/lib/helpers/promiseOrCallback.js325\n at Promise._execute (/usr/local/src/app/node_modules/bluebird/js/release/debuggability.js3849)\n at Promise._resolveFromExecutor (/usr/local/src/app/node_modules/bluebird/js/release/promise.js51818)\n at new Promise (/usr/local/src/app/node_modules/bluebird/js/release/promise.js10310)\n at promiseOrCallback (/usr/local/src/app/node_modules/mongoose/lib/helpers/promiseOrCallback.js3110)\n at Mongoose._promiseOrCallback (/usr/local/src/app/node_modules/mongoose/lib/index.js114910)\n at Mongoose.connect (/usr/local/src/app/node_modules/mongoose/lib/index.js35020)\n at /usr/local/src/app/packages/back-end/dist/init/mongo.js2741\n at Generator.next (<anonymous>)\n at /usr/local/src/app/packages/back-end/dist/init/mongo.js871\n at new Promise (<anonymous>)\n at __awaiter (/usr/local/src/app/packages/back-end/dist/init/mongo.js412)\n at exports.default (/usr/local/src/app/packages/back-end/dist/init/mongo.js2025)\n at /usr/local/src/app/packages/back-end/dist/init/index.js2543\n at Generator.next (<anonymous>)\n at /usr/local/src/app/packages/back-end/dist/init/index.js871\n at new Promise (<anonymous>)\n at __awaiter (/usr/local/src/app/packages/back-end/dist/init/index.js412)\n at /usr/local/src/app/packages/back-end/dist/init/index.js2434\n at /usr/local/src/app/packages/back-end/dist/init/index.js2816","reason":{"type":"ReplicaSetNoPrimary","setName":null,"maxSetVersion":null,"maxElectionId":null,"servers":{},"stale":false,"compatible":true,"compatibilityError":null,"logicalSessionTimeoutMinutes":null,"heartbeatFrequencyMS":10000,"localThresholdMS":15,"commonWireVersion":null}},"msg":"Failed to connect to MongoDB"} I run the application on ecs.... Do you have any example how I make this connection with the documentdb aws - mongo? Thanks
f
does your documentdb requires a custom certificate for the TLS connection?
i
Copy code
yes, I copied the certificate in the image to the growthbook app but it shows me the same error....is there a specific location I need to put?

I added in the path /usr/local/src/app and added in the taskdefinition the resource for ecs in the environment variable part with string for documentdb connection - example <mongodb://user:password@growthbook-cluster.cluster-xxxxxxxxxx-east>- Is <http://1.docdb.amazonaws.com:27017/?tls=true&tls_ca_certs=/usr/local/src/app/global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false|1.docdb.amazonaws.com:27017/?tls=true&tls_ca_certs=/usr/local/src/app/global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred&retryWrites=false> correct?
f
looking at the documentdb connection string
looks like …?tls=true&tlsCAFile=global-bundle.pem
where did you find the tls_ca_certs=
?
i
Hi Graham, It is working. thank you for your help.
f
great
133 Views