I’m using golang and mongo-go-driver
I’m pretty confident that the code has no problem for it is pretty simple test example.
but suspecting something could be done with connection url here:
client, err := mongo.NewClient(options.Client().ApplyURI(“mongodb+srv://myid:mypwr@testcluster-pri.ubx7y.mongodb.net/Databases?retryWrites=true&w=majority”))
I’ve got peer connection between GCP VPC to Atlas.
have 0.0.0.0/0 for IP access list.
but I’m getting
server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: firstcluster-shard-00-00-pri.ubx7y.mongodb.net:27017, Type: Unknown, Average RTT: 0, Last error: connection() error occured during connection handshake: dial tcp 192.168.208.2:27017: i/o timeout }, { Addr: firstcluster-shard-00-01-pri.ubx7y.mongodb.net:27017, Type: Unknown, Average RTT: 0, Last error: connection() error occured during connection handshake: dial tcp 192.168.208.3:27017: i/o timeout }, { Addr: firstcluster-shard-00-02-pri.ubx7y.mongodb.net:27017, Type: Unknown, Average RTT: 0, Last error: connection() error occured during connection handshake: dial tcp 192.168.208.4:27017: i/o timeout }, ] }
I have no idea what causes the problem…