[GODRIVER-1795] Go driver fails to Ping() on WSL, while on Windows 10 it's OK Created: 16/Nov/20  Updated: 27/Oct/23  Resolved: 23/Nov/20

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

Type: Bug Priority: Major - P3
Reporter: Ivan Farkas Assignee: Kevin Albertson
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

WSL 2 Preview, Ubuntu 20.04 LTS, Kernel: 4.19.128-microsoft-standard (Windows 10 Pro Insider, Version 10.0.20257 Build 20257)



 Description   

The exact same code, connection string, and Atlas Mongo dB work on Windows 10.

Go driver fails to Ping() on WSL.

panic: server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: cluster0-shard-00-00.ug2za.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, { Addr: cluster0-shard-00-01.ug2za.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, { Addr: cluster0-shard-00-02.ug2za.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, ] } [recovered]panic: server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: cluster0-shard-00-00.ug2za.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, { Addr: cluster0-shard-00-01.ug2za.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, { Addr: cluster0-shard-00-02.ug2za.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, ] } [recovered] panic: server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: cluster0-shard-00-00.ug2za.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, { Addr: cluster0-shard-00-01.ug2za.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, { Addr: cluster0-shard-00-02.ug2za.mongodb.net:27017, Type: Unknown, Average RTT: 0 }, ] }
 

 



 Comments   
Comment by Ivan Farkas [ 23/Nov/20 ]

That is the case. Case closed. Thx.

Comment by Kevin Albertson [ 23/Nov/20 ]

Hi info@3dhdsoft.com, it appears that this was not an issue with the Go driver and that you were able to solve it. Please comment if that is not the case.

Comment by Ivan Farkas [ 19/Nov/20 ]

Issue

TLS does not work if generateResolvConf = false in /etc/wsl.conf
This was required to resolve DNS issues in the previous WSL 2.

Solution

/etc/wsl.conf

 

[network]
generateHosts = false
generateResolvConf = true

 

/etc/resolv.conf (generated)

 

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.31.48.1

 

Comment by Kevin Albertson [ 19/Nov/20 ]

Hello info@3dhdsoft.com, thank you for the bug report. We will look into this soon.

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