Lost MongoDB Root Password

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.
Solution:
hello, i did not mention any logs, as i mentioned, please check your project activity
Jump to solution
25 Replies
Percy
Percy3mo ago
Project ID: 09bfaafb-33a7-48fe-b38c-677ca286d82e,3ee2d273-484d-4f5d-839c-138b723e0bf6
milo
milo3mo ago
Can yky show us the full error?
sam943228
sam943228OP3mo ago
this is when I restarted the MongoDB container with --noauth flag
No description
milo
milo3mo ago
did you change the startcommand? is that how youre doing it
sam943228
sam943228OP3mo ago
yes, because I lost the root password & am trying to access the MongoDB without authenticating so i thought of restarting the MongoDB container with authentication disabled 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
milo
milo3mo ago
is --noauth the correct flag?
sam943228
sam943228OP3mo ago
I think so, it's in the mongod documentation
No description
milo
milo3mo ago
currently the default? can you show the content of the docker-entrypint.sh
sam943228
sam943228OP3mo ago
or do you know of any way to recover the password or access the MongoDB data?
No description
sam943228
sam943228OP3mo ago
docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0 this is the default
milo
milo3mo ago
what is in the docker-entrypoint.sh
sam943228
sam943228OP3mo ago
I don't quite follow
sam943228
sam943228OP3mo ago
No description
milo
milo3mo ago
docker-entrypint.sh is a shell script wait ur probably just using the mongodb tyemplate one sec nevermind im lostr
sam943228
sam943228OP3mo ago
yes.
sam943228
sam943228OP3mo ago
I suppose this in Railway's context is a template
No description
sam943228
sam943228OP3mo ago
I changed this value without saving the original, thinking that this overrides MongoDB's internal password, which it didn't
No description
sam943228
sam943228OP3mo ago
so now I'm locked out from my own database
milo
milo3mo ago
have you tried using the one in the value of MONGOPASSWORD or just making them both the same value
sam943228
sam943228OP3mo ago
both have the same values
Brody
Brody3mo ago
I have replied to your help station post.
sam943228
sam943228OP3mo 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 The logs that I need to trace back are probably somewhere in Aug
Solution
Brody
Brody3mo ago
hello, i did not mention any logs, as i mentioned, please check your project activity
sam943228
sam943228OP3mo ago
Thank you so much, Brody!! I have found the ori password with this
Brody
Brody3mo ago
awsome!
Want results from more Discord servers?
Add your server