https://www.growthbook.io/ logo
r

red-oxygen-69265

05/24/2022, 8:21 PM
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

future-teacher-7046

05/24/2022, 8:24 PM
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

red-oxygen-69265

05/24/2022, 8:25 PM
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

future-teacher-7046

05/24/2022, 8:26 PM
It uses whatever is in your Mongo connection string
r

red-oxygen-69265

05/24/2022, 8:27 PM
for me it is
<mongodb://root>:...@ab-mongodb:27017/
am I missing DB name?
f

future-teacher-7046

05/24/2022, 8:28 PM
yes, you can add it after the slash. It has a default DB name it uses as a fallback (I think
test
?)
r

red-oxygen-69265

05/24/2022, 8:33 PM
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

future-teacher-7046

05/24/2022, 8:34 PM
MongoDB Compass is a nice GUI for interacting with the db
r

red-oxygen-69265

05/24/2022, 8:35 PM
I get auth failed on that too. weird
f

future-teacher-7046

05/24/2022, 8:41 PM
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

red-oxygen-69265

05/24/2022, 9:10 PM
Thanks @future-teacher-7046. it helped a lot
f

fresh-tailor-1332

05/30/2022, 11:44 AM
@red-oxygen-69265 How did you solved this please ?
f

future-teacher-7046

05/30/2022, 11:54 AM
It was a MongDB authentication error. Needed to add
?authSource=admin
to the Mongo connection string.
1
f

fresh-tailor-1332

05/30/2022, 11:59 AM
Thanks @future-teacher-7046 But looks like
authSource
is already defaulted to
admin
. See here
f

future-teacher-7046

05/30/2022, 12:11 PM
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

fresh-tailor-1332

05/30/2022, 12:18 PM
Growthbook documentation uses
MONGODB_URI=<mongodb://root:password@mongo:27017/>
, do we need to add a DB name ?
f

future-teacher-7046

05/30/2022, 12:56 PM
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
10 Views