toptal/haste-server

Authentication failed (MongoDB)

stathri opened this issue · 2 comments

Hi, I'm having issues using MongoDB as storage. It worked up until I changed the username & database name. I did update both of those in the configuration file however it refuses to authenticate.

See the storage config below. I've removed the password and IP address for obvious reasons.
image

See the error below.
image

Hi @stathri
I'm sorry you're having issues connecting with mongo.

I can't say for sure, but it seems your connection string is malformed. According the documentation the expected format is:

mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]

Hi, adding ?authSource=admin seems to have fixed it.