Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
0.3.0
-
None
-
go1.11.5
go1.10.8
Description
Connecting to MongoDB using connection URI SRV in Go v1.11 generates an error: cannot unmarshal DNS message.
The following code works in Go v1.10 but not in Go v1.11:
mongoURI := "mongodb+srv://USER:PWD@ts-cluster-ci22a.mongodb.net/test?ssl=true&retryWrites=true"
|
client, err := mongo.NewClient(mongoURI)
|
if err != nil {
|
log.Fatal(err)
|
}
|
err = client.Connect(context.TODO())
|
if err != nil {
|
log.Fatal(err)
|
}
|
Also, the same code above works with non-SRV URI in Go v1.11.
This looks to be related to the change in the net package: https://github.com/golang/go/issues/10622
The call below would work in Go v1.10 but failed in Go v1.11:
_, _, err := net.LookupSRV("mongodb", "tcp", "ts-cluster-ci22a.mongodb.net")
|
if err != nil {
|
log.Fatal(err)
|
}
|
Attachments
Issue Links
- is duplicated by
-
GODRIVER-879 Not able to connect to MongoDB Atlas without starting local Mongo server
-
- Closed
-
-
GODRIVER-1027 Unable to connect to mongodb from golang application
-
- Closed
-
- is related to
-
GODRIVER-875 The golang driver is not able to parse the atlas DNS response for the connect URI
-
- Closed
-
- links to