Skip to content
Redis regenerated password not working
mohitdrumbeat
OP

a month ago

So after the recent security incident, I was changing the passwords of all my databases and redis etc. For Redis, I used the recommended "Regenerate" button in "Database > Config" tab and it successfully showed a new password in the password box. I checked "Variables" tab and the new password was updated there as well automatically.

But when I updated my other services to use the new password, these services didn't connect and gave the error for wrong username-password pair.

I tried connecting directly using redis-cli and it also didn't connect, neither from my local machine nor from Railway service's own console. Then just to check I used my old password and it connected successfully. I have tried restarting, re-deploying, removing deployment and then re-deploy and every other thing I could think of, but internally redis service keeps using the old password. I've tried regenerating again but still the same.

Can you please check and let me know what's going wrong? After the security incident it's very important for me to rotate my secrets but the platform itself is not allowing me to do so, leaving me vulnerable.

Thanks

Solved

1 Reply

Railway
BOT

a month ago

What you're describing means the Redis instance and its password variable are out of sync: the database still holds the old password while the variable shows the new one. Regenerate only works when both sides match beforehand. A database stores its credentials in its data directory on the volume, so redeploying or restarting never makes it pick up a password from the variable.

To get them back in sync, set the Redis password variable back to the old password, the one that still connects, and redeploy Redis and the services that use it. Once the variable matches what Redis actually holds, run Regenerate again from the Config tab, then redeploy every service that references the password or the Redis URL so they pick up the new value.

Regenerate applies to the environment that's selected in the dashboard, so if your project has Redis in more than one environment, repeat this in each one you want to rotate.


Status changed to Awaiting User Response Railway • 26 days ago


Railway
BOT

19 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway • 19 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...