-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
What problem are you facing?
MongoServerSelectionError: connect ECONNREFUSED ::1:27017 at Timeout._onTimeout (/Users/neal/code/drivers/js/driver-v4/src/sdam/topology.ts:618:30) at listOnTimeout (node:internal/timers:559:17) at processTimers (node:internal/timers:502:7) { reason: TopologyDescription { type: 'Unknown', servers: Map(1) { 'localhost:27017' => [ServerDescription] }, stale: false, compatible: true, heartbeatFrequencyMS: 10000, localThresholdMS: 15, logicalSessionTimeoutMinutes: undefined }, code: undefined }
What driver and relevant dependency versions are you using?
Node.js v17.7.1
Steps to reproduce?
import { MongoClient } from './src/index'; const client = new MongoClient('mongodb://bob:pwd123@localhost:27017/', { serverSelectionTimeoutMS: 1000, // family: 4 <- this arg fixes it, but it shouldn't become a requirement }); async function main(args) { await client.connect(); console.log('connected'); } main(process.argv) .then(console.log) .catch(console.error) .finally(() => client.close());
Acceptance Criteria
- Fix localhost connection issue on Node.js 17
- Verify the fix locally
- is depended on by
-
NODE-3723 Add Node.js 16 LTS to CI matrix
- Closed
- related to
-
DRIVERS-402 Implement fallback to IP v4/IP v6 vice-versa
- Closed