Open Adebolavictor opened 3 years ago
One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's
IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/
This is showing at the console: Server listening on port 80 (node:11132) UnhandledPromiseRejectionWarning: MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/ at NativeConnection.Connection.openUri (C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\mongoose\lib\connection.js:832:32) at C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\mongoose\lib\index.js:345:10 at C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\mongoose\lib\helpers\promiseOrCallback.js:31:5 at new Promise ()
at promiseOrCallback
(C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\mongoose\lib\helpers\promiseOrCallback.js:30:10)
at Mongoose._promiseOrCallback
(C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\mongoose\lib\index.js:1135:10)
at Mongoose.connect
(C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\mongoose\lib\index.js:344:20)
at Object.
(C:\Users\GEORGE\Desktop\exam-timed-backend-app_helpers\db.js:6:10)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Module.require (internal/modules/cjs/loader.js:848:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.
(C:\Users\GEORGE\Desktop\exam-timed-backend-app\users\userService.js:5:12)
at Module._compile (internal/modules/cjs/loader.js:955:30)
(node:11132) UnhandledPromiseRejectionWarning: Unhandled promise rejection.
This error originated either by throwing inside of an async function
without a catch block, or by rejecting a promise which was not handled with
.catch(). (rejection id: 1)
(node:11132) [DEP0018] DeprecationWarning: Unhandled promise rejections are
deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.