Namecheap Node.js app cannot connect to Atlas

Please help! My NodeJS application I hosted on Namecheap cannot connect to MongoDB Atlas.
I get the following error:

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 (/home/paciojgq/nodevenv/loan/12/lib/node_modules/mongoose/lib/connection.js:830:32)
    at Mongoose.connect (/home/paciojgq/nodevenv/loan/12/lib/node_modules/mongoose/lib/index.js:335:15)
    at Object.<anonymous> (/home/paciojgq/loan/models/db.js:30:10)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/home/paciojgq/loan/app.js:2:1)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
    at internal/main/run_main_module.js:17:11
(node:74432) 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:74432) [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.

As the error message indicate

but in this case the recommendation

is misleading. What needs to be white listed is the IP of your app running on Namecheap.

1 Like

Please how do I know the ip of my app running on Namecheap?
Thanks!

I do not know that service so I do not know what tools you can use. The best is to contact technical support of this provider.

:heart:
Alright
Thanks