|
Two customers reported on Intercom they could not connect to their MongoDB Atlas Cluster M0 instance using the MongoDB Go Driver.
I triaged their environment, ping, telnet, ports, connection string, whitelist all good. They can connect with the MongoShell but not the MongoDB Go Driver. I suspected this was SRV/DNS related but I got the same error with both the SRV and Standard Connection strings.
I've reproduced their issue.
Loaner-2-Dublin:GoCode mongodb$ go run main.go
|
2019/05/13 11:46:52 server selection error: server selection timeout
|
current topology: Type: ReplicaSetNoPrimary
|
Servers:
|
Addr: mongodbcluster-shard-00-00-cqyvf.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: (CommandNotFound) command not found
|
Addr: mongodbcluster-shard-00-01-cqyvf.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: (CommandNotFound) command not found
|
Addr: mongodbcluster-shard-00-02-cqyvf.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: (CommandNotFound) command not found
|
exit status 1
|
And diagnosed that this error is only produced when connecting to the M0 Cluster Tier. I haven't checked M2/M5. I get this result when connecting to M10
Loaner-2-Dublin:GoCode mongodb$ go run main.go
|
Connected to MongoDB!
|
Connection to MongoDB closed.
|
Attached is:
|