Thank you for your reply!
I am connecting to a mongodb atlas cluster.
I have a dedicated cluster using M10.
example:
mongodb+srv://admin:@cluster0.somecluster.mongodb.net/?retryWrites=true&w=majority
If I understand correctly port 27020 is for running mongocryptd. But I don’t have a MongoDB Enterprise Server. But connecting to Atlas locally shouldn’t be a problem?
I am using this demo for example that gives me the error:
Nodejs version: v18.17.0
mongodb version: v7.0.2
mongodb driver version ^6.0.0
and this is the error stack trace:
MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27020
at EventTarget.<anonymous> (/Users/pinchashodadad/Downloads/docs-in-use-encryption-examples-main/csfle/node/local/reader/node_modules/mongodb/lib/sdam/topology.js:276:34)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:741:20)
at EventTarget.dispatchEvent (node:internal/event_target:683:26)
at abortSignal (node:internal/abort_controller:368:10)
at TimeoutController.abort (node:internal/abort_controller:402:5)
at Timeout.<anonymous> (/Users/pinchashodadad/Downloads/docs-in-use-encryption-examples-main/csfle/node/local/reader/node_modules/mongodb/lib/utils.js:1011:92)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7) {
reason: TopologyDescription {
type: 'Unknown',
servers: Map(1) {
'localhost:27020' => ServerDescription {
address: 'localhost:27020',
type: 'Unknown',
hosts: [],
passives: [],
arbiters: [],
tags: {},
minWireVersion: 0,
maxWireVersion: 0,
roundTripTime: -1,
lastUpdateTime: 1822125,
lastWriteDate: 0,
error: MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27020
at connectionFailureError (/Users/pinchashodadad/Downloads/docs-in-use-encryption-examples-main/csfle/node/local/reader/node_modules/mongodb/lib/cmap/connect.js:379:20)
at Socket.<anonymous> (/Users/pinchashodadad/Downloads/docs-in-use-encryption-examples-main/csfle/node/local/reader/node_modules/mongodb/lib/cmap/connect.js:285:22)
at Object.onceWrapper (node:events:629:26)
at Socket.emit (node:events:514:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
[Symbol(errorLabels)]: Set(1) { 'ResetPool' },
[cause]: Error: connect ECONNREFUSED 127.0.0.1:27020
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 27020
}
},
topologyVersion: null,
setName: null,
setVersion: null,
electionId: null,
logicalSessionTimeoutMinutes: null,
primary: null,
me: null,
'$clusterTime': null
}
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
[Symbol(errorLabels)]: Set(0) {},
[cause]: MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27020
at connectionFailureError (/Users/pinchashodadad/Downloads/docs-in-use-encryption-examples-main/csfle/node/local/reader/node_modules/mongodb/lib/cmap/connect.js:379:20)
at Socket.<anonymous> (/Users/pinchashodadad/Downloads/docs-in-use-encryption-examples-main/csfle/node/local/reader/node_modules/mongodb/lib/cmap/connect.js:285:22)
at Object.onceWrapper (node:events:629:26)
at Socket.emit (node:events:514:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
[Symbol(errorLabels)]: Set(1) { 'ResetPool' },
[cause]: Error: connect ECONNREFUSED 127.0.0.1:27020
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 27020
}
}
}```
thank you in advance!