[GODRIVER-1038] MongoDB Go Driver does not connect to M0 Free Tier Instance Created: 13/May/19  Updated: 13/May/19  Resolved: 13/May/19

Status: Closed
Project: Go Driver
Component/s: Internal, Networking
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Seán Moran Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MacOS Darwin go1.12.5


Attachments: Text File Repro.txt     File main.go    
Issue Links:
Backports
backported by GODRIVER-1027 Unable to connect to mongodb from gol... Closed
Duplicate
duplicates GODRIVER-1032 MongoDB Atlas CommandNotFound with Up... Closed

 Description   

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:


Generated at Thu Feb 08 08:35:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.