Open jukkakilponen opened 2 years ago
@jukkakilponen, thanks for reporting. Would you like to raise a PR?
@dhmlau
This bug should have a regression
label. Our application is broken since upgrade of mongodb connector to 6.x! There have been security vulnerability fixes in 6.x, which we need but not at the expense of regressed behavior.
If no one is looking into, I'll take out some time over weekend to fix this.
@dhmlau @achrinza Can you assign this issue to me? I've coded up a fix, working on unit tests and as soon as done, will raise a PR.
Any updates on this issue since we are also facing the same issue and we are not able to use SRV in our current deployment architecture
@manarhusrieh My PR has been awaiting merge. @achrinza could you please confirm who would be reviewing and merging the PR?
@jaishirole I think you will need to resolve conflicts in your PR and rebase again on the latest version
Hi guys, Any update on this issue?
I think the PR is close to being merged, but it needs some conflicts resolved by @jaishirole and final approval.
It's worth mentioning that 6.1.0 do not have this issue
Steps to reproduce
Have a mongodb connection string with multiple hosts and ports (Replica Set or Sharded Cluster) as in https://www.mongodb.com/docs/manual/reference/connection-string/. For example mongodb://mongos0.example.com:27017,mongos1.example.com:27017,mongos2.example.com:27017
Current Behavior
Cannot start the application. TypeError [ERR_INVALID_URL]: Invalid URL: mongodb://mongos0.example.com:27017,mongos1.example.com:27017,mongos2.example.com:27017
Expected Behavior
Should connect to database.
Additional information
Tested with 6.2.0. The problem seems to be the use of nodejs URL to parse the connection string. The URL does not support multiple hosts with port numbers. See https://github.com/whatwg/url/issues/398. Problem introduced in commit 1d8a84b.
Related Issues