Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
0.3.0, 0.2.0
-
None
-
Atlas Sandbox replica cluster with 3 nodes, deployed on AWS M0 instances, Version 4.0.6
Description
I'm able to connect to an Atlas-hosted sandbox replica set cluster, but running any subsequent query (e.g. drop collection) is returning the following error:
Database connection established
|
panic: server selection error: server selection timeout
|
current topology: Type: ReplicaSetNoPrimary
|
Servers:
|
Addr: <address0>, Type: Unknown, State: Connected, Avergage RTT: 0, Last error: x509: certificate signed by unknown authority |
Addr: <address1>, Type: Unknown, State: Connected, Avergage RTT: 0, Last error: x509: certificate signed by unknown authority |
Addr: <address2>, Type: Unknown, State: Connected, Avergage RTT: 0, Last error: x509: certificate signed by unknown authority |
The code I'm using to connect is this:
package main |
|
|
import ( |
"fmt" |
"github.com/mongodb/mongo-go-driver/mongo" |
"context" |
)
|
|
|
func main() {
|
client, err := mongo.NewClient("<srv-connection-string>") |
if err != nil { |
panic(err)
|
}
|
if err := client.Connect(context.Background()); err != nil { |
panic(err)
|
}
|
db := client.Database("test") |
fmt.Println("Database connection established") |
if err := db.Collection("messages").Drop(context.Background()); err != nil { |
panic(err)
|
}
|
}
|
Connecting via Python works:
>>> import pymongo |
>>> client = pymongo.MongoClient("<srv-connection-string>") |
>>> db = client.test
|
>>> print(db.messages.insert_one({"a": 1})) |
<pymongo.results.InsertOneResult object at 0x107fe22c8> |
>>> db.messages.find_one()
|
{'_id': ObjectId('5c6aec3224444fbd3fa43121'), 'a': 1} |
>>> print(db.messages.drop())
|
None
|
>>> print(db.messages.find_one())
|
None
|
Attachments
Issue Links
- duplicates
-
GODRIVER-351 Investigate Darwin root certs Go bug and workarounds
-
- Closed
-