Error When trying to Connect to Database

I cannot connect to MySQL Database…
Here is my error message;

No matching clause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

Any help please

@Kolotayo
Which version of Metabase? Which version of MySQL?
Are you trying to use the MySQL as a datasource or for internal metadata?
Connecting over SSH to MySQL?
Are you using any JDBC connection options?

Dear Flamber,

Metabase Version is v0.32.1
I have Erpnext installed and i am trying to connect METABASE to my database

I am not connecting over SSH.
I have my Erpnext hosted on AWS.
I am not using any JDBC Connections Options

@Kolotayo

Try upgrading to 0.32.2 - there has been a few issues with the new 0.32 release with some database - version 0.32.3 should be released Monday.

Which version of MySQL are you connecting to? Are you using RDS on AWS?

Which version of Java are you using?

There’s several examples on what could cause that error here:
https://stackoverflow.com/questions/6865538/solving-a-communications-link-failure-with-jdbc-and-mysql

Thank You
Checking that right away

Hello Guys,

I was able to connect to MySql Database successfully with the following instructions.
i followed the instructions on this link but i only used the one strictly for MySql Connection

i have crashed my instance purposely just to be sure i didnt just do it and to be sure it works well.

If you have any questions and clarification.
i will be here.

Thanks to @flamber

1 Like

Hi Metabase Team, @flamber,

I have my meatabse cluster on aws. And metadata is stored on MySQL which is not maintained by me. Communication link failure is very common error that I'm facing - to the extent that out of 10 requests, at least 8 will be failed.
Log:

Jun 11 13:54:25 ERROR metabase.driver.generic-sql.query-processor :: nil
Jun 11 13:54:25 WARN metabase.query-processor :: {:status :failed,
:class java.lang.Exception,
:error "Communications link failure\n\nThe last packet successfully received from the server was 136,545 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.",
:stacktrace
["driver.generic_sql.query_processor$do_with_try_catch.invokeStatic(query_processor.clj:522)"
"driver.generic_sql.query_processor$do_with_try_catch.invoke(query_processor.clj:514)"
"driver.generic_sql.query_processor$execute_query.invokeStatic(query_processor.clj:574)"
"driver.generic_sql.query_processor$execute_query.invoke(query_processor.clj:570)"
"driver$fn__28422$G__28229__28429.invoke(driver.clj:104)"
"query_processor$execute_query.invokeStatic(query_processor.clj:54)"

I went through solutions mentioned in above comments and few other blogs. The only thing in my hand is to set autoReconnect=true for database on metabase.

But how do I do that on metabase?

Hi @mohannv
Please post “Diagnostic Info” from Admin > Troubleshooting.
Are you connecting over SSH? If yes, via Metabase or your own tunnel?
You can set autoReconnect=true in the connection string in Admin > Databases.

Hi @flamber,

  • I’m using 0.30.4 version of Metabase. There is no option of Admin > Troubleshooting. Although above log is copied from log option on UI.
  • autoReconnect=true, I want to set this option to metadata database, not for data set database
  • I’m thinking to upgrade to next stable version, which one I can use for upgrading. And does the upgrade has any modifications in metadata schema? (I’m aware upgrade operation will be handled by application, but if the database user don’t have ddl operation permissions, then it fails right. Hence the question)

Thanks in advance!

@mohannv

  1. That’s a very old version. The problem was fixed in 0.33 or 0.34 - latest release is 0.35.4 - remember to backup before upgrading.
  2. You can set the option with MB_DB_CONNECTION_URI
  3. There are a lot of changes to metadata. You can set MB_DB_AUTOMIGRATE, so it will print changes that you can manually apply.
1 Like