nettu-meet
nettu-meet copied to clipboard
MongoError: Authentication failed.
Hey!
Thought the project looked really cool so wanted to give it a try.
I have got to the npm start of the server, but I am getting an error which seems to be a problem mongodb.
➜ server git:(main) ✗ npm start
> [email protected] start
> ./integrations/start.sh
[INFO] 14:24:39 ts-node-dev ver. 1.0.0 (using ts-node ver. 9.1.0, typescript ver. 4.1.2)
starting mediasoup
[App]: Listening on port 5000
[Redis]: Connected to redis server at localhost:6379
db error
MongoError: Authentication failed.
at MessageStream.messageHandler (/Users/martyn/Code/nettu-meet/server/node_modules/mongodb/lib/cmap/connection.js:268:20)
at MessageStream.emit (node:events:376:20)
at MessageStream.EventEmitter.emit (node:domain:470:12)
at processIncomingData (/Users/martyn/Code/nettu-meet/server/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream._write (/Users/martyn/Code/nettu-meet/server/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at writeOrBuffer (node:internal/streams/writable:395:12)
at MessageStream.Writable.write (node:internal/streams/writable:340:10)
at Socket.ondata (node:internal/streams/readable:748:22)
at Socket.emit (node:events:376:20)
at Socket.EventEmitter.emit (node:domain:470:12) {
ok: 0,
code: 18,
codeName: 'AuthenticationFailed'
}
Trace:
at new UnexpectedError (/Users/martyn/Code/nettu-meet/server/src/shared/core/AppError.ts:7:21)
at CreateDefaultAccountUseCase.execute (/Users/martyn/Code/nettu-meet/server/src/modules/account/useCases/createDefaultAccount/CreateDefaultAccountUseCase.ts:52:25)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
at CreateDefaultAccountController.execute (/Users/martyn/Code/nettu-meet/server/src/modules/account/useCases/createDefaultAccount/CreateDefaultAccountController.ts:26:28)
[AppError]: An unexpected error occurred
TypeError: Cannot read property 'findOne' of undefined
Unable to create default account
{
message: 'An unexpected error occurred.',
error: "TypeError: Cannot read property 'findOne' of undefined"
}
TypeError: Cannot read property 'collection' of undefined
at /Users/martyn/Code/nettu-meet/server/src/shared/infra/db/BaseRepo.ts:16:35
at processTicksAndRejections (node:internal/process/task_queues:93:5)
[ERROR] 14:24:43 TypeError: Cannot read property 'collection' of undefined
My .env currently looks like the default, but with the mediasoup listenIP changed to my computers public ip.
Any help is appreciated!
Mhm, strange.
Do you use the docker compose file to spin up the mongodb container? In that case does your mongodb credentials in the .env file correspond with the values in the docker-compose.yml file?
Hey!
Yeah, I used npm run infra and it created the two docker containers (redis and mongo). I haven't changed anything in my .env, and it looks like they have the same values

I went into the terminal for the docker image and it looks like there is no database for nettu-meeting?

I have tried destroying and recreating but still having the same issues. It's been a few years since I last used mongo so not really sure how to debug -.- . Happy to try anything.