Fixing AWS Elastic Beanstalk’s “could not parse environment variables” error for /opt/elasticbeanstalk/bin/get-config

When deploying Laravel and WordPress to AWS Elastic Beanstalk, creating an .env file or just making use of environment variables is a common practice; however, Elastic Beanstalk tends to choke on string values of “null” and often returns the error message could not parse environment variables.

To resolve this issue, run the following command:

/opt/elasticbeanstalk/bin/get-config optionsettings

Look for any string values that seem like they would cause an issue, but especially string values that look like “null”; if found, run using your eb CLI command (assuming REDIS_PASSWORD is at fault):

eb setenv REDIS_PASSWORD=''

Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *