Reputation: 41238
I have an Elastic Beanstalk application that can't connect to the database but the server it's running on can connect to the database just fine.
When I try to deploy my elastic beanstalk application, it gives me a database error Access Denied
(the deploy process needs to connect to the database in order to run migrations. My database is on RDS. I have the environment variables for the database configured in the environment. I have the security groups set up to allow the environment servers to connect to RDS. When I ssh into the server, I can open a database connection through the database terminal to the database. It's only the application that can't connect. What is going wrong?
Upvotes: 1
Views: 645
Reputation: 41238
The problem is non-alphanumeric characters in the database password. In this case, the particular culprit is "$". Changing the database password to be purely alphanumeric solves it.
Elastic beanstalk environment variables are passed to your application through a shell script that it generates. If you have a dollar sign in your password, Linux will interpret this as a shell variable embedded in the password and will ignore anything after the dollar sign in the password.
Upvotes: 3