Hi. starting yesterday I am getting `Authenticatio...
# announcements
r
Hi. starting yesterday I am getting
AuthenticationFailed
on backend connecting to mongodb. I am using this on kubernetes using this helm chart by @adventurous-vase-72101. I checked
MONGODB_ROOT_PASSWORD
env var for mongodb is same as what we use in
MONGODB_URI
. has there been any change in
growthbook/growthbook:latest
image?
f
You're the 2nd person to report auth issues with the latest Docker build. The changes in the latest commit are completely unrelated to auth, but maybe the build got corrupted somehow. I'm going to force a new build and see if that fixes it.
r
I switched to an older tag but didn’t fix
for example
growthbook/growthbook:git-5fb0979
shows same issue
what is the DB name?
f
It uses whatever is in your Mongo connection string
r
for me it is
<mongodb://root>:...@ab-mongodb:27017/
am I missing DB name?
f
yes, you can add it after the slash. It has a default DB name it uses as a fallback (I think
test
?)
r
no that doesn’t work. for whatever reason I editted this in the morning and maybe forget the old DB. any chance I can find that? trying to connec to mongodb but
show dbs
doesn’t list any db
f
MongoDB Compass is a nice GUI for interacting with the db
r
I get auth failed on that too. weird
f
I wonder if it somehow started multiple Mongo containers when you updated. Happy to jump on a call and help debug if that would be helpful
r
Thanks @future-teacher-7046. it helped a lot
f
@red-oxygen-69265 How did you solved this please ?
f
It was a MongDB authentication error. Needed to add
?authSource=admin
to the Mongo connection string.
1
f
Thanks @future-teacher-7046 But looks like
authSource
is already defaulted to
admin
. See here
f
I know that's what it says in the docs, but it doesn't seem to actually behave that way in practice. If you specify a database name in the connection string, it seems to use that as the authdb unless you explicitly tell it otherwise.
So doing
/test
at the end of the connection string won't work, but doing
/test?authSource=admin
does
👍 1
f
Growthbook documentation uses
MONGODB_URI=<mongodb://root:password@mongo:27017/>
, do we need to add a DB name ?
f
The default setup is optimized for testing out growthbook on localhost. For production, you typically do want to specify more connection options, including a DB name