Description
DATABASE_PASSWORD silently overrides Maintenance Mode password
Description
When running a new instance of FusionAuth using the Docker image with DATABASE_PASSWORD set, the password specified on the Maintenance Mode form is silently ignored. (I was populating DATABASE_PASSWORD from an AWS Secret that accidentally happened to be a JSON blob of RDS credentials instead of just the password.) I was specifying the correct password on the form, but kept getting this error:
The database and schema exist, but for some reason the ordinary user you specified cannot connect to it. Perhaps the user already existed and you provided the wrong password. The error from the database was [Access denied for user 'fusionauth'@'172.30.33.164' (using password: YES)].
The FusionAuth logs didn't contain any mention of DATABASE_PASSWORD being set or the failed login attempts.
Affects versions
1.27.1
Steps to reproduce
Start the FusionAuth Docker image against an empty, existing database with DATABASE_PASSWORD set to an incorrect value. It will be impossible to exit Maintenance Mode.
Expected behavior
One of the following:
- The password field on the Maintenance Mode form disabled with a note that the password has already been set via the environment variable
- The password on the Maintenance Mode form to be used to initialize the database (even if FusionAuth can no longer access it on restart)
- A hint that the password on the form does not match the password in the environment
Platform
- Docker (AWS ECS)
- MySQL 8.0.15