-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: None
What problem are you facing?
Cannot connect to MongoDB using unix domain socket, server selection fails. It will work only with localhost:27017, but if you inspect the variables a number of port/host properties on connection/node socket/server description is undefined implying this only works because of some defaults.
What driver and relevant dependency versions are you using?
4.x, this works in 3.x
Steps to reproduce?
Sample connection string
mongodb://bob:pwd123@%2Ftmp%2Fmongodb-31000.sock,%2Ftmp%2Fmongodb-31001.sock,%2Ftmp%2Fmongodb-31002.sock/
const host = [31000, 31001, 31002].map(p => encodeURIComponent(`/tmp/mongodb-${p}.sock`)).join(','); const cs = `mongodb://bob:pwd123@${host}/`; const client = new MongoClient(cs, { serverSelectionTimeoutMS: 3000 }); await client.connect(); // fails server selection
- has to be finished together with
-
NODE-4159 SDAM should remove servers that have a different setName and set serverDescription fields to null on Unknown servers
-
- Closed
-