Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoError: Authentication failed. #22

Open
Swapnull opened this issue Jun 25, 2021 · 2 comments
Open

MongoError: Authentication failed. #22

Swapnull opened this issue Jun 25, 2021 · 2 comments

Comments

@Swapnull
Copy link

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

> nettu-meet-server@1.0.0 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!

@fmeringdal
Copy link
Owner

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?

@Swapnull
Copy link
Author

Swapnull commented Jul 1, 2021

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
image

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants