Closed Minecodes closed 2 years ago
Maybe there's no way to connect to the MongoDB in the container/environment Ackee is running. There shouldn't be any trouble connecting otherwise.
I'm closing this issue, because I'm not able to reproduce it. Let me know if there's something I can help with.
@Minecodes is your MongoDB running within another docker container? I got the same issue. After tested with some users with write permission on ackee database, I even tried with mongo root account, but it could not authenticate as expected.
@Minecodes I've fixed my issue. Here is short note, may be useful for you or someone who is facing this problem.
mongodb://USERNAME:PASSWORD@IP:PORT/ackeedb
ackeedb
with enough permissionIn mongodb you can do it as below:
# connect to mongodb cli with admin account, e.g, admin
mongo -u ADMIN_USER
# with docker
docker exec -it CONTAINER mongo -u ADMIN_USER
# switch to ackee db
use ackeedb
# create user
db.createUser({
user: 'USERNAME',
pwd: 'PASSWORD',
roles:[
{
role: 'readWrite',
db: 'ackeedb'
}
]
})
No, it's on MongoDB Atlas @ndaidong
@Minecodes please, verify if your user does have permission to read/write any database at Security tab on MongoDB Atlas. I had the same issue when I started to use Ackee and it was solved changing this configuration,
@carvalholeo it was the right user, because I used it in my MongoDB CLI.
My server said "Bad auth" on MongoDB, but my password was right and everything other too.