============= Go Version go-1.12.5.mojave.bottle.tar.gz ============== Go Env ============== Loaner-2-Dublin:GoCode mongodb$ go version go version go1.12.5 darwin/amd64 Loaner-2-Dublin:GoCode mongodb$ go env GOARCH="amd64" GOBIN="" GOCACHE="/Users/mongodb/Library/Caches/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/mongodb/go" GOPROXY="" GORACE="" GOROOT="/usr/local/Cellar/go/1.12.5/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.12.5/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hj/rc_ntpqx3qv1lkqh5447gpc80000gp/T/go-build477885114=/tmp/go-build -gno-record-gcc-switches -fno-common" Loaner-2-Dublin:GoCode mongodb$ ============== MongoDB Atlas Cluster https://cloud.mongodb.com/v2/5c790081014b768fd2485322#clusters M0 Sandbox (General) Version 4.0.9 REGION AWS / Frankfurt (eu-central-1) ============== Repro ============== Last login: Mon May 13 08:55:45 on ttys000 Loaner-2-Dublin:~ mongodb$ brew install go Updating Homebrew... ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> Updated Formulae amazon-ecs-cli libnfs angular-cli libnice app-engine-python libntlm asciidoctorj libodfgen atlassian-cli libofx azure-storage-cpp libopenmpt babel libpq bartycrouch libpqxx bazel libprotoident bee libpsl cfn-lint libshout checkbashisms libtrace checkstyle libvirt cointop libwpd conan libwpg cypher-shell libxc davix mbedtls druid mdds efl mdk elasticsearch mesa elixir micronaut erlang mpd erlang@19 netdata eslint netpbm exiv2 nzbget faas-cli ola fibjs oniguruma fluxctl opencoarrays fonttools osm2pgrouting frugal postgresql gdb postgresql@9.6 geeqie prettier gegl profanity gexiv2 protoc-gen-go ghq pygobject gibo root glooctl serve gnunet serverless golo skaffold gosu socat grakn sourcekitten groovy supervisor groovysdk swi-prolog gtk-doc syncthing hbase teleport imagemagick terraforming istioctl terragrunt jenkins terrahub jenkins-lts tile38 jhipster topgrade joplin utf8proc jsdoc3 vault-cli juju vegeta kubeless verilator kubernetes-service-catalog-client webpack landscaper wiremock-standalone lazygit wtf libmtp yarn libmwaw youtube-dl ==> Deleted Formulae js-test-driver typesafe-activator ==> Downloading https://homebrew.bintray.com/bottles/go-1.12.5.mojave.bottle.tar ==> Downloading from https://akamai.bintray.com/72/7248d0975a00e71212adce983a64c ######################################################################## 100.0% ==> Pouring go-1.12.5.mojave.bottle.tar.gz 🍺 /usr/local/Cellar/go/1.12.5: 9,808 files, 452.6MB Loaner-2-Dublin:~ mongodb$ go get go.mongodb.org/mongo-driver package go.mongodb.org/mongo-driver: no Go files in /Users/mongodb/go/src/go.mongodb.org/mongo-driver Loaner-2-Dublin:~ mongodb$ ls Applications Documents Library Music Public myproject Desktop Downloads Movies Pictures go Loaner-2-Dublin:~ mongodb$ cd Do Documents/ Downloads/ Loaner-2-Dublin:~ mongodb$ cd Documents/ Loaner-2-Dublin:Documents mongodb$ ls GoCode Loaner-2-Dublin:Documents mongodb$ cd GoCode/ Loaner-2-Dublin:GoCode mongodb$ ls main.go main.txt Loaner-2-Dublin:GoCode mongodb$ go run main.go # command-line-arguments ./main.go:29:5: imported and not used: "go.mongodb.org/mongo-driver/bson" 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 ============= MongoDB Shell ============= Last login: Mon May 13 11:37:54 on ttys000 Loaner-2-Dublin:~ mongodb$ mongo "mongodb+srv://mongodbcluster-cqyvf.mongodb.net/test" --username MongoDBUser MongoDB shell version v4.0.9 Enter password: connecting to: mongodb://mongodbcluster-shard-00-01-cqyvf.mongodb.net.:27017,mongodbcluster-shard-00-02-cqyvf.mongodb.net.:27017,mongodbcluster-shard-00-00-cqyvf.mongodb.net.:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=MongoDBCluster-shard-0&ssl=true 2019-05-13T11:47:34.381+0100 I NETWORK [js] Starting new replica set monitor for MongoDBCluster-shard-0/mongodbcluster-shard-00-01-cqyvf.mongodb.net.:27017,mongodbcluster-shard-00-02-cqyvf.mongodb.net.:27017,mongodbcluster-shard-00-00-cqyvf.mongodb.net.:27017 2019-05-13T11:47:34.549+0100 I NETWORK [js] Successfully connected to mongodbcluster-shard-00-02-cqyvf.mongodb.net.:27017 (1 connections now open to mongodbcluster-shard-00-02-cqyvf.mongodb.net.:27017 with a 5 second timeout) 2019-05-13T11:47:34.549+0100 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to mongodbcluster-shard-00-01-cqyvf.mongodb.net.:27017 (1 connections now open to mongodbcluster-shard-00-01-cqyvf.mongodb.net.:27017 with a 5 second timeout) 2019-05-13T11:47:34.720+0100 I NETWORK [js] Successfully connected to mongodbcluster-shard-00-00-cqyvf.mongodb.net:27017 (1 connections now open to mongodbcluster-shard-00-00-cqyvf.mongodb.net:27017 with a 5 second timeout) 2019-05-13T11:47:34.722+0100 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to mongodbcluster-shard-00-00-cqyvf.mongodb.net.:27017 (1 connections now open to mongodbcluster-shard-00-00-cqyvf.mongodb.net.:27017 with a 5 second timeout) 2019-05-13T11:47:34.750+0100 I NETWORK [js] changing hosts to MongoDBCluster-shard-0/mongodbcluster-shard-00-00-cqyvf.mongodb.net:27017,mongodbcluster-shard-00-01-cqyvf.mongodb.net:27017,mongodbcluster-shard-00-02-cqyvf.mongodb.net:27017 from MongoDBCluster-shard-0/mongodbcluster-shard-00-00-cqyvf.mongodb.net.:27017,mongodbcluster-shard-00-01-cqyvf.mongodb.net.:27017,mongodbcluster-shard-00-02-cqyvf.mongodb.net.:27017 2019-05-13T11:47:34.893+0100 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to mongodbcluster-shard-00-02-cqyvf.mongodb.net:27017 (1 connections now open to mongodbcluster-shard-00-02-cqyvf.mongodb.net:27017 with a 5 second timeout) 2019-05-13T11:47:35.004+0100 I NETWORK [js] Successfully connected to mongodbcluster-shard-00-00-cqyvf.mongodb.net:27017 (1 connections now open to mongodbcluster-shard-00-00-cqyvf.mongodb.net:27017 with a 0 second timeout) 2019-05-13T11:47:35.061+0100 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to mongodbcluster-shard-00-01-cqyvf.mongodb.net:27017 (1 connections now open to mongodbcluster-shard-00-01-cqyvf.mongodb.net:27017 with a 5 second timeout) Implicit session: session { "id" : UUID("dcfd8082-e383-4a4d-8120-b08c68060694") } MongoDB server version: 4.0.9 Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user MongoDB Enterprise MongoDBCluster-shard-0:PRIMARY> ============= Port Test and Ping ============= Last login: Mon May 13 11:47:05 on ttys001 Loaner-2-Dublin:~ mongodb$ curl http://portquiz.net:27017/ Port 27017 test successful! Your IP: 77.107.233.162 Loaner-2-Dublin:~ mongodb$ ping mongodbcluster-shard-00-00-cqyvf.mongodb.net PING ec2-3-120-114-119.eu-central-1.compute.amazonaws.com (3.120.114.119): 56 data bytes 64 bytes from 3.120.114.119: icmp_seq=0 ttl=47 time=30.569 ms 64 bytes from 3.120.114.119: icmp_seq=1 ttl=47 time=33.762 ms 64 bytes from 3.120.114.119: icmp_seq=2 ttl=47 time=32.089 ms 64 bytes from 3.120.114.119: icmp_seq=3 ttl=47 time=30.005 ms 64 bytes from 3.120.114.119: icmp_seq=4 ttl=47 time=30.729 ms 64 bytes from 3.120.114.119: icmp_seq=5 ttl=47 time=38.561 ms ¸¯64 bytes from 3.120.114.119: icmp_seq=6 ttl=47 time=30.284 ms 64 bytes from 3.120.114.119: icmp_seq=7 ttl=47 time=88.297 ms 64 bytes from 3.120.114.119: icmp_seq=8 ttl=47 time=29.997 ms ç64 bytes from 3.120.114.119: icmp_seq=9 ttl=47 time=29.398 ms 64 bytes from 3.120.114.119: icmp_seq=10 ttl=47 time=31.727 ms 64 bytes from 3.120.114.119: icmp_seq=11 ttl=47 time=32.091 ms 64 bytes from 3.120.114.119: icmp_seq=12 ttl=47 time=30.226 ms ¸64 bytes from 3.120.114.119: icmp_seq=13 ttl=47 time=30.416 ms ^Z [1]+ Stopped ping mongodbcluster-shard-00-00-cqyvf.mongodb.net ============= Tested with MongoDB Atlas Cluster M10 https://cloud.mongodb.com/v2/5c812bfec56c98531a9b889b#clusters MongoDBCluster Version 4.0.9 ============= Loaner-2-Dublin:GoCode mongodb$ go run main.go Connected to MongoDB! Connection to MongoDB closed.