Could not connect to database

i’m getting this error after i moved my pc to another location and changed the LAN switch. pc names are same as before but it doesn’t connect and shows this error:

Could not connect to any of the specified Mongo DB servers defined in the
“Hostname” parameter of the “settings\connection.ini” file in the root of the Repository.
The following errors encountered:
• My_pc_name : The Connection attempt timed out.

extra info : the shared drive which has the repo opens up fine

I think this is usually a DNS issue (can you ping the hostname?) or a firewall issue (is it connectable on the db port or any other port(s)?).

Check out your settings in connection.ini. Could be that you need a fully qualified hostname, or if it’s connectable but your dns is being difficult, perhaps you need an IP address instead of hostname.

yes, i can ping the hostname, it doesn’t connect with ip address too, i checked that and there’s no dns. it all was working fine before i changed the network switch used between the pcs

If it responds to a ping, and it’s not a DNS issue, you’re probably just left with a port-issue. If you can verify that the repository is indeed running, of course.

I’m not sure how we can troubleshoot this remotely, to be honest. But usual suspects are firewalls, either software based (eg. running on the Repository host machine or the client machine) or hardware based (on your router, but very unlikely on your switch. Though some enterprise switches have pretty complicated features that may mess with your routing).

looks like it was a static ipv4 problem, i changed it from static to auto and everything started working again, Thanks…!!

1 Like