-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal, Networking
-
None
-
Environment:MacOS Darwin go1.12.5
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:
- Full reproduction of the issue with links to the clusters, port, telnet tests, MongoShell connection.
- Go Main Code based on the MongoDB Go Driver Tutorial posted on March 20, 2019, Password in connection string has been redacted https://www.mongodb.com/blog/post/mongodb-go-driver-tutorial-part-1-connecting-using-bson-and-crud-operations/
- backported by
-
GODRIVER-1027 Unable to connect to mongodb from golang application
- Closed
- duplicates
-
GODRIVER-1032 MongoDB Atlas CommandNotFound with Updated Go Driver
- Closed