Problem description:
I’m receiving error when connecting to my MongoDB in replit. It started to happen a few minutes ago. I posted the same exact issue here: MongoDB suddenly stopped working (MongoServerSelectionError: ReplicaSetNoPrimary). The error on that previous thread got fixed after 24 hours.
Where’s the fix for this bug?? Should I wait 24 hours again and let time fix this again?? Is this inevitable? I can connect just fine with Visual Studio local client. This error seems ongoing for a month now. Even the guys from MongoDB said it’s been an ongoing issue since November 2022 and replit team can’t seem to make any changes about it. I’m wasting precious time.
Expected behavior:
It should connect just fine.
Actual behavior:
It shows these errors,
MongoServerSelectionError: getaddrinfo ENOTFOUND ac-8q8dm3y-shard-00-00.5ldtt3z.mongodb.net
at Timeout._onTimeout (/home/runner/Bojji/node_modules/mongodb/lib/sdam/topology.js:285:38)
at listOnTimeout (node:internal/timers:557:17) {
reason: TopologyDescription {
type: ‘ReplicaSetNoPrimary’,
servers: Map(3) {
‘primary’ => [ServerDescription],
‘secondary’ => [ServerDescription],
‘secondary’ => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: ‘atlas-q5c7wq-shard-0’,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
[Symbol(errorLabels)]: Set(0) {}
}
Steps to reproduce:
Establish connection to MongoDB
Run code.
Browser/OS/Device:
Windows 11