Sometimes have the following exceptions-
1. SocketException: Software caused connection abort (OS Error: Software caused connection abort, errno = 103), address = cluster0-shard-00-02.XXXXX.mongodb.net, port = 42848
ConnectionException: connection closed: The socket connection has been reset by peer.
Possible causes:
- Trying to connect to an ssl/tls encrypted database without specifiyng
either the query parm tls=true or the secure=true parameter in db.open()
- The server requires a key certificate from the client, but no certificate has been sent
- Others
The conect string is not as per SRV format
You can get it from your Atlas account
It should not have individual hostnames and replicaset name.Looks like you mixed both SRV & long form of strings
I am surprised that you get the error No address associated with hostname as this error would indicate that you are missing +srv in your connection string. A cluster has no host name address it has a seed list record which is different and generates a different error message.
Hiding your real cluster name does not help us helping you.
Hiding your cluster name relies on security through obscurity. Appropriate network setup and user access is a better way.
id 23124
opcode QUERY
rcode NOERROR
flags QR RD RA
;QUESTION
cluster0.lyltx.mongodb.net. IN ANY
;ANSWER
cluster0.lyltx.mongodb.net. 60 IN TXT "authSource=admin&replicaSet=atlas-7g2b5k-shard-0"
;AUTHORITY
;ADDITIONAL
There are however some inconsistencies with what you posted earlier.
You specified
but the real replica set name is atlas-7g2b5k-shard-0. How did you get the razveo name?
Basically, the following should work with the appropriate user name and password.
If it still does not work, verify that
you allow connections from your public IP in network security
that your firewall, isp or vpn allows outgoing connection via port 27017
Thanks
I just updated the replica as your suggestion in my long format . and its working
The short format didn’t work
Is it possible that I need to add parameters for the cluster?
Now I will see if have more exceptions