#App crashing when redis failed

3 messages · Page 1 of 1 (latest)

cinder bobcat
#

H All I need help on this issue

Currently, we have implemented Redis with Cache Manager in our project. The Redis password is stored in a key vault and is updated monthly. Once the password is updated in the key vault, Redis throws a WRONGPASS error, causing the app to crash. Restarting the server is the only fix we have now.

Is it possible to re-register with the new configuration in app.module.ts, or is there another way to handle this?

https://github.com/nestjs/cache-manager/issues/429

GitHub

Is there an existing issue for this? I have searched the existing issues Current behavior Currently, we have implemented Redis with Cache Manager in our project. The Redis password is stored in a k...

unkempt thistle
#

So. There is no way to swap a config value (like a password) in a running Redis client that I know of. The only way to swap the password is to restart the server (causing the Redis client to be re-initialized with the new password). So, the issue isn't a Nest issue (and why you were politely pointed to post here).

This comes down to coordinating the release (restart) of the application. You'd need to time its restart with the rotation. And, the rotation workflow should be

  • new password added to Redis
  • application restarted
  • old password deleted
#

Theoretically, you should have a blue-green deployment process, where you can gracefully shutdown applications and start them again with the new credentials.