1
votes

I have made a MEAN stack project. And this project was successfully run some days ago. But suddenly it gives MongoNetworkError. I do not change anything. I use mongo atlas. The error description is given below.

error MongoNetworkError: failed to connect to server [cluster0-shard-00-01-s9niu.mongodb.net:27017] on first connect [MongoNetworkError: connection 5 to cluster0-shard-00-01-s9niu.mongodb.net:27017 closed at TLSSocket. (D:\Angular\meal-system-server\node_modules\mongodb\lib\core\connection\connection.js:372:9)
at Object.onceWrapper (events.js:300:26) at TLSSocket.emit (events.js:210:5) at net.js:658:12 at TCP.done (_tls_wrap.js:481:7) { name: 'MongoNetworkError', }] at Pool. (D:\Angular\meal-system-server\node_modules\mongodb\lib\core\topologies\server.js:438:11) at Pool.emit (events.js:210:5) at D:\Angular\meal-system-server\node_modules\mongodb\lib\core\connection\pool.js:561:14 at D:\Angular\meal-system-server\node_modules\mongodb\lib\core\connection\pool.js:1008:9 at callback (D:\Angular\meal-system-server\node_modules\mongodb\lib\core\connection\connect.js:97:5) at D:\Angular\meal-system-server\node_modules\mongodb\lib\core\connection\connect.js:124:7 at _callback (D:\Angular\meal-system-server\node_modules\mongodb\lib\core\connection\connect.js:349:5) at Connection.errorHandler (D:\Angular\meal-system-server\node_modules\mongodb\lib\core\connection\connect.js:365:5)
at Object.onceWrapper (events.js:300:26) at Connection.emit (events.js:210:5) at TLSSocket. (D:\Angular\meal-system-server\node_modules\mongodb\lib\core\connection\connection.js:370:12)
at Object.onceWrapper (events.js:300:26) at TLSSocket.emit (events.js:210:5) at net.js:658:12 at TCP.done (_tls_wrap.js:481:7) { name: 'MongoNetworkError', }

1
Looks like a TLS error. Have you checked your local CA file or trust store to make sure it can validate the server's certificate?Joe

1 Answers

0
votes

Seems like an error with the certificate, mongodb atlas recently made changes in the certificates.

Which language you are using for this application and what is the version of the language ?

Please refer this document for more information : Mongodb Atlas Security