[GODRIVER-1313] not able to connect to determine replica set set and due to this all query are failing Created: 16/Sep/19  Updated: 27/Oct/23  Resolved: 17/Oct/19

Status: Closed
Project: Go Driver
Component/s: Authentication, Connections, Internal
Affects Version/s: 1.1.1, 1.1.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: DHARMADEV gupta Assignee: Divjot Arora (Inactive)
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

docker
OS – macos 1.14.6
golang version : go 1.13
mongo go driver 1.1.0 or 1.1.1 tested with both
docker : 19.03.2



 Description   

hi,

we are able to run properly when server run on os as localhost.

But when we run on docker..

We are  connecting to mongo db , connection got established.

But when making call to mongo.ping it not able to connect and gives the below error.

so we removed ping call and made some queries to db we got same error..

Error: 

 
Internal error: server selection error: server selection timeout\ncurrent topology: Type: ReplicaSetNoPrimary\nServers:\nAddr: xxxxxxxxxxxx:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: connection



 Comments   
Comment by Divjot Arora (Inactive) [ 03/Oct/19 ]

Hi dharmadev2@gmail.com, the reason you see this error on Ping instead of Connect is because Connect doesn't do any I/O. It spins up some goroutines to monitor servers in the background. In contrast, Ping sends a ping command to the server. We've seen some issues due to docker setups in the past. Can you check if https://stackoverflow.com/questions/56393513/docker-and-mongo-go-driver-server-selection-error has anything to do with your issue?

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