electerious / Ackee

Self-hosted, Node.js based analytics tool for those who care about privacy.
https://ackee.electerious.com
MIT License
4.27k stars 359 forks source link

Context creation failed: command find requires authentication #308

Closed jaschaschmidt closed 2 years ago

jaschaschmidt commented 2 years ago

🐞 Describe the bug

Context creation failed: command find requires authentication. This only happens when authentication is enabled on the MongoDB Server.

📚 To Reproduce

Enable authentication on the MongoDB Server v4.4.10 and try to connect to the database.

💡 Expected behavior

The connection should work when authentication is enabled.

🖼️ Screenshots

N/A

⚙️ Environment

📋 Additional context

Is there any way to add the auth source to the mongodb uri like this? ?authSource=admin

electerious commented 2 years ago

You need to include the username and password in the MongoDB URL when you have authentication enabled: https://docs.mongodb.com/manual/reference/connection-string/