Lost MongoDB Root Password
samliew94
HOBBYOP

2 years ago

Project ID: 09bfaafb-33a7-48fe-b38c-677ca286d82e/service/3ee2d273-484d-4f5d-839c-138b723e0bf6

Hi. Is there a way to recover the original MONGOPASSWORD Variable value?

I thought changing the Variable values for MONGO_INITDB_ROOT_USERNAME & MONGO_INITDB_ROOT_PASSWORD would change the MongoDB actual root username and password as well, which it didn't.

So now I've lost the original password and can no longer access the DB.

The DB isn't empty and I got no backup in place.

I tried disabling authentication via custom start command with docker-entrypoint.sh mongod --noauth --ipv6 --bind_ip ::,0.0.0.0, but I get error initialization failed.

Closed

32 Replies

2 years ago

Can yky show us the full error?


samliew94
HOBBYOP

2 years ago

this is when I restarted the MongoDB container with --noauth flag

1284129911828774964


2 years ago

did you change the startcommand?


2 years ago

is that how youre doing it


samliew94
HOBBYOP

2 years ago

yes, because I lost the root password & am trying to access the MongoDB without authenticating


samliew94
HOBBYOP

2 years ago

so i thought of restarting the MongoDB container with authentication disabled


samliew94
HOBBYOP

2 years ago

this is original:

docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0

this is what I tried (disabling authentication):

docker-entrypoint.sh mongod --noauth --ipv6 --bind_ip ::,0.0.0.0


2 years ago

is --noauth the correct flag?


samliew94
HOBBYOP

2 years ago

I think so, it's in the mongod documentation

1284131891435540533


2 years ago

currently the default?


2 years ago

can you show the content of the docker-entrypint.sh


samliew94
HOBBYOP

2 years ago

or do you know of any way to recover the password or access the MongoDB data?

1284132092661334027


samliew94
HOBBYOP

2 years ago

docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0

this is the default


2 years ago

what is in the docker-entrypoint.sh


samliew94
HOBBYOP

2 years ago

I don't quite follow


samliew94
HOBBYOP

2 years ago

1284132417040285819


2 years ago

docker-entrypint.sh is a shell script


2 years ago

wait ur probably just using the mongodb tyemplate one sec


2 years ago

nevermind im lostr


samliew94
HOBBYOP

2 years ago

yes.


samliew94
HOBBYOP

2 years ago

I suppose this in Railway's context is a template

1284137108709310494


samliew94
HOBBYOP

2 years ago

I changed this value without saving the original, thinking that this overrides MongoDB's internal password, which it didn't

1284137510968102913


samliew94
HOBBYOP

2 years ago

so now I'm locked out from my own database


2 years ago

have you tried using the one in the value of MONGOPASSWORD


2 years ago

or just making them both the same value


samliew94
HOBBYOP

2 years ago

both have the same values


2 years ago

I have replied to your help station post.


samliew94
HOBBYOP

2 years ago

Hi. Yes I did indeed log the full MONGO_URL before hiding it. So if I could trace back the logs that would help.

but seems like I can't go back any further than Sep 06


samliew94
HOBBYOP

2 years ago

The logs that I need to trace back are probably somewhere in Aug


2 years ago

hello, i did not mention any logs, as i mentioned, please check your project activity


samliew94
HOBBYOP

2 years ago

Thank you so much, Brody!! I have found the ori password with this


2 years ago

awsome!


Welcome!

Sign in to your Railway account to join the conversation.

Loading...