Function invocation timeout error after connecting to a cluster

I’m new to MongoDB and currently working on a PoC to present to my Org. I’ve got connection to my cluster successful on Compass. Setup databases and collections but whenever I tried invoking a function, I keep getting timeout error. Locally everything works fine.

I’m just wondering if anyone can point me to what I must have missed.

See attached screenshots of the error messages, connection and cmd.

Hi @Solomon_UDOH, welcome!

Based on the errors, would it be correct to assume that you are trying to execute a Node.js function in Serverless Framework ?
Can you provide answers to the following:

  • Could you provide more information about the function itself, i.e. how do you establish connection, etc?
  • Which MongoDB Node.js driver version are you using ?
  • Is the MongoDB server being hosted on Atlas ?
  • If it is hosted on Atlas, have you configured the IP whitelist ?
  • Could you provide more information on the error message other than the timeout line ?

I would suggest to write a simple script to test the database connection. Please see MongoDB Node.js driver: Quick Start tutorial.


1 Like