MongoPoolClearedError

Hi,
I have a problem with my database.
I frequently (several time a day) have crash during queries. It throws this error:

PoolClearedError [MongoPoolClearedError]: Connection pool for db2.prod.someDomain.com:27017 was cleared because another operation failed with: "connection <monitor> to [ip:v6:add:ress::]:27017 timed out"
    at ConnectionPool.processWaitQueue (/var/www/api/prod/node_modules/mongoose/node_modules/mongodb/lib/cmap/connection_pool.js:520:82)
    at ConnectionPool.clear (/var/www/api/prod/node_modules/mongoose/node_modules/mongodb/lib/cmap/connection_pool.js:251:14)
    at updateServers (/var/www/api/prod/node_modules/mongoose/node_modules/mongodb/lib/sdam/topology.js:461:29)
    at Topology.serverUpdateHandler (/var/www/api/prod/node_modules/mongoose/node_modules/mongodb/lib/sdam/topology.js:332:9)
    at Server.<anonymous> (/var/www/api/prod/node_modules/mongoose/node_modules/mongodb/lib/sdam/topology.js:444:77)
    at Server.emit (node:events:513:28)
    at Server.emit (node:domain:489:12)
    at markServerUnknown (/var/www/api/prod/node_modules/mongoose/node_modules/mongodb/lib/sdam/server.js:298:12)
    at Monitor.<anonymous> (/var/www/api/prod/node_modules/mongoose/node_modules/mongodb/lib/sdam/server.js:58:46)
    at Monitor.emit (node:events:513:28) {
  address: 'db.prod.someDomain.com:27017',
  [Symbol(errorLabels)]: Set(1) { 'RetryableWriteError' }
}

I’ve tried several changes, from decreasing my write rates and read rates over the db, but can’t get why it’s crashing … I can’t reproduce the bug, since it happens randomly, and when i read my server monitoring informations, CPUs RAM and SSD I/O are at low levels

Here is my configuration :

  • mongoose last version
  • mongodb js driver last version
  • mongodb last version
  • 1 replicaset with 2 nodes
  • Each node has 32GO ram + 12 core Xeon processor
  • Full database size is around 130GO, biggest collection has 70M doccuments, total index size is around 24GO

Hey @Johan_Maupetit,

Welcome to the MongoDB Community forums!

Based on the error logs shared, it appears that your connection is experiencing a timeout. I suspect that it may be occurring either due to network errors or the PRIMARY is getting re-elected in your configuration, causing it to lose connection. I would suggest you implement a try-catch behavior in the application code, allowing it to easily switch to the new PRIMARY node.

If the issue still persists after verifying the above, it would be helpful to share the code snippet of your connection code and the logs from the MongoDB server of the same timeframe. This will allow us to assist you better.

Furthermore, please provide the exact versions of MongoDB, Mongoose, and the Node.js driver you are using.

Best,
Kushagra

1 Like

Hi @Kushagra_Kesav thank you for your answer.
I took some time to check if it was due to a re-election … i don’t think so. My primary remains the same node before and after the bug.
Also i can’t try catch every line of code where i interact with the db :smiley: I need to thrust it when i write or read from it
Here is an extract of the logs i get at the time of the error :

On my Secondary:

{"t":{"$date":"2023-07-20T16:59:21.354+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn757","msg":"Interrupted operation as its client disconnected","attr":{"opId":7592396}}
{"t":{"$date":"2023-07-20T16:59:21.355+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn757","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:59106","uuid":"d935431a-6989-40c4-967c-b8397fe3f211","connectionId":757,"connectionCount":431}}
{"t":{"$date":"2023-07-20T16:59:21.484+00:00"},"s":"I",  "c":"COMMAND",  "id":51803,   "ctx":"conn418","msg":"Slow query","attr":{"type":"command","ns":"monitohr.taggedkeywordchains","command":{"find":"taggedkeywordchains","filter":{"keyWords":{"$in":[["responsable"],["technique"],["projet"],["responsable","technique"],["technique","projet"],["responsable","technique","projet"]]},"deleted":{"$ne":true}},"projection":{"_id":false,"salaryStat":true},"hint":{"keyWords":1},"lsid":{"id":{"$uuid":"458f8939-ebf9-41bd-8e8f-8f01aab3738f"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1689872360,"i":9}},"signature":{"hash":{"$binary":{"base64":"E4mTMhpQD7h5384ODZBFCUbiJIo=","subType":"0"}},"keyId":7214879625111928841}},"$db":"monitohr","$readPreference":{"mode":"nearest"}},"planSummary":"IXSCAN { keyWords: 1 }","keysExamined":54648,"docsExamined":53354,"cursorExhausted":true,"numYields":54,"nreturned":6,"queryHash":"0E10326B","queryFramework":"classic","reslen":824,"locks":{"FeatureCompatibilityVersion":{"acquireCount":{"r":55}},"Global":{"acquireCount":{"r":55}},"Mutex":{"acquireCount":{"r":1}}},"readConcern":{"level":"local","provenance":"implicitDefault"},"storage":{},"remote":"[2001:41d0:203:999c::]:41312","protocol":"op_msg","durationMillis":154}}
{"t":{"$date":"2023-07-20T16:59:21.520+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn839","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60776","uuid":"4f2c0d54-3d6c-48bb-b620-2161aa05a282","connectionId":839,"connectionCount":430}}
{"t":{"$date":"2023-07-20T16:59:21.520+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn846","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:32814","uuid":"f8033146-6b75-4ffd-af4d-1f86ace27e22","connectionId":846,"connectionCount":429}}
{"t":{"$date":"2023-07-20T16:59:21.520+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn881","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:33658","uuid":"96ab2d84-7fac-431b-9cd2-7b50da073040","connectionId":881,"connectionCount":428}}
{"t":{"$date":"2023-07-20T16:59:21.520+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn878","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:33602","uuid":"103d1ee4-de39-40ee-b277-cf332485293a","connectionId":878,"connectionCount":427}}
{"t":{"$date":"2023-07-20T16:59:21.520+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn819","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60546","uuid":"ae357dea-abb4-4046-aa3a-e85e4616c0fc","connectionId":819,"connectionCount":426}}
{"t":{"$date":"2023-07-20T16:59:21.520+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn874","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:33528","uuid":"674f095e-4fc8-48c7-9e24-11813c7d6347","connectionId":874,"connectionCount":425}}
{"t":{"$date":"2023-07-20T16:59:21.520+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn827","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60626","uuid":"aa7d34f1-bd95-4621-8da5-adf81b928889","connectionId":827,"connectionCount":424}}
{"t":{"$date":"2023-07-20T16:59:21.520+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn805","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60238","uuid":"012c38d7-f4f4-45a7-b06a-c1a715502ac8","connectionId":805,"connectionCount":423}}
{"t":{"$date":"2023-07-20T16:59:21.520+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn854","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:33122","uuid":"b70c7281-f213-469c-a3c5-fdb79572dc18","connectionId":854,"connectionCount":422}}
{"t":{"$date":"2023-07-20T16:59:21.521+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn838","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60774","uuid":"1d9c81ed-63b7-4c72-b2ce-77b6ad3b3cf4","connectionId":838,"connectionCount":421}}
{"t":{"$date":"2023-07-20T16:59:21.521+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn773","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60006","uuid":"54fa478c-2207-400e-abdb-b5a79f95592d","connectionId":773,"connectionCount":420}}
{"t":{"$date":"2023-07-20T16:59:21.521+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn884","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:33678","uuid":"ab988b2f-3e42-48eb-9b51-6672facf9ddb","connectionId":884,"connectionCount":419}}
{"t":{"$date":"2023-07-20T16:59:21.521+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn883","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:33676","uuid":"9c0499de-f89e-4a58-8cb0-8877fdf235d4","connectionId":883,"connectionCount":418}}
{"t":{"$date":"2023-07-20T16:59:21.521+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn850","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:32976","uuid":"ac05d36e-13a6-46fa-aae0-b520ecaef303","connectionId":850,"connectionCount":417}}
{"t":{"$date":"2023-07-20T16:59:21.521+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn781","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60024","uuid":"8555dba0-e14a-433e-b842-f391c36098cd","connectionId":781,"connectionCount":416}}

...a lot more Connection ended...

{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn777","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60014","uuid":"e2dcdb9e-a1df-40ff-9cb5-c1632545cb5b","connectionId":777,"connectionCount":348}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn900","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:34058","uuid":"0c9bf1b7-0993-47fd-aa12-998fd233c068","connectionId":900,"connectionCount":346}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn785","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60058","uuid":"dae7facd-b880-4c77-9998-6fad781f521e","connectionId":785,"connectionCount":345}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn798","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60210","uuid":"3115266f-0016-46c5-b8a3-f1a575015cbb","connectionId":798,"connectionCount":344}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn787","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60086","uuid":"e17a8b75-56d3-4c3e-9414-b1dd01f1f819","connectionId":787,"connectionCount":343}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn903","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:34076","uuid":"82b59976-2c7f-48d0-975d-fa2f5d4fd794","connectionId":903,"connectionCount":342}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn880","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:33656","uuid":"5ea12002-e89d-4dc1-9be3-8cd1d50ff284","connectionId":880,"connectionCount":341}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn788","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60092","uuid":"c32626ad-56d7-47ef-a4c0-b31e22a9ab13","connectionId":788,"connectionCount":340}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn816","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60522","uuid":"6ee5fe5c-d43b-48da-9cda-0f2610b41dc0","connectionId":816,"connectionCount":339}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn896","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:33954","uuid":"b87815a3-8c47-49e5-af9b-7b062f0344a8","connectionId":896,"connectionCount":338}}
{"t":{"$date":"2023-07-20T16:59:21.527+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn818","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60544","uuid":"435f4187-fc99-4d0a-bb28-e668039229b1","connectionId":818,"connectionCount":337}}
{"t":{"$date":"2023-07-20T16:59:21.528+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn774","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60008","uuid":"7b8bfb03-8e08-403c-9d0c-decb58059082","connectionId":774,"connectionCount":336}}
{"t":{"$date":"2023-07-20T16:59:21.528+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn830","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60668","uuid":"dbacc587-89aa-4e96-89c6-c8dbddcb2892","connectionId":830,"connectionCount":335}}
{"t":{"$date":"2023-07-20T16:59:21.528+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn801","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60216","uuid":"f9403a40-a51c-4dcd-b8db-8011ce0bcfb5","connectionId":801,"connectionCount":334}}
{"t":{"$date":"2023-07-20T16:59:21.528+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn784","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60032","uuid":"e8ed8812-5e8c-4abe-b077-25b0dadd0abc","connectionId":784,"connectionCount":333}}
{"t":{"$date":"2023-07-20T16:59:21.528+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn869","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:33340","uuid":"0c9f0d0f-fcd6-403a-ae50-8198e626a85f","connectionId":869,"connectionCount":332}}
{"t":{"$date":"2023-07-20T16:59:21.528+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn803","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:60232","uuid":"503f95ba-7b29-473e-8c25-6d497b92f6f1","connectionId":803,"connectionCount":331}}

On my Primary:

{"t":{"$date":"2023-07-20T16:59:21.704+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn1250","msg":"Interrupted operation as its client disconnected","attr":{"opId":14029542}}
{"t":{"$date":"2023-07-20T16:59:21.712+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1250","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57062","uuid":"c04f2662-f6f3-439e-b6ee-726ce885ff2c","connectionId":1250,"connectionCount":480}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1366","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57550","uuid":"a267c008-3d53-4178-807a-07d14c4d7905","connectionId":1366,"connectionCount":479}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1348","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57510","uuid":"009eff11-d781-410a-8de5-2e623a4a1bc2","connectionId":1348,"connectionCount":478}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1301","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57368","uuid":"3e643872-ab14-4088-a900-3ce5635c83eb","connectionId":1301,"connectionCount":477}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1362","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57542","uuid":"d89d6807-c218-46fb-b44d-31f3e3b03832","connectionId":1362,"connectionCount":476}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1304","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57378","uuid":"f34572fb-bc0e-4fe4-ba10-b306e8e812a8","connectionId":1304,"connectionCount":474}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1380","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57588","uuid":"ba6a3ba9-b142-428d-b8c8-45f279082248","connectionId":1380,"connectionCount":473}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1330","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57464","uuid":"c0ef0bd8-9732-48c6-8047-7716a4aa74eb","connectionId":1330,"connectionCount":472}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1354","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57522","uuid":"e2ab2241-c519-42f1-a507-56ced9d4bcb7","connectionId":1354,"connectionCount":471}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1383","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57594","uuid":"7681f484-54cf-410a-86dd-d5164a688e02","connectionId":1383,"connectionCount":475}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1349","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57512","uuid":"8e9b84ac-cdcd-4317-b000-509c51e3cdbf","connectionId":1349,"connectionCount":470}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1316","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57428","uuid":"b3df15a8-48d7-4842-b57f-0d459d6bdcce","connectionId":1316,"connectionCount":468}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1364","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57546","uuid":"edeef05a-f99f-4995-9f05-039eeb42a829","connectionId":1364,"connectionCount":467}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1375","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57578","uuid":"db4a1abe-7e4e-4c82-ae57-52212b7482b2","connectionId":1375,"connectionCount":466}}
{"t":{"$date":"2023-07-20T16:59:21.835+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1295","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57356","uuid":"25dc7af4-739f-4c83-9125-fcd2411aaa85","connectionId":1295,"connectionCount":469}}

...a lot more Connection ended...

{"t":{"$date":"2023-07-20T16:59:21.840+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1262","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57108","uuid":"d8d1e8a6-38d1-4528-9d15-752162cd8bb5","connectionId":1262,"connectionCount":398}}
{"t":{"$date":"2023-07-20T16:59:21.840+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1332","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57470","uuid":"931e46d7-5ca1-4e59-9b6b-7bbaa574f280","connectionId":1332,"connectionCount":397}}
{"t":{"$date":"2023-07-20T16:59:21.840+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1259","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57100","uuid":"7a295c8f-b937-422d-b806-4a7dba7bf14a","connectionId":1259,"connectionCount":394}}
{"t":{"$date":"2023-07-20T16:59:21.840+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1373","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57568","uuid":"e77431f9-45a2-4ea0-ac6a-75e33b446bb1","connectionId":1373,"connectionCount":393}}
{"t":{"$date":"2023-07-20T16:59:21.840+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1263","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57112","uuid":"25b888dc-f080-4a83-9ad9-e7cf8c51dc73","connectionId":1263,"connectionCount":396}}
{"t":{"$date":"2023-07-20T16:59:21.840+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1253","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57076","uuid":"8fbbafdc-2f1b-4418-a413-087ee3fa591b","connectionId":1253,"connectionCount":392}}
{"t":{"$date":"2023-07-20T16:59:21.840+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1265","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57126","uuid":"5e0160bc-a173-4149-a225-d5e0cc820b29","connectionId":1265,"connectionCount":391}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1343","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57500","uuid":"c2c63feb-455d-4204-ba10-170abdba1334","connectionId":1343,"connectionCount":390}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1377","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57582","uuid":"057d10db-6e9d-4d6d-a8f8-1da8cdf422bc","connectionId":1377,"connectionCount":389}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1357","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57528","uuid":"0fec7fbd-0e28-48ec-92e7-e0bd86eefa66","connectionId":1357,"connectionCount":388}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1308","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57386","uuid":"37b704c9-afc0-4e1f-bd25-a3a93f46bd93","connectionId":1308,"connectionCount":387}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1371","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57562","uuid":"b615cf5f-5094-4339-bc62-0ffcb5554728","connectionId":1371,"connectionCount":386}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1350","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57514","uuid":"21bc770e-05f1-4586-b7da-498b816214cb","connectionId":1350,"connectionCount":385}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1360","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57534","uuid":"ae1d1305-aea5-4058-9865-8b4436f67284","connectionId":1360,"connectionCount":384}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1359","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57532","uuid":"16a5fb12-f7bf-43a2-84a6-fd79067fb019","connectionId":1359,"connectionCount":383}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1374","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57576","uuid":"faaf342a-ae3f-4148-932d-38011469fbe8","connectionId":1374,"connectionCount":382}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1257","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57096","uuid":"9ec4aa68-753c-4c7c-b94b-be92bccef7a8","connectionId":1257,"connectionCount":380}}
{"t":{"$date":"2023-07-20T16:59:21.841+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1303","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57372","uuid":"2fdacb29-453e-4c01-84e3-e485f0169291","connectionId":1303,"connectionCount":381}}
{"t":{"$date":"2023-07-20T16:59:21.840+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1336","msg":"Connection ended","attr":{"remote":"[2001:41d0:203:999c::]:57482","uuid":"8c5ca766-0b93-478c-acfc-038cab9d7473","connectionId":1336,"connectionCount":395}}

I’ve found what is causing this error, and share it here if anybody is in my situation.

In fact the problem does not come from my database neither from my network … but from my client server.

Sometimes my client server get its CPU overloaded, all cores going to 100%. In those cases i guess it can’t handle in time its mongoDB requests which leads to this MongoPoolClearedError.

Anyone having this error should check on client side if the server is not overloaded.

3 Likes