-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.9.0, 4.9.1
-
Component/s: Connection String
import { MongoClient } from 'mongodb-4.9.1'; await MongoClient.connect(`mongodb://[::1]:27444/`);
fails with
$ node test.mjs node:internal/errors:477 ErrorCaptureStackTrace(err); ^TypeError [ERR_INVALID_URL]: Invalid URL at new NodeError (node:internal/errors:387:5) at URL.onParseError (node:internal/url:564:9) at new URL (node:internal/url:640:5) at new HostAddress (/tmp/z/node_modules/mongodb-4.9.1/lib/utils.js:882:36) at Function.fromString (/tmp/z/node_modules/mongodb-4.9.1/lib/utils.js:932:16) at ServerDescription.get hostAddress [as hostAddress] (/tmp/z/node_modules/mongodb-4.9.1/lib/sdam/server_description.js:66:36) at new Server (/tmp/z/node_modules/mongodb-4.9.1/lib/sdam/server.js:31:56) at createAndConnectServer (/tmp/z/node_modules/mongodb-4.9.1/lib/sdam/topology.js:477:20) at /tmp/z/node_modules/mongodb-4.9.1/lib/sdam/topology.js:175:13 at Array.map (<anonymous>) { input: 'mongodb://::1:27444', code: 'ERR_INVALID_URL' }
4.8.1 does not exhibit this behavior.
AC
- Pass true to the toString method on host address objects in the server description.
- This is reproducible locally, make sure that this works in your local.
- Add a unit test that verifies the IPV6 address string on the server description matches the key in the descriptions map in the topology.
- if IPV4 is a simple test, add a regression test.
- is depended on by
-
COMPASS-5947 Can't connect to ipv6 only replicaset
- Closed
- is related to
-
COMPASS-5947 Can't connect to ipv6 only replicaset
- Closed
-
MONGOSH-1294 Add IPv6 connectivity tests to the mongosh test suite
- Open
- related to
-
NODE-4622 Investigate why we cannot connect to IPv6 replicaset with 4.x driver
- Closed