Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1038

MongoDB Go Driver does not connect to M0 Free Tier Instance

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal, Networking
    • Labels:
      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:

        1. main.go
          1 kB
        2. Repro.txt
          11 kB

            Assignee:
            Unassigned Unassigned
            Reporter:
            sean.moran@mongodb.com Seán Moran
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: