[GODRIVER-1027] Unable to connect to mongodb from golang application Created: 08/May/19  Updated: 13/May/19  Resolved: 10/May/19

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

Type: Bug Priority: Major - P3
Reporter: Zoom Tail Assignee: Jeffrey Yemin
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
backports GODRIVER-1038 MongoDB Go Driver does not connect to... Closed
Duplicate
duplicates GODRIVER-829 Go 1.11 LookupSRV cannot unmarshal DN... Closed

 Description   

Failed to define a client that will connect to Mongo%!(EXTRA *internal.wrappedError=error parsing uri (mongodb+srv://usr:pwd@development-xtumr.mongodb.net/db?retryWrites=true): lookup development-xtumr.mongodb.net on 127.0.0.53:53: cannot unmarshal DNS message



 Comments   
Comment by Chris Wakare [ 11/May/19 ]

Hi,
Changing DNS  does not work

OS: macOS Mojave 10.14.1
Go version: go1.12.4 darwin/amd64

DNS Servers
nameserver 208.67.220.220
nameserver 208.67.222.222
nameserver 8.8.8.8
nameserver 8.8.4.4

Error:
panic: server selection error: server selection timeout
current topology: Type: ReplicaSetNoPrimary

Type: Unknown, State: Connected, Average RTT: 0, Last error: (CommandNotFound) command not found

MongoDB Information
Connecting to:  Atlas Mongodb
Instance Size M0 Sandbox (General)
Region AWS / Singapore (ap-southeast-1)
Type Replica Set - 3 nodes

Had downloaded the latest mongodb go driver using the command
go get go.mongodb.org/mongo-driver

Comment by Jeffrey Yemin [ 10/May/19 ]

Hi geeks@zoomtail.com

Given you're on 1.12 we do still suspect this is a duplicate of GODRIVER-829, so I'm going to close this as a duplicate. Please experiment with a different DNS server, and if it turns out this is something else, we can re-open.

Comment by Zoom Tail [ 10/May/19 ]

Hi,

 

My current go version is go1.12.1 linux/amd64. 

The content of /etc/resolv.conf file in my aws' instance is 

nameserver 127.0.0.53
options edns0
search ap-south-1.compute.internal

Comment by Jeffrey Yemin [ 09/May/19 ]

geeks@zoomtail.com

Please let us know what version of Go you are using. We suspect this is the same as GODRIVER-829.

Comment by miguel pragier [ 08/May/19 ]

Similar problem here, since yesterday (mai/07) when we updated ( go get / git pull ) mongo driver.

 

CONNECTIONSTRING: 

"mongodb+srv://password@cluster0-hostxyz.mongodb.net/databasename?retryWrites=true"

 

ROW:

if errx := client.Ping(context.TODO(), readpref.Primary()); errx != nil {

 

ERROR:

panic: server selection error: server selection timeout
current topology: Type: ReplicaSetNoPrimary
Servers:
Addr: cluster0-shard-00-01-XXXXX.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: (CommandNotFound) command not found
Addr: cluster0-shard-00-02-XXXXX.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: (CommandNotFound) command not found
Addr: cluster0-shard-00-00-XXXXX.mongodb.net:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: (CommandNotFound) command not found

 

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