I have been making a React and NextJS App for a month now and I use MongoDB for the database. I use it through MongoDB Atlas. It is also just the free version.
I use NextJS’s api folder for the backend.
I have had no problems at all and everything works just fine. Suddenly I have started to get these errors:
error - MongoNetworkError: connect ETIMEDOUT 18.166.253.100:27017
at connectionFailureError (C:UsersasusDesktopmymart-sellernode_modulesmongodblibcmapconnect.js:383:20)
at TLSSocket.<anonymous> (C:UsersasusDesktopmymart-sellernode_modulesmongodblibcmapconnect.js:307:22)
at Object.onceWrapper (node:events:628:26)
at TLSSocket.emit (node:events:513: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) {
cause: Error: connect ETIMEDOUT 18.166.253.100:27017
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -4039,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '18.166.253.100',
port: 27017
},
connectionGeneration: 0,
page: '/64374cbc7f69b08c1cd4e68c/categories/Category/product%201',
[Symbol(errorLabels)]: Set(1) { 'ResetPool' }
As well as this one:
error - MongoServerSelectionError: connect ETIMEDOUT 18.166.253.100:27017
at Timeout._onTimeout (C:UsersasusDesktopmymart-sellernode_modulesmongodblibsdamtopology.js:277:38)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7) {
reason: TopologyDescription {
type: 'ReplicaSetNoPrimary',
servers: Map(3) {
'ac-rtwqyt0-shard-00-01.cln6x4h.mongodb.net:27017' => [ServerDescription],
'ac-rtwqyt0-shard-00-02.cln6x4h.mongodb.net:27017' => [ServerDescription],
'ac-rtwqyt0-shard-00-00.cln6x4h.mongodb.net:27017' => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: 'atlas-hup2a6-shard-0',
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: 30
},
code: undefined,
page: '/api/new-variation',
[Symbol(errorLabels)]: Set(0) {}
}
I dont think the problem is with my code and how it receives the data since even an old project from a React and NextJs course started to get this issue.
Im not using a vpn or something to change my IP address either.
Does anyone know what causes this? Is there a setting or option that could have changed that I need to fix?
Is MongoDB currently under maintenance or full?
Any help would be greatly appreciated. Feel free to ask any questions.
Thank you!