-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.6.2
-
Component/s: Client Side Encryption
-
Empty show more show less
-
Not Needed
Hey,
we are using mongoDb for a while and want to use CSFLE to encrypt sensitive data. I having some problems implementing a prototype. After connecting to the mongodb and the mongocryptd process a few queries are successful but after a while the queries stop responding. We are using following setup:
- MongdDb Atlas Replica Set 4.2
- mongoDb node driver 3.6.2
mongodb-client-encryption lib 1.1.0
I can reproduce this behavior quite easily with a simple node script and the problem is connection when using autoEncryption and useUnifiedTopology together. When setting useUnifiedTopology to false the queries work correctly. Also increasing the connection pool limit helps but I dont really get why this is only relevant when using the useUnifiedTopology option.
Here is the script I wrote (you have to replace the connection options)
const MongoClient = require("mongodb").MongoClient; function getData(db, collectionName, counter) { console.log(`Start fetching ${collectionName} ${counter} `); return db.collection(collectionName).find({}).toArray().then((data) => console.log(`${collectionName} ${counter}: ${data.length}`) ); } async function run() { const client = await MongoClient.connect( "mongodb://localhost:27017/gastromatic_develop", { useNewUrlParser: true, useUnifiedTopology: false, autoEncryption: { keyVaultNamespace: "encryption.__keyVault", kmsProviders: {...}, extraOptions: { mongocryptdBypassSpawn: true, mongocryptdURI: "mongodb://%2Ftmp%2Fmongocryptd.sock", }, }, }); const db = client.db(); const counter = 20; const promises = []; for (let i = 0; i < counter; i++) { promises.push(getData(db, "Employees", i + 1)); } await Promise.all(promises); } run() .catch((err) => console.error(err)) .then(() => { console.log("Finished"); process.exit() });
Maybe I just misconfigured smething here but I followed the instruction quite close. Would really appreciatesme help here.
Best regards
Peter
- is duplicated by
-
NODE-2744 Query to MongoDB Atlas 4.2.8 in hanging state after sometime
- Closed
- is related to
-
NODE-2995 Sharing a MongoClient for metadata lookup can lead to deadlock in drivers using automatic encryption
- Closed
- related to
-
NODE-2794 Bug in source code for the libmongocrypt package
- Closed
- mentioned in
-
Page Loading...