An error occurred while loading instance info: connection 3 to 13.x.x.x:27017 closed

Hi all,

I am getting the Error An error occurred while loading instance info: connection 3 to 13.x.x.x:27017 closed.

I am using the MongoDB drive for node js mongodb.
how to resolve this Error !.

I am getting the same Error with MongoDB compass also. after many re-try it worked. but not the right solve.

Hi :wave: @Sanjay_Makwana,

Welcome back to the MongoDB Community :sparkles:

Can you share the following information to better understand the problem:

  • The logs from the server instance so we can see what’s going on from the server side.
  • Have MongoDB successfully running before? If yes, what changed?
  • How did you install MongoDB, and what version is this?
  • What is your hardware and OS spec?

Could you specify the changes you made in order to make it work?

Best,
Kushagra

@Kushagra_Kesav I am using Atlas M2 Instance. this Error went after accessing all networks. when I set it up with my public IP it was giving the connection Error. but I can query data. So any wrong with the network access setup?

Hi :wave: @Sanjay_Makwana,

Could you share the actual error message from your app and MongoDB Compass? Additionally, it would be helpful if you could share the connection string you are using.

Also, have you contacted MongoDB Atlas Support for assistance with this issue?

Best,
Kushagra

@Kushagra_Kesav here is the connection string. mongodb+srv://usernamev:password@cluster0.XXXvz2i.mongodb.net/?retryWrites=true&w=majority.

the Error “connection 1 to 13.232.97.81:27017 closed” this Error show in mongo compass.

Hi :wave: @Sanjay_Makwana,

Thanks for sharing the connection string.

Can you please confirm the following:

  1. Is the client attempting to connect the machine associated with the public IP address you added or is it running in a VM on the said machine?
  2. Are you able to connect properly when “Allow Access From All IP Addresses” / 0.0.0.0/0 is added to your Network Access List.

Also, can you verify that your current IP address is whitelisted (includes your current IP address) in the MongoDB Atlas Dashboard?

Best,
Kushagra