I am getting a connection error(attached the log below). Just so you know, I have:
- Changed my region and created two more clusters same errors.
- Whitelisted two additional ip addresses from different routers and 4G networks, same error. Replaced the connection strings as well.
Error log:
felix@Felixmanschaft23:~/coding-projects/users-expressjs-api$ npm start
> users-expressjs-api@1.0.0 start
> nodemon
[nodemon] 3.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/**/*
[nodemon] watching extensions: ts,js
[nodemon] starting `ts-node ./src/index.ts`
(node:45749) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Server running on port http://localhost:8080/
MongoServerError: bad auth : authentication failed
at Connection.onMessage (/home/felix/coding-projects/users-expressjs-api/node_modules/mongodb/src/cmap/connection.ts:409:18)
at MessageStream.<anonymous> (/home/felix/coding-projects/users-expressjs-api/node_modules/mongodb/src/cmap/connection.ts:239:56)
at MessageStream.emit (node:events:515:28)
at MessageStream.emit (node:domain:488:12)
at processIncomingData (/home/felix/coding-projects/users-expressjs-api/node_modules/mongodb/src/cmap/message_stream.ts:193:12)
at MessageStream._write (/home/felix/coding-projects/users-expressjs-api/node_modules/mongodb/src/cmap/message_stream.ts:74:5)
at writeOrBuffer (node:internal/streams/writable:556:12)
at _write (node:internal/streams/writable:490:10)
at MessageStream.Writable.write (node:internal/streams/writable:494:10)
at TLSSocket.ondata (node:internal/streams/readable:985:22) {
ok: 0,
code: 8000,
codeName: 'AtlasError',
connectionGeneration: 0,
[Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }
}
/home/felix/coding-projects/users-expressjs-api/node_modules/mongodb/src/cmap/connection.ts:409
callback(new MongoServerError(document));
^
MongoServerError: bad auth : authentication failed
at Connection.onMessage (/home/felix/coding-projects/users-expressjs-api/node_modules/mongodb/src/cmap/connection.ts:409:18)
at MessageStream.<anonymous> (/home/felix/coding-projects/users-expressjs-api/node_modules/mongodb/src/cmap/connection.ts:239:56)
at MessageStream.emit (node:events:515:28)
at MessageStream.emit (node:domain:488:12)
at processIncomingData (/home/felix/coding-projects/users-expressjs-api/node_modules/mongodb/src/cmap/message_stream.ts:193:12)
at MessageStream._write (/home/felix/coding-projects/users-expressjs-api/node_modules/mongodb/src/cmap/message_stream.ts:74:5)
at writeOrBuffer (node:internal/streams/writable:556:12)
at _write (node:internal/streams/writable:490:10)
at MessageStream.Writable.write (node:internal/streams/writable:494:10)
at TLSSocket.ondata (node:internal/streams/readable:985:22) {
ok: 0,
code: 8000,
codeName: 'AtlasError',
connectionGeneration: 0,
[Symbol(errorLabels)]: Set(2) { 'HandshakeError', 'ResetPool' }
}
[nodemon] app crashed - waiting for file changes before starting...