I am not sure what has changed. I am pretty sure I got both connection URLs from Atlas, so is Atlas somehow giving me the wrong URL?
My cluster is M40.
The surprising thing is, the Java driver works OK and connects using mongodb+srv://cdf46a6c-6797-40e1-a655-pri.35m0c.mongodb.net. I am providing only basic connection parameters like username, password, SSL etc and no extra/different options to the Java driver, compared to the Python driver.
The Python driver fails to connect with mongodb+srv://cdf46a6c-6797-40e1-a655-pri.35m0c.mongodb.net but it works well with cdf46a6c-6797-40e1-a655.35m0c.mongodb.net
Ping doesn’t work for either of the hostnames, see below:
msrao@msrao-r ~ [68]> ping cdf46a6c-6797-40e1-a655-pri.35m0c.mongodb.net
ping: cannot resolve cdf46a6c-6797-40e1-a655-pri.35m0c.mongodb.net: Unknown host
msrao@msrao-r ~ [68]> ping cdf46a6c-6797-40e1-a655.35m0c.mongodb.net
ping: cannot resolve cdf46a6c-6797-40e1-a655.35m0c.mongodb.net: Unknown host
msrao@msrao-r ~ [68]>
From Atlas interface, I have tried getting the connect string for mongo shell (mongosh and mongo older), Java Driver and Python driver. All of them return the URL with ‘pri’ in it.
Open questions
- Which is the right host to connect to, the one with pri or the one without?
- Why can Java driver connect to the host with ‘pri’ in it but Python driver cannot?