MongoDB connection timeout error - intermittent issue

Hello, I have connected mongoDB in my firebase functions. Sometimes facing error like MongoNetworkTimeoutError: connection 1 to closed. Although all IP address are whitelisted.



Hi Zil_D,

Does this error always occur by using the same IP? For example, are you trying to connect from your office? Maybe there is a firewall you are not aware of.

Hi @Irene_Rincon , Thank you for your response.
Actually, this error occurs sometimes, and we are using Firebase functions here. For the IP whitelist, I have already allowed all IPs (

I am not aware if it is due to my office firewall or firebase functions IP is blocking here.

I would try connecting from outside the office and check if the problem persists. Sometimes companies block connections to exterior servers for security reasons.

I am afraid that is all the advice I can give you, but maybe someone else in the community can offer a different perspective.