disasterkid
disasterkid

Reputation: 7278

Metabase Database Connection To MySQL RDS: Timed out after 5000 milliseconds

My Metabase is running on an Amazon Beanstalk instance and I have created an RDS database (MySQL) to which I have access to using the MySQL Workbench.

When I try to add my database to Metabase, I get the following error message:

Timed out after 5000 milliseconds.

I have tried to increase the timeout on the RDS instance but apparently, you should create a new parameter group. But I do not know how to mention that parameter group to Metabase (in Additional JDBC connection string options maybe?)

The MySQL RDS is publicly available.

Update: Security Group Settings on RDS Instance

Inbound: 
Custom TCP Rule  
TCP  
3306
83.219.196.40/32

Outbound: 
All traffic 
All 
All
0.0.0.0/0

Update 2: Metabase Log Message

Jun 25 12:05:13 ERROR metabase.driver :: Failed to connect to database: Timed out after 5000 milliseconds.
Jun 25 12:05:13 DEBUG metabase.middleware :: POST /api/database 400 (5 s) (0 DB calls)
{:valid false, :dbname "Timed out after 5000 milliseconds.", :message "Timed out after 5000 milliseconds."}

Upvotes: 2

Views: 2616

Answers (2)

QiuYi
QiuYi

Reputation: 133

export MB_DB_CONNECTION_TIMEOUT_MS=50000
java -jar meatabase.jar

The default database connection is 5 seconds. You can make it bigger, like 50 seconds.

Upvotes: 0

John Rotenstein
John Rotenstein

Reputation: 269284

Your security group is currently only permitting access from one IP address (as shown above). It is blocking access from the web application.

You will need to add a rule to the RDS security group permitting inbound access from the web application.

The best way to do this is to find the ID of the Security Group that is associated with your web application (eg sg-abcd1234). Then, add a rule to the RDS security group permitting access from this Security Group ID. This will then allow access from any EC2 instance that uses that security group (even if Beanstalk adds/removes instances they will all inherit access).

Upvotes: 3

Related Questions