AWS EB deployment error using MySQL as application database


I’m having problems when deploying to elastic beanstalk. My goal is to have the EC2 instance managed by EB and create a RDS instance separately so they are not coupled. I’m following this guide except for the part of attaching a RDS instance. And I’m using metabase v0.33.6.

When I have been testing metabase I can properly see and use the metabase engine because it’s using the local h2 storage. So what I do when trying to deploy for a production environment is to deploy the help of EB and then set the following environment variables:

export MB_DB_TYPE=mysql
export MB_DB_DBNAME=metabase
export MB_DB_PORT=3306
export MB_DB_USER=my_username_with_permissions
export MB_DB_PASS=my_password
export MB_DB_HOST=rds_host

After the environment restarts I receive a 502 nginx bad gateway error when accesing to the EB url. Sometimes I was able to see a page in which it seemed to be configuring some tables. In the database it created two tables DATABASECHANGELOG and DATABASECHANGELOGLOCK. I’ve been using a t2.large EC2 instance to not run out of memory or CPU and a db.t3.small database instance.

The nginx error log shows something like:

 connect() failed (111: Connection refused) while connecting to upstream, client

There are any logs at /var/log/metabase. I can’t provide more log details right now cause I’ve terminated all my instances but I can replicate all of them.

I’d really appreciate any help with this or maybe some hints of what it can be going on.


Hi @jabascal
I don’t use EBS, but the current way Metabase does the one-click-deploy script is by defining Postgres manually, so if you want to use MySQL, you would need to mess around with some of the that.
Have a look at this issue comments:
If you’re using EBS, you should be able to find the logs via the AWS interface - it should include the Metabase logs, as well as several other logs.