Connection Problems to Atlas from my home Lan

Hello Folks, just could not find what is wrong here. Trying to connect to my free cluster from my home lan but didn’t work. From my azure VM works fine, so it’s not a database user or permission problem. I have whitelisted everything with Ports 27017,27016, and 27015 are working fine on my lan and on my notebook (Kubuntu 20). Tested with successfully and with curl, I can ping the cluster fine too, so I believe DNS is resolving fine. Anyway, I saw some stackoverflow posts and changed my DNS to google, prior was to OpenDns, but it didn’t work either. I’m running out of solutions, any tip of what’s going on? thanks.

Did you try with alternate internet connection like your mobile hotspot?
or Google DNS.Try long form of connect string and see if it works instead of SRV string

Thanks for replying Ramachandra, After your suggestions I tested with my mobile hotspot and get the same error. Changed the DNS to google second and nothing yet. As I got the same error with my mobile hotspot I became distrustful, it’s was not a network problem. My note is dual boot, so I run Windows and volia it works on the first trial, shell and compass, no config, no changes. So it seems the problem is with Kubuntu (20.04) nothing connecting there, shell or compass. WIll try to investigate a little bit more with Kubuntu and put the results here.

After a lot of reading and tests, I found a string that worked, it was basically added --tls and --tlsAllowInvalidCertificates to the connection string. I search a little bit but didn’t find any quick solutions to solve that. I know that allow invalid certificates is not supposed to be a good security thing but this database is for tests purposes only. and is a Linux thing of my configuration but I would like to understand it a little bit better. I could not pass to compass and Mongbooster this string so If there is a solution to connect without these constraints would be better. I created another Cluster in Azure, instead of AWS just to see if it was some kind of key issue with AWS server as they changed the certificates recently but it has nothing to do with that. The same is happening when connecting to Azure cluster, I have to put the tls’s strings. What do you think ? tks…

Yes not recommended
What is the issue with Compass.What error are you getting
You can get your Compass string from Atlas or try fill connection details option where yu specify individual params like hostname etc

Are you using any VPN,anti virus when attempting to connect to mongodb which cause port blocking,firewall issues
Or your home LAN has high security which does not allow connection

Compass cannot connect, gives me time-out after some time. I tried many string variations and none worked. The lan is working fine. I can totally connect through Windows 10 on the same machine. The problem now is with Kubuntu and security more specifically. It’s not a usual thing that I can connect with WIndows without any extra configuration, just install and run but had to make adjusts to Linux. Generally is the other way round, but nothing is perfect and the question now is just TLS. Mongo client is connecting but insecurely. I tried to understand how --AllowInvalidCertification works but could not understand very well at a first sight, I will have to dig a little bit to see what its the relation with SSL/TLS and this kind of security in Linux. If you have any tip pls let me know. Thanks.

@Fabio_Muller Can You share your connection string? I am facing the serverselectionerror.

Have you whitelisted your IP?
or try from another location/network

Yes. I listed my ip.

Are you trying by shell or Compass?
Are both failing?

You IP is not necessarily the one seen by the server.

See Cannot connect remotely to mongodb - #2 by steevej

HI @Riyad_Sm, I know there was another thread you had where you were getting timeouts even though other’s were able to connect to your Atlas cluster without issue.

According to this post you got things to work. Are you having problems once more? This post (the one were in now) appears to be dated before the post I linked above.

It’s best not to put the same problem in multiple posts as it makes it difficult for those trying to help out follow along with the progress of resolution to the problem.

@Doug_Duncan yes I am facing the problem again. I did mention that my problem was solved(I created a new mongo account). I worked for few days as well .but again I am facing the problem! I am completely idealess right now!
please help

Sorry to hear that the issue has returned. That doesn’t make any sense, but the original problem seemed to reside on your side with networking as I was able to connect to your Atlas instance with no issues.

All I can suggest is to look at the network access section for your Atlas cluster and verify that your IP address is in the allow list. For testing you can always add to allow access from anywhere, but I would remove that after testing for security reasons. If you can’t connect even with then you have networking issues that are keeping you from accessing the cluster, and I wouldn’t be able to help out much with that since I don’t have access to your machine to see what’s going on.

1 Like