Server timed out when connect with mongoDB after upgrading in atlas

Hello friends
I have node js app deployment in fastcomet host
after upgrade mongoDB in atlas to M10 become when i test app and call api
the response is : Server selection timed out after 30000 ms
Although when dealing with the API that i developed by nodejs and connecting to mongoDB through localhost it doesn’t have any problems and it works properly

and when i connect from mongoDB compass everything is going well

I need to solution

Hi @Ala_Zo2ak - Welcome to the community! :wave:

I have node js app deployment in fastcomet host

I’m not too familiar with fastcomet but it does appear to be a hosting platform from a quick google search which I presume your application is hosted on but please correct me if i’m wrong here.

after upgrade mongoDB in atlas to M10 become when i test app and call api
the response is : Server selection timed out after 30000 ms

Prior to M10, was the cluster you were connecting to a shared tier (M0,M2 or M5)? And if so, were you able to connect successfully?

If you are able to, could you perform the basic network connectivity tests from the client attempting to connect to the cluster and advise of the output?:

  1. ping one of the hosts (prefereably the PRIMARY):
/// example
ping cluster0-shard-00-00.abcde.mongodb.net
  1. telnet to one of the hosts on port 27017 :
/// example
telnet cluster0-shard-00-00.abcde.mongodb.net 27017

Note: You can find the hostname in the metrics page of your cluster

and when i connect from mongoDB compass everything is going well

Was the connection using MongoDB Compass to the cluster performed from the same client which is hosting the node.js app?

Additionally, I would recommend to review the Troubleshoot Connection Issues documentation and verify some configurations, such as adding the client’s IP (or IP ranges) to the Network Access List.

Regards,
Jason

2 Likes